Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2470)

Issue 13511044: api/uniter: Relation and RelationById take 1 call (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by dimitern
Modified:
10 years, 7 months ago
Reviewers:
mp+184564, rog
Visibility:
Public.

Description

api/uniter: Relation and RelationById take 1 call Instead of making 2 server API calls to retrieve a single relation as before, now it takes just one call. Added Life as part of the RelationResult and changed the server-side uniter API not to report relations lifecycle with Life(). https://code.launchpad.net/~dimitern/juju-core/128-api-uniter-refactor-relations-calls/+merge/184564 Requires: https://code.launchpad.net/~dimitern/juju-core/127-api-uniter-relationbyid/+merge/184532 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : api/uniter: Relation and RelationById take 1 call #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -39 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/params/internal.go View 1 1 chunk +3 lines, -2 lines 0 comments Download
M state/api/uniter/relation.go View 1 1 chunk +6 lines, -2 lines 0 comments Download
M state/api/uniter/relation_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/api/uniter/uniter.go View 3 chunks +2 lines, -12 lines 0 comments Download
M state/apiserver/uniter/uniter.go View 1 2 chunks +4 lines, -10 lines 0 comments Download
M state/apiserver/uniter/uniter_test.go View 4 chunks +8 lines, -12 lines 0 comments Download

Messages

Total messages: 4
dimitern
Please take a look.
10 years, 7 months ago (2013-09-09 12:49:30 UTC) #1
rog
Nice change, thanks. Just a few remarks below. https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go File state/api/params/internal.go (right): https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go#newcode154 state/api/params/internal.go:154: // ...
10 years, 7 months ago (2013-09-09 13:00:22 UTC) #2
dimitern
Please take a look. https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go File state/api/params/internal.go (right): https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go#newcode154 state/api/params/internal.go:154: // local endpoint for a ...
10 years, 7 months ago (2013-09-09 13:06:36 UTC) #3
rog
10 years, 7 months ago (2013-09-09 13:27:56 UTC) #4
On 2013/09/09 13:06:36, dimitern wrote:
> Please take a look.
> 
> https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go
> File state/api/params/internal.go (right):
> 
>
https://codereview.appspot.com/13511044/diff/1/state/api/params/internal.go#n...
> state/api/params/internal.go:154: // local endpoint for a single relation or
an
> error.
> On 2013/09/09 13:00:22, rog wrote:
> > How about:
> > // RelationResult returns information about a single relation,
> > // or an error.
> > 
> > ?
> > The information returned should be evident from the fields in the struct
> (which,
> > BTW, could probably do with some documentation themselves at some point)
> 
> Done.
> 
> https://codereview.appspot.com/13511044/diff/1/state/api/uniter/relation.go
> File state/api/uniter/relation.go (right):
> 
>
https://codereview.appspot.com/13511044/diff/1/state/api/uniter/relation.go#n...
> state/api/uniter/relation.go:55: r.life = result.Life
> On 2013/09/09 13:00:22, rog wrote:
> > // Note: The life cycle information is the only
> > // thing that can change - id, tag and endpoint
> > // information are static.
> > 
> > ?
> 
> Done.
> 
>
https://codereview.appspot.com/13511044/diff/1/state/apiserver/uniter/uniter_...
> File state/apiserver/uniter/uniter_test.go (left):
> 
>
https://codereview.appspot.com/13511044/diff/1/state/apiserver/uniter/uniter_...
> state/apiserver/uniter/uniter_test.go:169: c.Assert(rel.Life(), gc.Equals,
> state.Dying)
> On 2013/09/09 13:00:22, rog wrote:
> > why not leave this in?
> 
> We don't really need this anymore - it was used to ensure the prerequisites of
> testing the relation's lifecycle.
> 
>
https://codereview.appspot.com/13511044/diff/1/state/apiserver/uniter/uniter_...
> File state/apiserver/uniter/uniter_test.go (right):
> 
>
https://codereview.appspot.com/13511044/diff/1/state/apiserver/uniter/uniter_...
> state/apiserver/uniter/uniter_test.go:190: {Error:
> apiservertesting.ErrUnauthorized},
> On 2013/09/09 13:00:22, rog wrote:
> > this change seems odd - aren't we allowed to ask for the life status of a
> dying
> > relation?
> 
> As the description says, we can no longer use Life() to ask for relations at
> all.

LGTM, thanks!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b