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

Issue 12551043: state: implement the single FindEntity method

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by rog
Modified:
10 years, 7 months ago
Reviewers:
dimitern, mp+178825, gz
Visibility:
Public.

Description

state: implement the single FindEntity method We rely on clients to do the type conversions themselves if they want, rather than trying to second-guess every possible interface that a they might want to use. Create a new state/interface.go file to hold interfaces that entities can conform to. https://code.launchpad.net/~rogpeppe/juju-core/363-agent-entity/+merge/178825 Requires: https://code.launchpad.net/~rogpeppe/juju-core/362-names-parse-tag/+merge/178619 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: implement the single FindEntity method #

Total comments: 9

Patch Set 3 : state: implement the single FindEntity method #

Patch Set 4 : state: implement the single FindEntity method #

Patch Set 5 : state: implement the single FindEntity method #

Patch Set 6 : state: implement the single FindEntity method #

Patch Set 7 : state: implement the single FindEntity method #

Total comments: 3

Patch Set 8 : state: implement the single FindEntity method #

Patch Set 9 : state: implement the single FindEntity method #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+520 lines, -653 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujud/agent_test.go View 2 chunks +1 line, -9 lines 0 comments Download
M names/tag.go View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M names/tag_test.go View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
M state/apiserver/admin.go View 3 chunks +6 lines, -2 lines 0 comments Download
M state/apiserver/agent/agent.go View 1 chunk +6 lines, -1 line 0 comments Download
M state/apiserver/client/api_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M state/apiserver/client/client.go View 1 chunk +17 lines, -4 lines 0 comments Download
M state/apiserver/client/client_test.go View 5 1 chunk +5 lines, -1 line 0 comments Download
M state/apiserver/common/ensuredead.go View 1 2 3 4 5 2 chunks +8 lines, -12 lines 0 comments Download
M state/apiserver/common/ensuredead_test.go View 1 2 3 4 5 5 chunks +11 lines, -28 lines 0 comments Download
M state/apiserver/common/errors.go View 1 chunk +15 lines, -0 lines 2 comments Download
M state/apiserver/common/life.go View 2 chunks +15 lines, -11 lines 0 comments Download
M state/apiserver/common/life_test.go View 1 2 5 chunks +10 lines, -28 lines 0 comments Download
M state/apiserver/common/password.go View 2 chunks +7 lines, -7 lines 0 comments Download
M state/apiserver/common/password_test.go View 1 2 5 chunks +42 lines, -18 lines 0 comments Download
M state/apiserver/common/remove.go View 1 2 3 4 5 1 chunk +13 lines, -13 lines 0 comments Download
M state/apiserver/common/remove_test.go View 1 2 5 chunks +12 lines, -30 lines 0 comments Download
M state/apiserver/common/setstatus.go View 2 chunks +8 lines, -12 lines 0 comments Download
M state/apiserver/common/setstatus_test.go View 1 2 3 4 5 8 chunks +24 lines, -31 lines 0 comments Download
M state/apiserver/common/watch.go View 1 2 3 4 5 2 chunks +8 lines, -12 lines 0 comments Download
M state/apiserver/common/watch_test.go View 1 2 3 4 5 7 chunks +11 lines, -27 lines 0 comments Download
M state/apiserver/root.go View 2 chunks +7 lines, -2 lines 0 comments Download
M state/apiserver/upgrader/upgrader.go View 3 chunks +22 lines, -9 lines 0 comments Download
M state/apiserver/utils.go View 2 chunks +3 lines, -3 lines 0 comments Download
M state/assign_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/initialize_test.go View 2 chunks +3 lines, -2 lines 0 comments Download
A state/interface.go View 1 2 3 1 chunk +149 lines, -0 lines 0 comments Download
M state/machine.go View 1 chunk +0 lines, -2 lines 0 comments Download
M state/state.go View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -213 lines 0 comments Download
M state/state_test.go View 1 2 3 4 5 6 7 4 chunks +92 lines, -170 lines 0 comments Download
M state/unit.go View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 8
rog
Please take a look.
10 years, 7 months ago (2013-08-06 17:59:26 UTC) #1
dimitern
Looks really good, but I'm concerned about some test cases in apiserver/common being removed. Also ...
10 years, 7 months ago (2013-08-07 09:13:09 UTC) #2
rog
Please take a look. https://codereview.appspot.com/12551043/diff/3001/state/apiserver/common/life_test.go File state/apiserver/common/life_test.go (left): https://codereview.appspot.com/12551043/diff/3001/state/apiserver/common/life_test.go#oldcode55 state/apiserver/common/life_test.go:55: "x3": {err: fmt.Errorf("x3 error")}, On ...
10 years, 7 months ago (2013-08-07 12:20:43 UTC) #3
dimitern
LGTM with that TODO reinstated. https://codereview.appspot.com/12551043/diff/17010/state/apiserver/common/ensuredead.go File state/apiserver/common/ensuredead.go (left): https://codereview.appspot.com/12551043/diff/17010/state/apiserver/common/ensuredead.go#oldcode18 state/apiserver/common/ensuredead.go:18: type DeadEnsurerer interface { ...
10 years, 7 months ago (2013-08-07 12:56:26 UTC) #4
rog
Please take a look.
10 years, 7 months ago (2013-08-07 13:02:34 UTC) #5
rog
Please take a look.
10 years, 7 months ago (2013-08-07 14:24:41 UTC) #6
gz
LGTM. Kills the -erers which is grand, and the extra cast/check error/NotImplementedError everywhere is offset ...
10 years, 7 months ago (2013-08-07 14:54:42 UTC) #7
rog
10 years, 7 months ago (2013-08-07 15:00:48 UTC) #8
https://codereview.appspot.com/12551043/diff/26001/state/apiserver/common/err...
File state/apiserver/common/errors.go (right):

https://codereview.appspot.com/12551043/diff/26001/state/apiserver/common/err...
state/apiserver/common/errors.go:24: func NotSupportedError(entity, operation
string) error {
On 2013/08/07 14:54:42, gz wrote:
> I wonder if this wants a less generic name? I'm not sure the package prefix is
> enough to say this is about entities not supporting operations.

A reasonable point. I'll change it to use a better name,
if I can think of one.
Sign in to reply to this message.

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