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

Issue 10711044: state/api/upgrader: Implement client side

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jameinel
Modified:
10 years, 10 months ago
Reviewers:
mue, mp+172812, john2, fwereade, gz
Visibility:
Public.

Description

state/api/upgrader: Implement client side This fixes some of the server side code, where Upgrader wasn't actually exposed in the API, and a workaround for a JSON marshalling bug (not handling embedded objects). It implements Upgrader.SetTools and Upgrader.Tools in the client. The only bit left to expose is the WatchAPIVersion code, which is going to be a bit trickier. I wanted to start getting feedback on this early, so here it is. I think this can be landed without the rest of Upgrader API (though the rest needs to land before we can switch the Worker over). https://code.launchpad.net/~jameinel/juju-core/upgrader-api-client/+merge/172812 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7

Patch Set 2 : state/api/upgrader: Implement client side #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -30 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/api/params/params.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M state/api/upgrader/upgrader.go View 1 2 chunks +54 lines, -0 lines 0 comments Download
M state/api/upgrader/upgrader_test.go View 1 5 chunks +76 lines, -16 lines 0 comments Download
M state/apiserver/root.go View 1 2 chunks +11 lines, -0 lines 0 comments Download
M state/apiserver/upgrader/upgrader.go View 1 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/upgrader/upgrader_test.go View 1 2 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 7
jameinel
Please take a look.
10 years, 10 months ago (2013-07-03 13:07:30 UTC) #1
jameinel
https://codereview.appspot.com/10711044/diff/1/state/apiserver/upgrader/upgrader.go File state/apiserver/upgrader/upgrader.go (right): https://codereview.appspot.com/10711044/diff/1/state/apiserver/upgrader/upgrader.go#newcode124 state/apiserver/upgrader/upgrader.go:124: logger.Debugf("Returning AgentTools: %#v", agentTools) We probably don't need this ...
10 years, 10 months ago (2013-07-03 13:10:11 UTC) #2
fwereade
LGTM https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go File state/api/params/params.go (right): https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go#newcode254 state/api/params/params.go:254: AgentTools AgentTools I think there's a "go1.1" string ...
10 years, 10 months ago (2013-07-03 13:58:43 UTC) #3
john2
The go1.1 flag isnt relevant because Im pretty sure this format nests the values in ...
10 years, 10 months ago (2013-07-03 15:01:24 UTC) #4
gz
LGTM https://codereview.appspot.com/10711044/diff/1/state/api/upgrader/upgrader.go File state/api/upgrader/upgrader.go (right): https://codereview.appspot.com/10711044/diff/1/state/api/upgrader/upgrader.go#newcode38 state/api/upgrader/upgrader.go:38: // TODO: Error case Does this want a ...
10 years, 10 months ago (2013-07-03 16:07:32 UTC) #5
mue
LGTM https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go File state/api/params/params.go (right): https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go#newcode254 state/api/params/params.go:254: AgentTools AgentTools On 2013/07/03 13:58:43, fwereade wrote: > ...
10 years, 10 months ago (2013-07-03 17:00:53 UTC) #6
jameinel
10 years, 10 months ago (2013-07-04 07:53:17 UTC) #7
Please take a look.

https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go
File state/api/params/params.go (right):

https://codereview.appspot.com/10711044/diff/1/state/api/params/params.go#new...
state/api/params/params.go:254: AgentTools AgentTools
William was talking about using the TODO comment:

// TODO go1.1: Nest this when we can rely on go-1.1

However, because this is officially exposed in the bytes on the wire, we can't
actually do it even when we transition to 1.1.

Specifically if you have embedded types encoded by JSON it would look like:

{"Tag": "foobar", "Major": 1, "Minor": 2, ..., "Error": null}

However, because we have to work around it in go 1.0.3 we have:

{"AgentTools": {"Tag": "foobar", "Major": 1, ...}, "Error": null}

So while I do prefer the former syntax, we can't get it in go 1.0.3, and we
don't want to change our bytes-on-the-wire when we upgrade to go 1.1.

https://codereview.appspot.com/10711044/diff/1/state/api/upgrader/upgrader.go
File state/api/upgrader/upgrader.go (right):

https://codereview.appspot.com/10711044/diff/1/state/api/upgrader/upgrader.go...
state/api/upgrader/upgrader.go:38: // TODO: Error case
On 2013/07/03 16:07:32, gz wrote:
> Does this want a fmt.Errorf at least and a comment about testing it?

Done.
Sign in to reply to this message.

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