state: include the workload version in the AllWatcher application info. #7563

Merged
merged 1 commit into from Jun 28, 2017

Conversation

Projects
None yet
4 participants
Member

frankban commented Jun 27, 2017

Description of change

Include the workload version as part of the application info sent by the all watcher.
See juju/juju-gui#2600

QA steps

Deploy postgresq, run the API calls (WatchAll + Next) to watch the model, and you should see the workload-version as part of the stream when the charm sets it.

@frankban frankban changed the title from All watcher: include the workload version in application info. to state: include the workload version in the AllWatcher application info. Jun 27, 2017

LGTM with reservations about the way that workload/application version is working in general, but that's not your fault.

state/allwatcher.go
+ unit, err := st.Unit(newInfo.Name)
+ if err != nil {
+ return errors.Annotatef(err, "cannot retrieve unit %q", newInfo.Name)
+ }
// A change in a unit's status might also affect it's application.
@rogpeppe

rogpeppe Jun 27, 2017

Owner

s/it's/its/

(not your fault :])

+ workloadVersion, err := unit.WorkloadVersion()
+ if err != nil {
+ return errors.Annotatef(err, "cannot retrieve workload version for %q", unit.Name())
+ } else if workloadVersion != "" {
@rogpeppe

rogpeppe Jun 27, 2017

Owner

I have to say that this makes me uneasy, because we've essentially got an arbitrary unit being used to provide the workload version for the entire application. I'd've thought that setting the workload version might be similar to setting the application status - only possible for the leader to do.

I guess that's a policy decision though, and given current policy, this seems unavoidable.

@frankban frankban referenced this pull request in juju/juju-gui Jun 27, 2017

Closed

Show workload version in the GUI #2600

Owner

wallyworld commented Jun 28, 2017

As discussed on IRC showing a single workload version is a lie, but if we are doing this change to exactly match what is already in juju status then we can live with it for now

Member

frankban commented Jun 28, 2017

$$merge$$

Contributor

jujubot commented Jun 28, 2017

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

Contributor

jujubot commented Jun 28, 2017

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

Member

frankban commented Jun 28, 2017

$$merge$$

Contributor

jujubot commented Jun 28, 2017

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

@jujubot jujubot merged commit 50b8f29 into juju:develop Jun 28, 2017

1 check passed

github-check-merge-juju Ran tests against PR. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment