Code review comment for lp:~johnweldon4/juju-core/action

Revision history for this message
John Weldon (johnweldon4) wrote :

Okay... addressed all
Running the tests and then I'll lbox propose

https://codereview.appspot.com/98260043/diff/100001/state/action.go
File state/action.go (right):

https://codereview.appspot.com/98260043/diff/100001/state/action.go#newcode6
state/action.go:6: Id string `bson:"_id"`
On 2014/05/22 08:02:13, fwereade wrote:
> blank lines before comments please

Done.

https://codereview.appspot.com/98260043/diff/100001/state/action.go#newcode9
state/action.go:9: // action to actually perform
On 2014/05/22 08:02:13, fwereade wrote:
> Name identifies the action; it should match an action defined by the
unit's
> charm.

> ?

Done.

https://codereview.appspot.com/98260043/diff/100001/state/action.go#newcode12
state/action.go:12: // when this action is being performed.
On 2014/05/22 08:02:13, fwereade wrote:
> Payload holds the action's parameters, if any; it should validate
against the
> schema defined by the named action in the unit's charm.

> ?

Done.

https://codereview.appspot.com/98260043/diff/100001/state/unit.go
File state/unit.go (right):

https://codereview.appspot.com/98260043/diff/100001/state/unit.go#newcode1344
state/unit.go:1344: return newActionID, err
On 2014/05/22 08:02:13, fwereade wrote:
> ah, dammit. We shouldn't really return newActionID if err != nil.
`switch err :=
> ...; err {`?

Done.

https://codereview.appspot.com/98260043/diff/100001/state/unit_test.go
File state/unit_test.go (right):

https://codereview.appspot.com/98260043/diff/100001/state/unit_test.go#newcode1295
state/unit_test.go:1295: func (s *UnitSuite) TestAddAction(c *gc.C) {
On 2014/05/22 08:02:14, fwereade wrote:
> hey, can we move these to a new suite in action_test.go? unit_test is
already
> too damn big IMO.

Done.

https://codereview.appspot.com/98260043/diff/100001/state/unit_test.go#newcode1311
state/unit_test.go:1311: c.Assert(action.Id(), gc.Matches,
"^u#"+s.unit.Name()+"#\\d+")
On 2014/05/22 08:02:14, fwereade wrote:
> how about an assertSaneActionId? You can use it below where you're
currently
> discarding the new ids.

Done. but only applies to the places where we don't expect an error...

https://codereview.appspot.com/98260043/diff/100001/state/unit_test.go#newcode1318
state/unit_test.go:1318: func (s *UnitSuite)
TestAddActionFailsOnDeadUnit(c *gc.C) {
On 2014/05/22 08:02:13, fwereade wrote:
> TestAddActionLifecycle?

Done.

https://codereview.appspot.com/98260043/diff/100001/state/unit_test.go#newcode1357
state/unit_test.go:1357: func (s *UnitSuite)
TestAddActionFailsOnExcessiveContention(c *gc.C) {
On 2014/05/22 08:02:14, fwereade wrote:
> I'd just drop this.

Done.

https://codereview.appspot.com/98260043/

« Back to merge proposal