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

Issue 6301066: ChildrenWatcher now treats missing nodes as having no children

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

Description

ChildrenWatcher now treats missing nodes as having no children This is consistent with ContentWatcher (which returns {false, ""} content changes on missing nodes) and enables simpler code when adding relations (by deferring role node creation until unit add time in all cases, rather than just for container-scoped relations). https://code.launchpad.net/~fwereade/juju-core/tweak-children-watcher/+merge/109630 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 3 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 4 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 5 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 6 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 7 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 8 : ChildrenWatcher now treats missing nodes as having no children #

Patch Set 9 : ChildrenWatcher now treats missing nodes as having no children #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -31 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/watcher/watcher.go View 1 7 chunks +33 lines, -23 lines 0 comments Download
M state/watcher/watcher_test.go View 2 chunks +17 lines, -8 lines 0 comments Download

Messages

Total messages: 3
fwereade
Please take a look.
11 years, 10 months ago (2012-06-11 13:15:18 UTC) #1
niemeyer
LGTM, with a couple of suggestions: https://codereview.appspot.com/6301066/diff/1/state/watcher/watcher.go File state/watcher/watcher.go (right): https://codereview.appspot.com/6301066/diff/1/state/watcher/watcher.go#newcode24 state/watcher/watcher.go:24: started bool Are ...
11 years, 10 months ago (2012-06-13 11:22:54 UTC) #2
fwereade
11 years, 10 months ago (2012-06-14 14:26:04 UTC) #3
*** Submitted:

ChildrenWatcher now treats missing nodes as having no children

This is consistent with ContentWatcher (which returns {false, ""} content
changes on missing nodes) and enables simpler code when adding relations (by
deferring role node creation until unit add time in all cases, rather than
just for container-scoped relations).

R=niemeyer
CC=
https://codereview.appspot.com/6301066

https://codereview.appspot.com/6301066/diff/1/state/watcher/watcher.go
File state/watcher/watcher.go (right):

https://codereview.appspot.com/6301066/diff/1/state/watcher/watcher.go#newcode24
state/watcher/watcher.go:24: started    bool
On 2012/06/13 11:22:54, niemeyer wrote:
> Are you just looking to invert the boolean meaning here? If so, can we
preserve
> the context of the name with something like "emittedValue"?  "started" is a
> weaker term, and potentially confusing given that we have a Stop method, that
is
> not entirely related to the relevancy of this field.

SGTM, thanks.

https://codereview.appspot.com/6301066/diff/1/state/watcher/watcher.go#newcod...
state/watcher/watcher.go:241: return
On 2012/06/13 11:22:54, niemeyer wrote:
> Would you mind to invert the logic so that the reason why we're returning here
> is more obvious?
> 
> if err != nil {
>         return
> }
> break
> 
> Then drop the if err == nil at the top of the loop.

Done.
Sign in to reply to this message.

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