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

Issue 6163044: Basic config-get command

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by fwereade
Modified:
11 years, 11 months ago
Reviewers:
mp+104370
Visibility:
Public.

Description

Basic config-get command Note that the command's output is wrong: it's enough to demonstrate that the right data is being found and used, but that's all. Expect output formatting more like python in a followup branch. https://code.launchpad.net/~fwereade/juju/go-config-get-command-start/+merge/104370 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 27

Patch Set 2 : Basic config-get command #

Total comments: 1

Patch Set 3 : Basic config-get command #

Patch Set 4 : Basic config-get command #

Total comments: 4

Patch Set 5 : Basic config-get command #

Total comments: 15

Patch Set 6 : Basic config-get command #

Patch Set 7 : Basic config-get command #

Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -51 lines) Patch
[revision details] View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
cmd/cmd_test.go View 1 2 3 4 5 6 3 chunks +8 lines, -8 lines 0 comments Download
cmd/jujuc/server/config-get.go View 1 2 3 4 5 1 chunk +67 lines, -0 lines 0 comments Download
cmd/jujuc/server/config-get_test.go View 1 2 3 4 5 6 1 chunk +118 lines, -0 lines 0 comments Download
cmd/jujuc/server/context.go View 1 2 3 4 5 2 chunks +22 lines, -14 lines 0 comments Download
cmd/jujuc/server/context_test.go View 1 2 3 4 5 4 chunks +27 lines, -9 lines 0 comments Download
cmd/jujuc/server/juju-log.go View 1 2 3 4 5 2 chunks +10 lines, -9 lines 0 comments Download
cmd/jujuc/server/juju-log_test.go View 1 2 3 4 5 2 chunks +6 lines, -6 lines 0 comments Download
cmd/logging_test.go View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
cmd/supercommand_test.go View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
cmd/util_test.go View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12
fwereade
Please take a look.
11 years, 11 months ago (2012-05-02 11:43:59 UTC) #1
rog
looking good; just a few naming and wording suggestions. https://codereview.appspot.com/6163044/diff/1/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6163044/diff/1/cmd/jujuc/server/config-get.go#newcode9 cmd/jujuc/server/config-get.go:9: ...
11 years, 11 months ago (2012-05-02 13:29:54 UTC) #2
fwereade
Please take a look. https://codereview.appspot.com/6163044/diff/1/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6163044/diff/1/cmd/jujuc/server/config-get.go#newcode9 cmd/jujuc/server/config-get.go:9: // ConfigGetCommand implements the `config-get` ...
11 years, 11 months ago (2012-05-02 15:52:32 UTC) #3
fwereade
Please take a look.
11 years, 11 months ago (2012-05-03 09:23:35 UTC) #4
rog
LGTM bar minors below. https://codereview.appspot.com/6163044/diff/7001/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6163044/diff/7001/cmd/jujuc/server/config-get.go#newcode65 cmd/jujuc/server/config-get.go:65: fmt.Fprintln(ctx.Stdout, value) oh yeah, i ...
11 years, 11 months ago (2012-05-03 09:39:48 UTC) #5
fwereade
Please take a look. https://codereview.appspot.com/6163044/diff/12001/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6163044/diff/12001/cmd/jujuc/server/config-get.go#newcode25 cmd/jujuc/server/config-get.go:25: var purpose = "print service ...
11 years, 11 months ago (2012-05-03 10:14:30 UTC) #6
niemeyer
https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get.go#newcode11 cmd/jujuc/server/config-get.go:11: ctx *Context This is provided by the user when ...
11 years, 11 months ago (2012-05-03 18:00:29 UTC) #7
niemeyer
LGTM, assuming we clarify just a bit the relationship as suggested below. https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go ...
11 years, 11 months ago (2012-05-03 19:04:44 UTC) #8
fwereade
I'm not quite sure where you're going with the str() advice, so I'll re-propose without ...
11 years, 11 months ago (2012-05-03 22:21:30 UTC) #9
fwereade
Please take a look.
11 years, 11 months ago (2012-05-03 22:23:13 UTC) #10
niemeyer
LGTM, thanks. It'd be nice to rename the test function. This is looking great either ...
11 years, 11 months ago (2012-05-04 00:00:16 UTC) #11
fwereade
11 years, 11 months ago (2012-05-04 07:56:17 UTC) #12
*** Submitted:

Basic config-get command

Note that the command's output is wrong: it's enough to demonstrate that the
right data is being found and used, but that's all. Expect output formatting
more like python in a followup branch.

R=rog, niemeyer
CC=
https://codereview.appspot.com/6163044

https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get.go
File cmd/jujuc/server/config-get.go (right):

https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get...
cmd/jujuc/server/config-get.go:11: ctx *Context
On 2012/05/04 00:00:16, niemeyer wrote:
> On 2012/05/03 22:21:30, fwereade wrote:
> > I'm not 100% sold on the Client bit of ClientContext, but this is definitely
> the
> > right direction. Thanks; done.
> 
> This is really the context from the client that is calling this "server"
> package, which is why Client seems to make sense to me.

Holding up cmd.Context and server.Context together, though, the cmd.Context is
actually holding data relevant to the client; while the server.Context was
(theoretically) chosen by the client, but contains data that's IMO very specific
to the server (and all very much related to state; hence maybe StateContext).

No reason for this to hold up progress, though, we can figure it out at our
leisure.

https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get...
File cmd/jujuc/server/config-get_test.go (right):

https://codereview.appspot.com/6163044/diff/11003/cmd/jujuc/server/config-get...
cmd/jujuc/server/config-get_test.go:33: return w.(*bytes.Buffer).String()
On 2012/05/04 00:00:16, niemeyer wrote:
> On 2012/05/03 22:21:30, fwereade wrote:
> > I don't follow this. A cmd.Context contains an io.Writer for each of stdout
> and
> > stderr, because that's all that "real" code expects to do with them. In
tests,
> 
> Sorry, I've seen io.Writer and thought about io.Reader. Obviously reading from
> an io.Writer won't work.
> 
> Your approach looks good. Can we please just label this function as
bufferString
> to be more clear what is going on?

Done. (fixed similarly in cmd_test, which uses the same pattern)
Sign in to reply to this message.

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