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

Issue 5832045: remove hook package; hooks are not really important at this stage

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by fwereade
Modified:
12 years, 1 month ago
Reviewers:
mp+97676, niemeyer
Visibility:
Public.

Description

remove hook package; hooks are not really important at this stage The new cmd/jujuc/server package contains (so far) the Context type; it defines the server-side state with which proxied tool invocations can interact. It is also responsible for running hooks, but that's because it is the source of truth for much of the hook's desired environment; I'm not *sure* RunHook will always be attached to Context, but I think that's something to decide once we have a client. Context shares some features with the existing hook context classes in Python, but should not be confused with them. A Context holds all the data that is needed to execute any jujuc tool [0], plus an Id which is not yet used directly. It is not concerned with those variables that are purely related to the actual execution of the hook (ie socketPath and charmDir); therefore, those are passed separately to RunHook. [0] Not strictly true, yet; we'll add data when we handle relation contexts,but that's all in the future for now :). https://code.launchpad.net/~fwereade/juju/go-stateless-hook-context/+merge/97676 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3

Patch Set 2 : Utterly minimal hook.Context implementation #

Total comments: 13

Patch Set 3 : remove hook.ExecInfo; add hook.Context #

Patch Set 4 : remove hook package; hooks are not really important at this stage #

Total comments: 8

Patch Set 5 : remove hook package; hooks are not really important at this stage #

Total comments: 2

Patch Set 6 : remove hook package; hooks are not really important at this stage #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -158 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A cmd/jujuc/server/context.go View 1 2 3 4 1 chunk +85 lines, -0 lines 0 comments Download
A cmd/jujuc/server/context_test.go View 1 2 3 4 5 1 chunk +159 lines, -0 lines 0 comments Download
M hook/exec.go View 1 1 chunk +0 lines, -55 lines 0 comments Download
D hook/exec_test.go View 1 1 chunk +0 lines, -103 lines 0 comments Download

Messages

Total messages: 16
fwereade
Please take a look.
12 years, 1 month ago (2012-03-15 15:16:15 UTC) #1
rog
https://codereview.appspot.com/5832045/diff/1/hook/context.go File hook/context.go (right): https://codereview.appspot.com/5832045/diff/1/hook/context.go#newcode19 hook/context.go:19: func NewLocalContext(state *state.State, unitName string) *Context { are these ...
12 years, 1 month ago (2012-03-15 15:29:11 UTC) #2
niemeyer
We've covered that one online. Marked the branch as WIP just so it gets back ...
12 years, 1 month ago (2012-03-15 19:15:37 UTC) #3
fwereade
Please take a look.
12 years, 1 month ago (2012-03-16 11:49:54 UTC) #4
rog
much happier with this, thanks! https://codereview.appspot.com/5832045/diff/4001/hook/context.go File hook/context.go (right): https://codereview.appspot.com/5832045/diff/4001/hook/context.go#newcode17 hook/context.go:17: ContextId string as discussed ...
12 years, 1 month ago (2012-03-16 12:25:52 UTC) #5
niemeyer
For the record, we've debated live today about some ideas for reorganizing this.
12 years, 1 month ago (2012-03-16 23:26:31 UTC) #6
fwereade
Please take a look. https://codereview.appspot.com/5832045/diff/4001/hook/context.go File hook/context.go (right): https://codereview.appspot.com/5832045/diff/4001/hook/context.go#newcode17 hook/context.go:17: ContextId string On 2012/03/16 12:25:52, ...
12 years, 1 month ago (2012-03-17 00:12:15 UTC) #7
fwereade
Please take a look.
12 years, 1 month ago (2012-03-19 11:48:22 UTC) #8
niemeyer
LGTM For the record: <niemeyer> fwereade_: Sure.. I was actually going to ask you about ...
12 years, 1 month ago (2012-03-20 13:55:09 UTC) #9
niemeyer
LGTM still, just a few extra comments I had missed: https://codereview.appspot.com/5832045/diff/9001/cmd/jujuc/server/context.go File cmd/jujuc/server/context.go (right): https://codereview.appspot.com/5832045/diff/9001/cmd/jujuc/server/context.go#newcode36 ...
12 years, 1 month ago (2012-03-20 14:16:42 UTC) #10
fwereade
Please take a look. https://codereview.appspot.com/5832045/diff/9001/cmd/jujuc/server/context.go File cmd/jujuc/server/context.go (right): https://codereview.appspot.com/5832045/diff/9001/cmd/jujuc/server/context.go#newcode36 cmd/jujuc/server/context.go:36: full := fmt.Sprintf("Context<%s>: %s", strings.Join(s, ...
12 years, 1 month ago (2012-03-20 15:05:36 UTC) #11
fwereade
12 years, 1 month ago (2012-03-20 15:10:20 UTC) #12
niemeyer
LGTM https://codereview.appspot.com/5832045/diff/4015/cmd/jujuc/server/context_test.go File cmd/jujuc/server/context_test.go (right): https://codereview.appspot.com/5832045/diff/4015/cmd/jujuc/server/context_test.go#newcode96 cmd/jujuc/server/context_test.go:96: err = hookTemplate.Execute(hook, hookArgs{outPath, code}) Not sure if ...
12 years, 1 month ago (2012-03-20 19:10:18 UTC) #13
fwereade
https://codereview.appspot.com/5832045/diff/4015/cmd/jujuc/server/context_test.go File cmd/jujuc/server/context_test.go (right): https://codereview.appspot.com/5832045/diff/4015/cmd/jujuc/server/context_test.go#newcode96 cmd/jujuc/server/context_test.go:96: err = hookTemplate.Execute(hook, hookArgs{outPath, code}) On 2012/03/20 19:10:18, niemeyer ...
12 years, 1 month ago (2012-03-20 23:13:27 UTC) #14
fwereade
*** Submitted: remove hook package; hooks are not really important at this stage The new ...
12 years, 1 month ago (2012-03-20 23:57:23 UTC) #15
niemeyer
12 years, 1 month ago (2012-03-21 00:05:11 UTC) #16
On 2012/03/20 23:57:23, fwereade wrote:
> *** Submitted:
> 
> remove hook package; hooks are not really important at this stage

The subject was still incorrect.
Sign in to reply to this message.

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