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.
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 test.go: 1295: func (s *UnitSuite) TestAddAction(c *gc.C) {
state/unit_
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 test.go: 1311: c.Assert( action. Id(), gc.Matches, unit.Name( )+"#\\d+ ")
state/unit_
"^u#"+s.
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 test.go: 1318: func (s *UnitSuite) ilsOnDeadUnit( c *gc.C) { fecycle?
state/unit_
TestAddActionFa
On 2014/05/22 08:02:13, fwereade wrote:
> TestAddActionLi
Done.
https:/ /codereview. appspot. com/98260043/ diff/100001/ state/unit_ test.go# newcode1357 test.go: 1357: func (s *UnitSuite) ilsOnExcessiveC ontention( c *gc.C) {
state/unit_
TestAddActionFa
On 2014/05/22 08:02:14, fwereade wrote:
> I'd just drop this.
Done.
https:/ /codereview. appspot. com/98260043/