Merge lp:~jameinel/juju-core/api-named-resources into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2753 |
Proposed branch: | lp:~jameinel/juju-core/api-named-resources |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
241 lines (+116/-13) 6 files modified
state/apiserver/admin.go (+2/-1) state/apiserver/common/resource.go (+21/-0) state/apiserver/common/resource_test.go (+50/-0) state/apiserver/pinger_test.go (+19/-0) state/apiserver/root.go (+8/-11) state/apiserver/root_test.go (+16/-1) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/api-named-resources |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+220208@code.launchpad.net |
Commit message
state/apiserver
Two small changes here.
1) Change common.Resources to allow you to RegisterNamed rather than
only allowing you to register and get back the Id. This was necessary
for the second step, but generally allows us to declare Resources
that Facades can know about that aren't reported to clients.
2) Change the pingTimeout object from being an attribute of srvRoot into
being just another resource like the Watchers at a specific resource
name.
While working on the changes for pingTimeout, I noticed that no tests
actually failed if I started returning nullTimeout. So I added a test
that ensures calling Ping() actually does delay the connection from
being closed. (We only had a test that if you never called Ping in time,
it would die, but not that Ping can delay that death.)
This is a step towards making all of the Facades follow a common
pattern, as this allows Pinger to also just take Resources rather than
needing to know about details of the srvRoot object.
Description of the change
state/apiserver
Two small changes here.
1) Change common.Resources to allow you to RegisterNamed rather than
only allowing you to register and get back the Id. This was necessary
for the second step, but generally allows us to declare Resources
that Facades can know about that aren't reported to clients.
2) Change the pingTimeout object from being an attribute of srvRoot into
being just another resource like the Watchers at a specific resource
name.
While working on the changes for pingTimeout, I noticed that no tests
actually failed if I started returning nullTimeout. So I added a test
that ensures calling Ping() actually does delay the connection from
being closed. (We only had a test that if you never called Ping in time,
it would die, but not that Ping can delay that death.)
This is a step towards making all of the Facades follow a common
pattern, as this allows Pinger to also just take Resources rather than
needing to know about details of the srvRoot object.
Reviewers: mp+220208_ code.launchpad. net,
Message:
Please take a look.
Description: /common: Resources. RegisterNamed
state/apiserver
Two small changes here.
1) Change common.Resources to allow you to RegisterNamed rather than
only allowing you to register and get back the Id. This was necessary
for the second step, but generally allows us to declare Resources
that Facades can know about that aren't reported to clients.
2) Change the pingTimeout object from being an attribute of srvRoot into
being just another resource like the Watchers at a specific resource
name.
While working on the changes for pingTimeout, I noticed that no tests
actually failed if I started returning nullTimeout. So I added a test
that ensures calling Ping() actually does delay the connection from
being closed. (We only had a test that if you never called Ping in time,
it would die, but not that Ping can delay that death.)
This is a step towards making all of the Facades follow a common
pattern, as this allows Pinger to also just take Resources rather than
needing to know about details of the srvRoot object.
https:/ /code.launchpad .net/~jameinel/ juju-core/ api-named- resources/ +merge/ 220208
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/93500044/
Affected files (+118, -13 lines): /admin. go /common/ resource. go /common/ resource_ test.go /pinger_ test.go /root.go /root_test. go
A [revision details]
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver
M state/apiserver