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

Issue 7142043: state: rationalize destruction APIs

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

Description

state: rationalize destruction APIs EnsureDying has become Destroy, to match Service and Relation; State.RemoveMachine has become Machine.Remove, as has Service.RemoveUnit become Unit.Remove. This change is entirely mechanical. https://code.launchpad.net/~fwereade/juju-core/state-death-api/+merge/143555 Requires: https://code.launchpad.net/~fwereade/juju-core/state-service-api/+merge/143394 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: rationalize destruction APIs #

Total comments: 8

Patch Set 3 : state: rationalize destruction APIs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -237 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M cmd/jujud/unit_test.go View 1 2 1 chunk +1 line, -6 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M juju/conn.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/assign_test.go View 1 8 chunks +9 lines, -11 lines 0 comments Download
M state/life.go View 1 chunk +1 line, -1 line 0 comments Download
M state/life_test.go View 5 chunks +5 lines, -5 lines 0 comments Download
M state/machine.go View 1 2 2 chunks +18 lines, -3 lines 0 comments Download
M state/machine_test.go View 18 chunks +35 lines, -23 lines 0 comments Download
M state/relation.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M state/relation_test.go View 1 5 chunks +5 lines, -5 lines 0 comments Download
M state/service.go View 1 1 chunk +0 lines, -30 lines 0 comments Download
M state/service_test.go View 1 13 chunks +14 lines, -39 lines 0 comments Download
M state/state.go View 1 1 chunk +0 lines, -27 lines 0 comments Download
M state/state_test.go View 1 2 8 chunks +11 lines, -32 lines 0 comments Download
M state/tools_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/unit.go View 1 2 chunks +34 lines, -2 lines 0 comments Download
M state/unit_test.go View 1 2 14 chunks +36 lines, -18 lines 0 comments Download
M worker/deployer/deployer.go View 1 chunk +1 line, -5 lines 0 comments Download
M worker/deployer/deployer_test.go View 4 chunks +4 lines, -4 lines 0 comments Download
M worker/firewaller/firewaller_test.go View 1 2 6 chunks +7 lines, -7 lines 0 comments Download
M worker/machiner/machiner_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/filter.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/filter_test.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/modes.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/uniter.go View 1 chunk +1 line, -1 line 0 comments Download
M worker/uniter/uniter_test.go View 3 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
12 years, 1 month ago (2013-01-16 17:36:04 UTC) #1
fwereade
Please take a look.
12 years, 1 month ago (2013-01-18 07:57:39 UTC) #2
dimitern
LGTM overall, just some suggestions. https://codereview.appspot.com/7142043/diff/3001/state/relation.go File state/relation.go (right): https://codereview.appspot.com/7142043/diff/3001/state/relation.go#newcode156 state/relation.go:156: // removeOps returns the ...
12 years, 1 month ago (2013-01-22 14:14:55 UTC) #3
rog
LGTM. very nice.
12 years, 1 month ago (2013-01-25 16:49:57 UTC) #4
fwereade
12 years, 1 month ago (2013-01-25 17:49:16 UTC) #5
*** Submitted:

state: rationalize destruction APIs

EnsureDying has become Destroy, to match Service and Relation;
State.RemoveMachine has become Machine.Remove, as has Service.RemoveUnit
become Unit.Remove. This change is entirely mechanical.

R=dimitern, rog
CC=
https://codereview.appspot.com/7142043

https://codereview.appspot.com/7142043/diff/3001/state/relation_test.go
File state/relation_test.go (right):

https://codereview.appspot.com/7142043/diff/3001/state/relation_test.go#newco...
state/relation_test.go:821: err = pru.EnterScope(nil) // to create the
subordinate
On 2013/01/22 14:14:55, dimitern wrote:
> It seems we have a bunch of these Enter/LeaveScope pairs working on a
principal
> unit (P). Maybe it's a good candidate for a P.RefreshScope or
> P.UpdateSubordinates or something like that. Possibly also a separate helper
> func...(P). That way the explanation why this happens can be in a single
> location and the whole operation will be obvious. What do you think?

I *think* this is the only place we do an Enter/Leave -- it's very specific to
this situation, which serves tests that expects both that the subordinate exists
and that scope is empty to begin with.

So, in this case, -1; in general I'm quite keen on the idea of an improved
vocabulary for state testing, but I'm holding off on it because: if I do it
piecemeal, I won't get it finished anytime soon -- I *still* haven't finally
killed AUST; and if I do it all at once nobody will be able to bear reviewing it
;).

https://codereview.appspot.com/7142043/diff/3001/state/unit_test.go
File state/unit_test.go (right):

https://codereview.appspot.com/7142043/diff/3001/state/unit_test.go#newcode177
state/unit_test.go:177: _, err := s.State.AddService("logging", subCharm)
On 2013/01/22 14:14:55, dimitern wrote:
> See below

Done.

https://codereview.appspot.com/7142043/diff/3001/state/unit_test.go#newcode414
state/unit_test.go:414: for i := 0; i < 2; i++ {
On 2013/01/22 14:14:55, dimitern wrote:
> See below

Done.
Sign in to reply to this message.

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