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

Issue 6445058: reworked ClientContext to HookContext

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

Description

reworked ClientContext to HookContext HookContext now offers facilities sufficient to implement relation-get, relation-set, relation-ids, and relation-list. Expect followups implementing those shortly; for now, sigh, and observe the annoyingly large amount of test changes that support what STM to be a worthwhile simplification of the hook context as a whole. https://code.launchpad.net/~fwereade/juju-core/jujuc-server-unit-context/+merge/117253 Requires: https://code.launchpad.net/~fwereade/juju-core/jujuc-server-relation-context/+merge/117202 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : reworked ClientContext to UnitContext #

Total comments: 15

Patch Set 3 : reworked ClientContext to HookContext #

Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -220 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujuc/server/config-get.go View 1 2 2 chunks +4 lines, -15 lines 0 comments Download
M cmd/jujuc/server/config-get_test.go View 1 2 5 chunks +10 lines, -10 lines 0 comments Download
M cmd/jujuc/server/context.go View 1 2 5 chunks +69 lines, -39 lines 0 comments Download
M cmd/jujuc/server/context_test.go View 1 2 5 chunks +150 lines, -55 lines 0 comments Download
M cmd/jujuc/server/juju-log.go View 1 2 chunks +9 lines, -14 lines 0 comments Download
M cmd/jujuc/server/juju-log_test.go View 1 3 chunks +9 lines, -7 lines 0 comments Download
M cmd/jujuc/server/ports.go View 1 5 chunks +15 lines, -22 lines 0 comments Download
M cmd/jujuc/server/ports_test.go View 1 5 chunks +8 lines, -10 lines 0 comments Download
M cmd/jujuc/server/unit-get.go View 1 2 2 chunks +5 lines, -14 lines 0 comments Download
M cmd/jujuc/server/unit-get_test.go View 1 2 5 chunks +12 lines, -11 lines 0 comments Download
M cmd/jujuc/server/util_test.go View 1 2 2 chunks +47 lines, -23 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
11 years, 9 months ago (2012-07-30 12:45:45 UTC) #1
rog
This is looking lovely. As discussed online, I reckon HookContext reads better than UnitContext. A ...
11 years, 9 months ago (2012-07-30 13:20:08 UTC) #2
fwereade
Please take a look. https://codereview.appspot.com/6445058/diff/1/cmd/jujuc/server/context.go File cmd/jujuc/server/context.go (right): https://codereview.appspot.com/6445058/diff/1/cmd/jujuc/server/context.go#newcode21 cmd/jujuc/server/context.go:21: // tools that need this ...
11 years, 9 months ago (2012-07-30 14:31:24 UTC) #3
niemeyer
Outstanding. LGTM. https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context.go File cmd/jujuc/server/context.go (right): https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context.go#newcode21 cmd/jujuc/server/context.go:21: // tools that need this specific HookContext). ...
11 years, 9 months ago (2012-07-31 20:29:21 UTC) #4
fwereade
11 years, 9 months ago (2012-07-31 21:54:41 UTC) #5
*** Submitted:

reworked ClientContext to HookContext

HookContext now offers facilities sufficient to implement relation-get,
relation-set, relation-ids, and relation-list. Expect followups
implementing those shortly; for now, sigh, and observe the annoyingly
large amount of test changes that support what STM to be a worthwhile
simplification of the hook context as a whole.

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

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context.go
File cmd/jujuc/server/context.go (right):

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context.go#...
cmd/jujuc/server/context.go:103: log.Printf("jujuc/server: failed to flush
context for relation %d: %v", id, e)
On 2012/07/31 20:29:21, niemeyer wrote:
> s,jujuc/server: ,,; we're getting rid of those prefixes
> 
> Also, would be good to make the message slightly more oriented towards a
> non-developer.

Done.

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context_tes...
File cmd/jujuc/server/context_test.go (right):

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context_tes...
cmd/jujuc/server/context_test.go:102: var runHookTests = []struct {
On 2012/07/31 20:29:21, niemeyer wrote:
> I suggest "summary string" here, and see below..

Done.

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context_tes...
cmd/jujuc/server/context_test.go:110: // Missing hook is not an error.
On 2012/07/31 20:29:21, niemeyer wrote:
> We might move this onto the test itself, and make them more clear:
> 
> {
>     summary: "Missing hook is not an error",
>     relid: -1,
> }, {
>     summary: "Report failure to execute hook",
>     relid:   -1,
>     perms:   0600,
>     err:     `exec: .*something-happened": permission denied`,
> }, {
> ...
> }

Very nice. Done.

https://codereview.appspot.com/6445058/diff/4001/cmd/jujuc/server/context_tes...
cmd/jujuc/server/context_test.go:137: c.Logf("test %d", i)
On 2012/07/31 20:29:21, niemeyer wrote:
> This can then show a summary, which is generally quite handy to see what is
> failing:
> 
> c.Logf("test %d: %s", i, t.summary)

Done.
Sign in to reply to this message.

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