status: Fix Relation section of tabular output #7729

Merged
merged 1 commit into from Aug 10, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Aug 10, 2017

Description of change

The Relation section had a few problems:

  • It would display subordinate relations twice (once with type:peer,
    once with type:regular) when the principal's name sorted after the
    subordinate's.
  • Although it had Provides and Consumes columns, the applications
    in a relation were actually displayed in alphabetical order.
  • Users report that the ordering of the rows in the section (by endpoint
    name, but not keeping applications together) isn't useful.

Change the section to report relations once using app:endpoint for each
end. Sort the rows by provider, then by requirer, so you can see all of
the relations that an application is providing more easily.

QA steps

Create a model with several relations, including subordinates. Running juju status should show each relation once, with correct providers and requirers, and the correct relation type (regular/peer/subordinate).

Running juju status --format yaml or json shouldn't change.

Yay

cmd/juju/status/formatted.go
@@ -243,3 +244,10 @@ func (s unitStatus) MarshalYAML() (interface{}, error) {
}
return unitStatusNoMarshal(s), nil
}
+
+type relationStatus struct {
+ Provider string `json:"provider" yaml:"provider"`
@wallyworld

wallyworld Aug 10, 2017

Owner

If Relations in formattedStatus is "-", then we don't need tags in this struct

cmd/juju/status/output_tabular.go
}
+ return a.Provider < b.Provider
+ })
+ outputHeaders("Relation Provider", "Requirer", "Interface", "Type")
@wallyworld

wallyworld Aug 10, 2017

Owner

lower case "provider"

status: Fix Relation section of tabular output
The Relation section had a few problems:
* It would display subordinate relations twice (once with type:peer,
  once with type:regular) when the principal's name sorted after the
  subordinate's.
* Even though it had Provides and Consumes columns, the applications
  in a relation were actually displayed in alphabetical order.
* Users report that the ordering of the rows in the section (by endpoint
  name, but not keeping applications together) isn't useful.

Change the section to report relations once using app:endpoint for each
end. Sort the rows by provider, then by requirer, so you can see all of
the relations that an application is providing more easily.
Member

babbageclunk commented Aug 10, 2017

$$merge$$

Contributor

jujubot commented Aug 10, 2017

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

@jujubot jujubot merged commit 4e9636a into juju:2.2 Aug 10, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@babbageclunk babbageclunk deleted the babbageclunk:status-weirdness branch Aug 10, 2017

Member

babbageclunk commented Sep 15, 2017

Related bug discovered after the fact: https://bugs.launchpad.net/juju/+bug/1597490

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