Merge lp://staging/~themue/juju-core/035-bootstrap-autosync into lp://staging/~go-bot/juju-core/trunk
- 035-bootstrap-autosync
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Frank Mueller | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 1561 | ||||
Proposed branch: | lp://staging/~themue/juju-core/035-bootstrap-autosync | ||||
Merge into: | lp://staging/~go-bot/juju-core/trunk | ||||
Diff against target: |
435 lines (+225/-41) 4 files modified
cmd/juju/bootstrap.go (+39/-2) cmd/juju/bootstrap_test.go (+183/-36) environs/ec2/storage.go (+1/-1) environs/sync/sync.go (+2/-2) |
||||
To merge this branch: | bzr merge lp://staging/~themue/juju-core/035-bootstrap-autosync | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Frank Mueller (community) | Approve | ||
Review via email: mp+177119@code.staging.launchpad.net |
Commit message
cmd/bootstrap: integrate syncing
After the CL moving the synchronization logic into an
own package this CL now checks if tools can be found
during bootstrap. If this is not possible it will use
the synchronization logic and then retries the
bootstrapping.
Description of the change
cmd/bootstrap: integrate syncing
After the CL moving the synchronization logic into an
own package this CL now checks if tools can be found
during bootstrap. If this is not possible it will use
the synchronization logic and then retries the
bootstrapping.
Frank Mueller (themue) wrote : | # |
Jeroen T. Vermeulen (jtv) wrote : | # |
LGTM, apart from some notes.
I would like to suggest that you change your commenting habits in the
tests a little bit. Each of your comments there is just a summary of
the code that follows — a "code smell" that usually indicates a need for
function extraction. I don't mind this in itself: Go makes function
extraction less effective and so the unfortunate pattern still has a
place. But the comments don't say _why_ specific things need to be
done. This is vitally important to anyone maintaining or debugging the
code after you.
https:/
File cmd/juju/
https:/
cmd/juju/
location on the file system as source of the tools")
Typo: the "chose" should be "choose" — but come to think of it, is it
worth having a verb there in the first place?
https:/
cmd/juju/
You interpret "not-found" errors coming out of Bootstrap. For the sake
of thoroughness, do we actually know that a not-found error coming out
of Bootstrap *has* to mean that no tools are available? Or is that just
the most likely cause of a not-found error?
https:/
File cmd/juju/
https:/
cmd/juju/
*gc.C) {
I'm not familiar with the autosync thing that this is about. And so I
have no idea how this test relates to it: where do you exercise
autosync? What aspect of it are you proving in this test? What exact
statement would be disproved by this test failing?
Explicit is better than implicit, and I find we often get better code
and better designs when we train ourselves to address a slightly less
specialized audience. Such as myself, in this case.
If what you're verifying is just that the command at the end returns
success, then consider testing something that the command actually does,
as well. Otherwise the command could fool you by doing nothing at all,
or perhaps by failing for some unrelated reason.
https:/
cmd/juju/
Pick one: "a" storage or "the" storage!
https:/
cmd/juju/
How embarrassing. You copied and pasted a typo. :)
https:/
cmd/juju/
directory.
Typo: "pupulate" should be "populate."
Also, this loop could be a good one to extract into a test helper, so
that the test itself is easier to grasp. The parameters and the return...
Frank Mueller (themue) wrote : | # |
Please take a look.
https:/
File cmd/juju/
https:/
cmd/juju/
location on the file system as source of the tools")
On 2013/07/26 10:29:48, jtv.canonical wrote:
> Typo: the "chose" should be "choose" — but come to think of it, is it
worth
> having a verb there in the first place?
Done. The verb is like "set" or "upload". But I'll change it to set here
too.
https:/
cmd/juju/
On 2013/07/26 10:29:48, jtv.canonical wrote:
> You interpret "not-found" errors coming out of Bootstrap. For the
sake of
> thoroughness, do we actually know that a not-found error coming out of
Bootstrap
> *has* to mean that no tools are available? Or is that just the most
likely
> cause of a not-found error?
Moved it into an earlier called ensure method. Here
tools.FindBoots
https:/
File cmd/juju/
https:/
cmd/juju/
*gc.C) {
On 2013/07/26 10:29:48, jtv.canonical wrote:
> I'm not familiar with the autosync thing that this is about. And so I
have no
> idea how this test relates to it: where do you exercise autosync?
What aspect
> of it are you proving in this test? What exact statement would be
disproved by
> this test failing?
> Explicit is better than implicit, and I find we often get better code
and better
> designs when we train ourselves to address a slightly less specialized
audience.
> Such as myself, in this case.
> If what you're verifying is just that the command at the end returns
success,
> then consider testing something that the command actually does, as
well.
> Otherwise the command could fool you by doing nothing at all, or
perhaps by
> failing for some unrelated reason.
Done. Made it more explicit by optical blocks and helpful comments.
https:/
cmd/juju/
On 2013/07/26 10:29:48, jtv.canonical wrote:
> Pick one: "a" storage or "the" storage!
Done.
https:/
cmd/juju/
On 2013/07/26 10:29:48, jtv.canonical wrote:
> How embarrassing. You copied and pasted a typo. :)
Done.
https:/
cmd/juju/
directory.
On 2013/07/26 10:29:48, jtv.canonical wrote:
> Typo: "pupulate" should be "populate."
> Also, this loop could be a good one to extract int...
Dimiter Naydenov (dimitern) wrote : | # |
LGTM with a few suggestions below
https:/
File cmd/juju/
https:/
cmd/juju/
location on the file system as source of the tools")
How about:
f.StringVar(
source")
?
https:/
cmd/juju/
This comment is redundant, I think.
https:/
cmd/juju/
availibilty of tools. If it doesn't find
// ensureToolsAvai
are found, it will automatically synchronize them.
?
https:/
cmd/juju/
syncing on screen.
// Capture possible output while syncing and log it.
?
https:/
cmd/juju/
Blank line before this one please.
https:/
cmd/juju/
// Synchronization done, retry.
?
https:/
File cmd/juju/
https:/
cmd/juju/
remove all
Can you please extract this block into a suite method, called e.g.
purgeTools and call it here and in the test below?
https:/
cmd/juju/
are the 1.0.0 tools.
This block as well? s.ensureTools(c, v100all) here and below?
Dimiter Naydenov (dimitern) wrote : | # |
LGTM with a few suggestions below
https:/
File cmd/juju/
https:/
cmd/juju/
location on the file system as source of the tools")
How about:
f.StringVar(
source")
?
https:/
cmd/juju/
This comment is redundant, I think.
https:/
cmd/juju/
availibilty of tools. If it doesn't find
// ensureToolsAvai
are found, it will automatically synchronize them.
?
https:/
cmd/juju/
syncing on screen.
// Capture possible output while syncing and log it.
?
https:/
cmd/juju/
Blank line before this one please.
https:/
cmd/juju/
// Synchronization done, retry.
?
https:/
File cmd/juju/
https:/
cmd/juju/
remove all
Can you please extract this block into a suite method, called e.g.
purgeTools and call it here and in the test below?
https:/
cmd/juju/
are the 1.0.0 tools.
This block as well? s.ensureTools(c, v100all) here and below?
Go Bot (go-bot) wrote : | # |
The attempt to merge lp:~themue/juju-core/035-bootstrap-autosync into lp:juju-core failed. Below is the output from the failed tests.
/bin/sh: 1: go: not found
Martin Packman (gz) wrote : | # |
Using this as a bot test, please don't mind the spam.
Go Bot (go-bot) wrote : | # |
The attempt to merge lp:~themue/juju-core/035-bootstrap-autosync into lp:juju-core failed. Below is the output from the failed tests.
worker/
state/api/
/usr/lib/
/home/
state/annotator
/usr/lib/
/home/
agent/tools/
/usr/lib/
/home/
state/annotator
/usr/lib/
/home/
agent/agent.
/usr/lib/
/home/
agent/tools/
/usr/lib/
/home/
state/watcher/
/usr/lib/
/home/
cmd/cmd.go:16:2: cannot find package "launchpad.
/usr/lib/
/home/
environs/
/usr/lib/
/home/
environs/
/usr/lib/
/home/
environs/
/usr/lib/
/home/
environs/
/usr/lib/
/home/
environs/
/usr/lib/
/home/
container/
/usr/lib/
/home/
container/
/us...
Go Bot (go-bot) wrote : | # |
The attempt to merge lp:~themue/juju-core/035-bootstrap-autosync into lp:juju-core failed. Below is the output from the failed tests.
worker/
ok launchpad.
ok launchpad.
-------
FAIL: bzr_test.go:59: BzrSuite.TestCommit
bzr_test.go:66:
c.Assert(err, IsNil)
... value *errors.errorString = &errors.
-------
FAIL: bzr_test.go:77: BzrSuite.TestPush
bzr_test.go:92:
c.Assert(err, IsNil)
... value *errors.errorString = &errors.
OOPS: 6 passed, 2 FAILED
--- FAIL: Test (5.11 seconds)
FAIL
FAIL launchpad.
ok launchpad.
ok launchpad.
? launchpad.
ok launchpad.
ok launchpad.
? launchpad.
? launchpad.
? launchpad.
listing available toolsfound 6 toolsfound 6 recent tools (version 1.10.0)listing target bucketfound 0 tools in target; 6 tools to be copiedcopying 1.10.0-
Go Bot (go-bot) wrote : | # |
The attempt to merge lp:~themue/juju-core/035-bootstrap-autosync into lp:juju-core failed. Below is the output from the failed tests.
worker/
ok launchpad.
ok launchpad.
ok launchpad.
ok launchpad.
ok launchpad.
? launchpad.
ok launchpad.
ok launchpad.
? launchpad.
? launchpad.
? launchpad.
listing available toolsfound 6 toolsfound 6 recent tools (version 1.10.0)listing target bucketfound 0 tools in target; 6 tools to be copiedcopying 1.10.0-
Frank Mueller (themue) wrote : | # |
Review handled, but new problems with old tests.
https:/
File cmd/juju/
https:/
cmd/juju/
location on the file system as source of the tools")
On 2013/07/29 10:35:32, dimitern wrote:
> How about:
> f.StringVar(
source")
> ?
Done.
https:/
cmd/juju/
On 2013/07/29 10:35:32, dimitern wrote:
> This comment is redundant, I think.
Done.
https:/
cmd/juju/
availibilty of tools. If it doesn't find
On 2013/07/29 10:35:32, dimitern wrote:
> // ensureToolsAvai
tools are
> found, it will automatically synchronize them.
> ?
Done.
https:/
cmd/juju/
syncing on screen.
On 2013/07/29 10:35:32, dimitern wrote:
> // Capture possible output while syncing and log it.
> ?
Done, but a bit changed. The log is captured and printed on the screen.
https:/
cmd/juju/
On 2013/07/29 10:35:32, dimitern wrote:
> Blank line before this one please.
Done.
https:/
cmd/juju/
On 2013/07/29 10:35:32, dimitern wrote:
> // Synchronization done, retry.
> ?
Done.
https:/
File cmd/juju/
https:/
cmd/juju/
remove all
On 2013/07/29 10:35:32, dimitern wrote:
> Can you please extract this block into a suite method, called e.g.
purgeTools
> and call it here and in the test below?
Done.
https:/
cmd/juju/
are the 1.0.0 tools.
On 2013/07/29 10:35:32, dimitern wrote:
> This block as well? s.ensureTools(c, v100all) here and below?
Done.
Frank Mueller (themue) wrote : | # |
Please take a look.
Frank Mueller (themue) wrote : | # |
Please take a look.
Frank Mueller (themue) : | # |
Reviewers: mp+177119_ code.launchpad. net,
Message:
Please take a look.
Description:
cmd/bootstrap: integrate syncing
After the CL moving the synchronization logic into an
own package this CL now checks if tools can be found
during bootstrap. If this is not possible it will use
the synchronization logic and then retries the
bootstrapping.
https:/ /code.launchpad .net/~themue/ juju-core/ 035-bootstrap- autosync/ +merge/ 177119
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/11910043/
Affected files: bootstrap. go bootstrap_ test.go
A [revision details]
M cmd/juju/
M cmd/juju/