Merge lp:~jameinel/juju-core/api-srvRoot-ensures-type into lp:~go-bot/juju-core/trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~jameinel/juju-core/api-srvRoot-ensures-type |
Merge into: | lp:~go-bot/juju-core/trunk |
Prerequisite: | lp:~jameinel/juju-core/api-registry-tracks-type |
Diff against target: |
228 lines (+130/-7) 5 files modified
state/apiserver/export_test.go (+18/-0) state/apiserver/root.go (+16/-6) state/apiserver/root_test.go (+53/-1) utils/registry/registry.go (+11/-0) utils/registry/registry_test.go (+32/-0) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/api-srvRoot-ensures-type |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+220615@code.launchpad.net |
Description of the change
state/apiserver: ensure Facades match their type
FacadeFactory has to be a type defined to return interface{} because of
go type limitations. However, when we Register a Facade we define what
Type is meant to be exposed in that API. This change makes sure that we
enforce that Type at runtime.
This change also cleans up srvRoot slightly to reduce its coupling with
the rest of the system and make it possible to create one for testing.
Unmerged revisions
- 2760. By John A Meinel
-
Merged api-registry-
tracks- type into api-srvRoot- ensures- type. - 2759. By John A Meinel
-
Merged api-registry-
tracks- type into api-srvRoot- ensures- type. - 2758. By John A Meinel
-
Merged api-registry-
tracks- type into api-srvRoot- ensures- type. - 2757. By John A Meinel
-
Merged api-registry-
tracks- type into api-srvRoot- ensures- type. - 2756. By John A Meinel
-
Merge up the removal of all of the compat functions.
- 2755. By John A Meinel
-
Merged api-registry-
tracks- type into api-srvRoot- ensures- type. - 2754. By John A Meinel
-
change srvRoot.
MethodCaller to actually ensure objects returned match their type. RegisterStandar
dFacade makes sure the right type gets registered,
but RegisterFacade doesn't because the Facade interface has to
return interface{}. But we can test it at runtime, so lets do that
to avoid ever having accidental skew. - 2753. By John A Meinel
-
Add registry.
TypeNameVersion .Discard( ) This allows us to register things for a test and then cleanup
when we are done. - 2752. By John A Meinel
-
fix a changed function name
- 2751. By John A Meinel
-
Merge api-use-
register- standard- facade.
Reviewers: mp+220615_ code.launchpad. net,
Message:
Please take a look.
Description:
state/apiserver: ensure Facades match their type
FacadeFactory has to be a type defined to return interface{} because of
go type limitations. However, when we Register a Facade we define what
Type is meant to be exposed in that API. This change makes sure that we
enforce that Type at runtime.
This change also cleans up srvRoot slightly to reduce its coupling with
the rest of the system and make it possible to create one for testing.
https:/ /code.launchpad .net/~jameinel/ juju-core/ api-srvRoot- ensures- type/+merge/ 220615
Requires: /code.launchpad .net/~jameinel/ juju-core/ api-registry- tracks- type/+merge/ 220588
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/97570051/
Affected files (+133, -8 lines): /export_ test.go /root.go /root_test. go registry. go registry_ test.go
A [revision details]
M state/apiserver
M state/apiserver
M state/apiserver
M utils/registry/
M utils/registry/