Add application offers to allwatcher #7258

Merged
merged 1 commit into from Apr 21, 2017

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Apr 20, 2017

Description of change

The watcher used by the GUI needs to have application offers added to its model.
This required adding some permissions to the client facade back end so that only admins can see a model's offers. Also, ensure that remote app proxies from consuming apps are excluded from the watcher model.

Also add test coverage for remote applications to the client apiserver status.

QA steps

The GUI doesn't display offers yet, so just do a smoke test - set up a CMR scenario and use the GUI.

One major thing while I continue with the review.

state/state.go
@@ -538,8 +538,8 @@ func (st *State) MongoSession() *mgo.Session {
return st.session
}
-func (st *State) Watch() *Multiwatcher {
- return NewMultiwatcher(st.workers.allManager())
+func (st *State) Watch(perm permission.Access) *Multiwatcher {
@axw

axw Apr 21, 2017

Member

It seems really inappropriate to be passing in permissions here. State does not do permission checking, so this should be saying more specifically what the scope of the watch is. i.e. whether it should include application offers. Perhaps define a new struct which controls what things to watch?

Just the perm thing. Everything else looks fine.

state/allwatcher_internal_test.go
@@ -51,7 +54,7 @@ type allWatcherBaseSuite struct {
// setUpScenario adds some entities to the state so that
// we can check that they all get pulled in by
// all(Model)WatcherStateBacking.GetAll.
-func (s *allWatcherBaseSuite) setUpScenario(c *gc.C, st *State, units int) (entities entityInfoSlice) {
+func (s *allWatcherBaseSuite) setUpScenario(c *gc.C, st *State, units int, perm permission.Access) (entities entityInfoSlice) {
@axw

axw Apr 21, 2017

Member

and here, rather than perm, change it to "setupApplicationOffer bool" or similar

axw approved these changes Apr 21, 2017

state/state.go
@@ -538,8 +538,15 @@ func (st *State) MongoSession() *mgo.Session {
return st.session
}
-func (st *State) Watch() *Multiwatcher {
- return NewMultiwatcher(st.workers.allManager())
+// WatchParams defines config to control watch
@axw

axw Apr 21, 2017

Member

s/watch/which/

state/state.go
-func (st *State) Watch() *Multiwatcher {
- return NewMultiwatcher(st.workers.allManager())
+// WatchParams defines config to control watch
+// entites are include when watching a model.
@axw

axw Apr 21, 2017

Member

s/include/included/

state/state.go
+// WatchParams defines config to control watch
+// entites are include when watching a model.
+type WatchParams struct {
+ // IncludeOffers is true if application offers should be watched.
@axw

axw Apr 21, 2017

Member

// IncludeOffers, if true, ...
or
// IncludeOffers controls whether ...

Owner

wallyworld commented Apr 21, 2017

$$merge$$

Contributor

jujubot commented Apr 21, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Apr 21, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10702

Owner

wallyworld commented Apr 21, 2017

$$merge$$

Contributor

jujubot commented Apr 21, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Apr 21, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10704

Owner

wallyworld commented Apr 21, 2017

$$merge$$

Contributor

jujubot commented Apr 21, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Apr 21, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10710

Contributor

jujubot commented Apr 21, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10719

@jujubot jujubot merged commit 49b8fe1 into juju:develop Apr 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment