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

Issue 8140044: state: subordinate constraints cannot be got/set

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

Description

state: subordinate constraints cannot be got/set This was implemented by denormalizing charm subordinacy into the service's new Subordinate field; since I was doing this, I also did Series, to allow that to also be sanity-checked in SetCharm. As a bonus, addUnitOps no longer needs to do a roundtrip to get the necessary charm information. I also moved the various charm-related test helpers into export_test because it seemed neater that way. https://code.launchpad.net/~fwereade/juju-core/state-subordinate-constraints/+merge/156138 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : state: subordinate constraints cannot be got/set #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -48 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/charm_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/conn_test.go View 1 chunk +7 lines, -3 lines 0 comments Download
M state/export_test.go View 2 chunks +33 lines, -0 lines 0 comments Download
M state/megawatcher_internal_test.go View 1 3 chunks +2 lines, -30 lines 0 comments Download
M state/service.go View 1 7 chunks +23 lines, -9 lines 0 comments Download
M state/service_test.go View 1 4 chunks +23 lines, -2 lines 0 comments Download
M state/state.go View 1 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 5
fwereade
Please take a look.
11 years, 1 month ago (2013-03-29 12:16:04 UTC) #1
dimitern
Nice changes, I like especially the sorting out AddTestingCharm stuff :) LGTM. https://codereview.appspot.com/8140044/diff/1/state/service_test.go File state/service_test.go ...
11 years, 1 month ago (2013-03-29 15:09:49 UTC) #2
fwereade
https://codereview.appspot.com/8140044/diff/1/state/service.go File state/service.go (right): https://codereview.appspot.com/8140044/diff/1/state/service.go#newcode453 state/service.go:453: // TODO(fwereade) check that the service's endpoint in each ...
11 years, 1 month ago (2013-03-30 05:04:53 UTC) #3
jameinel
LGTM https://codereview.appspot.com/8140044/diff/1/state/conn_test.go File state/conn_test.go (left): https://codereview.appspot.com/8140044/diff/1/state/conn_test.go#oldcode62 state/conn_test.go:62: } If all callers are passing "series" for ...
11 years, 1 month ago (2013-04-01 07:16:42 UTC) #4
fwereade
11 years, 1 month ago (2013-04-01 08:52:14 UTC) #5
*** Submitted:

state: subordinate constraints cannot be got/set

This was implemented by denormalizing charm subordinacy into the service's
new Subordinate field; since I was doing this, I also did Series, to allow
that to also be sanity-checked in SetCharm. As a bonus, addUnitOps no
longer needs to do a roundtrip to get the necessary charm information.

I also moved the various charm-related test helpers into export_test because
it seemed neater that way.

R=dimitern, jameinel
CC=
https://codereview.appspot.com/8140044

https://codereview.appspot.com/8140044/diff/1/state/conn_test.go
File state/conn_test.go (left):

https://codereview.appspot.com/8140044/diff/1/state/conn_test.go#oldcode62
state/conn_test.go:62: }
On 2013/04/01 07:16:42, jameinel wrote:
> If all callers are passing "series" for series, is there a reason to pass it
in?
> Are there plans to pass something else? (Our testing repo doesn't have others,
> but I think you can copy it to another name.)

Not quite all callers: service_test.go needs a custom series. The structure of
the local repo isn't relevant here: the series for which a charm is rated is
purely within its URL.

https://codereview.appspot.com/8140044/diff/1/state/service.go
File state/service.go (right):

https://codereview.appspot.com/8140044/diff/1/state/service.go#newcode427
state/service.go:427: return fmt.Errorf("cannot change a service's subordinacy")
On 2013/04/01 07:16:42, jameinel wrote:
> So s.doc.Subordinate is "Am I a subordinate" not "what is my Subordinate"
right?

That is correct. Principal/subordinate services (and units) are each one/many.

https://codereview.appspot.com/8140044/diff/1/state/service_test.go
File state/service_test.go (right):

https://codereview.appspot.com/8140044/diff/1/state/service_test.go#newcode63
state/service_test.go:63: othermysql := s.AddSeriesCharm(c, "mysql",
"otherseries", 123)
jam, here's the call to AddSeriesCharm.
Sign in to reply to this message.

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