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

Issue 75330043: Upload tools API (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by wallyworld
Modified:
10 years, 1 month ago
Reviewers:
mp+210764, jameinel, fwereade
Visibility:
Public.

Description

Upload tools API An API is provided to allow clients to upload tools. This is used by the upgrade command and removes the need for it to have to create an environment and upload directly to storage. It also allows us to switch to non cloud storage. A lot of the changes are due to code refactoring. The implementation uses an authenticated HTTP endpoint which shares code with the charm upload API. So common code was extracted and shared. The sync tools code was refactored to split up the building and uploading of tools. This allows the building part to be stubbed out for testing. A followup branch can rework the bootstrap code to take advantage of this. https://code.launchpad.net/~wallyworld/juju-core/upload-tools-api/+merge/210764 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Upload tools API #

Total comments: 30

Patch Set 3 : Upload tools API #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+933 lines, -288 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/bootstrap_test.go View 1 chunk +24 lines, -0 lines 0 comments Download
M cmd/juju/upgradejuju.go View 1 11 chunks +93 lines, -72 lines 0 comments Download
M cmd/juju/upgradejuju_test.go View 6 chunks +36 lines, -29 lines 0 comments Download
M environs/sync/sync.go View 1 2 1 chunk +116 lines, -59 lines 0 comments Download
M environs/sync/sync_test.go View 1 2 2 chunks +78 lines, -34 lines 0 comments Download
M environs/testing/tools.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/tools/testing/testing.go View 2 chunks +6 lines, -5 lines 0 comments Download
M state/api/client.go View 1 2 2 chunks +61 lines, -0 lines 0 comments Download
M state/apiserver/apiserver.go View 1 2 1 chunk +8 lines, -1 line 1 comment Download
M state/apiserver/charms.go View 3 chunks +1 line, -44 lines 0 comments Download
M state/apiserver/charms_test.go View 3 chunks +48 lines, -38 lines 0 comments Download
A state/apiserver/httphandler.go View 1 2 1 chunk +65 lines, -0 lines 0 comments Download
A state/apiserver/tools.go View 1 2 1 chunk +194 lines, -0 lines 0 comments Download
A state/apiserver/tools_test.go View 1 chunk +197 lines, -0 lines 0 comments Download
M worker/upgrader/upgrader_test.go View 1 2 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 6
wallyworld
Please take a look.
10 years, 1 month ago (2014-03-13 09:59:10 UTC) #1
wallyworld
Please take a look.
10 years, 1 month ago (2014-03-13 10:42:18 UTC) #2
jameinel
I really like having the tools get uploaded via a POST rather than directly to ...
10 years, 1 month ago (2014-03-13 13:34:14 UTC) #3
fwereade
This looks really nice. If you can address my/jam's comments to the satisfaction of a ...
10 years, 1 month ago (2014-03-13 22:22:25 UTC) #4
wallyworld
Please take a look. https://codereview.appspot.com/75330043/diff/20001/cmd/juju/upgradejuju.go File cmd/juju/upgradejuju.go (right): https://codereview.appspot.com/75330043/diff/20001/cmd/juju/upgradejuju.go#newcode268 cmd/juju/upgradejuju.go:268: uploaded, err = context.uploadTools1dot17(builtTools, series...) ...
10 years, 1 month ago (2014-03-13 22:48:39 UTC) #5
fwereade
10 years, 1 month ago (2014-03-13 22:55:53 UTC) #6
LGTM, thanks.

https://codereview.appspot.com/75330043/diff/20001/state/apiserver/httphandle...
File state/apiserver/httphandler.go (right):

https://codereview.appspot.com/75330043/diff/20001/state/apiserver/httphandle...
state/apiserver/httphandler.go:25: errorSender
On 2014/03/13 22:48:40, wallyworld wrote:
> On 2014/03/13 13:34:15, jameinel wrote:
> > It might be bad go form to embed an interface in a struct. (You collect
> structs
> > into structs, and combine interfaces into interfaces, but mixing them is
> > probably not great.)
> > 
> > I'm not positive about it, but certainly having to do:
> > 
> > foo.specialInterface = foo
> > 
> > doesn't look right to me.
> 
> Embedded interfaces are fine AFAIK. We've used them elsewhere in Juju but I
> can't recall where, just remember seeing them. eg we embedded error in various
> places. It's a convenient way to plug in behaviour into a struct.

Yeah, I think it's fine fwiw.

https://codereview.appspot.com/75330043/diff/40001/state/apiserver/apiserver.go
File state/apiserver/apiserver.go (right):

https://codereview.appspot.com/75330043/diff/40001/state/apiserver/apiserver....
state/apiserver/apiserver.go:157: charmHandler.httpHandler.errorSender =
charmHandler
that `.httpHandler` makes everything clear enough that the comment is almost
redundant -- I didn't quite follow your live explanation but it's clear now --
but I'm reluctant to actually drop it. It's good as it is.
Sign in to reply to this message.

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