Page MenuHomePhabricator

"Resolved" should be the first (default) option in "Change Status" action
Closed, ResolvedPublic

Description

Reported upstream: https://secure.phabricator.com/T7164

Currently in Bugzilla, when you mark a bug "RESOLVED", the default option offered is "FIXED".

Also in https://secure.phabricator.org, when you "Change Status" in a comment, the default option is "Resolved".

In contrast, in our Phabricator the default option offered is "Declined", which doesn't send a positive message.

This is probably due to the sorting of the options, which in our case is alphabetical. Proposing this sorting instead:

  1. Open
  2. Resolved
  3. Needs Info
  4. Declined
  5. Invalid

Event Timeline

Qgil raised the priority of this task from to Needs Triage.
Qgil updated the task description. (Show Details)
Qgil added a project: Bugzilla-Migration.
Qgil changed Security from none to None.
Qgil subscribed.

Generally +1 on the request.

"Declined" is the last item in https://git.wikimedia.org/blame/operations%2Fpuppet.git/e97b10890b3d3671c7f3412b2e6e69b2b086fde1/modules%2Fphabricator%2Fdata%2Ffixed_settings.yaml but https://phabricator.wikimedia.org/config/edit/maniphest.statuses/ lists stuff alphabetically.

Not sure if this is a Phabricator upstream limitation (no custom sort order allowed?) or if this is inconsistent between the stuff in Puppet and our instance.

Aklapper renamed this task from "Resolved" should be the default option in "Change Status" action to "Resolved" should be the first (default) option in "Change Status" action.Oct 6 2014, 11:52 AM
Aklapper triaged this task as Medium priority.
In T548#8372, @Aklapper wrote:

Not sure if this is a Phabricator upstream limitation (no custom sort order allowed?) or if this is inconsistent between the stuff in Puppet and our instance.

No idea, but upstream's UI offers this sorting:

  1. Open
  2. Resolved
  3. Wontfix
  4. Invalid
  5. Spit
chasemp claimed this task.

It sure seems like the custom status's are displayed alphabetically. We could test this in labs by putting in a Zzzzz and an Aaaaa status and playing a bit, may come down to requesting the ability to have an explicit ordering here https://phabricator.wikimedia.org/config/edit/maniphest.statuses/

but yeah, would prefer resolved to the first option as well

Qgil edited projects, added Phabricator, Phabricator (Upstream); removed Bugzilla-Migration.

Ok, removing bugzilla-migration requirement, adding phabricator.org in order to file this upstream. I'll do this.

Qgil added a subscriber: chasemp.
Qgil lowered the priority of this task from Medium to Low.Oct 22 2014, 9:08 PM

According to upstream, and according to @chasemp, this is a local problem in our instance.

Thanks guys. To give some background we generate the json file via puppet and so a custom ruby function. I bet that function is sorting these by key which means this is probably a local install particular. We are not crazy I am almost mostly sure.

To give some background we generate the json file via puppet and so a custom ruby function. I bet that function is sorting these by key which means this is probably a local install particular.

Ruby hashes, unlike PHP associative arrays, do not guarantee keeping the ordering. And JSON (and YAML) objects specifically are not ordered. Even if it's surfaced only by our magic configuration, this should still be considered an upstream bug.

Ruby hashes, unlike PHP associative arrays, do not guarantee keeping the ordering. And JSON (and YAML) objects specifically are not ordered. Even if it's surfaced only by our magic configuration, this should still be considered an upstream bug.

How can it be considered upstream bug exactly? Sounds like an upstream feature request to support ordering by some other method. Or we just fix our puppet setup to somehow force the correct ordering.

Ruby hashes, unlike PHP associative arrays, do not guarantee keeping the ordering. And JSON (and YAML) objects specifically are not ordered. Even if it's surfaced only by our magic configuration, this should still be considered an upstream bug.

FWIW, this is only true of hashes in Ruby 1.8. In either case, the ordered_json function explicitly sorts a hash argument before iterating over it.

Change 205338 had a related patch set uploaded (by Bartosz Dziewoński):
Do no order Phabricator settings JSON lexicographically

https://gerrit.wikimedia.org/r/205338

How can it be considered upstream bug exactly? Sounds like an upstream feature request to support ordering by some other method. Or we just fix our puppet setup to somehow force the correct ordering.

I consider it a bug that the configuration relies on the order of a JSON object, while JSON objects are explicitly unordered. http://json.org/

How can it be considered upstream bug exactly? Sounds like an upstream feature request to support ordering by some other method. Or we just fix our puppet setup to somehow force the correct ordering.

I consider it a bug that the configuration relies on the order of a JSON object, while JSON objects are explicitly unordered. http://json.org/

that's probably a fair thought

So we should probably submit a patch upstream that adds an ordering property (int) to the status objects. I imagine they would accept it if we make the effort.

I inquired in the upstream task as to whether they would be receptive to a patch that adds explicit ordering. I suspect that they won't be too against it, especially after my cheap () but skilled bribery (lols) ...

My humor was unpersuasive, but Evan suggested an entirely sane way to handle the situation. For this particular config key, we really don't have to store the value in yml/puppet as it's entirely a static value (no need for puppet to dynamically change it in any way). I think the easiest thing to do would be to set this particular phabricator config key from php instead of the dynamically generated json.

Change 205797 had a related patch set uploaded (by 20after4):
Move maniphest status settings into custom/wmf-defaults.php

https://gerrit.wikimedia.org/r/205797

Change 205338 abandoned by Bartosz Dziewoński:
Preserve order of 'maniphest.statuses' in Phabricator settings

Reason:
Superseded by https://gerrit.wikimedia.org/r/#/c/205797/

https://gerrit.wikimedia.org/r/205338

mmodell changed the task status from Open to Stalled.Apr 26 2015, 8:43 AM

My change got -1'd in gerrit so I'm fixing this in the database (this is a temp fix which isn't ideal but it does address the problem for now)

@mmodell: Yeah, "Database" differs now from "Local Config" on https://phabricator.wikimedia.org/config/edit/maniphest.statuses/ but it works. Thanks ("for the time being"?). :)

Change 205797 abandoned by 20after4:
Move maniphest status settings into custom/wmf-defaults.php

Reason:
grumble grumble

https://gerrit.wikimedia.org/r/205797

Restricted Application added a subscriber: scfc. · View Herald TranscriptJul 1 2015, 9:24 AM

Change 205797 restored by 20after4:
Move maniphest status settings into custom/wmf-defaults.php

Reason:
this is still a good idea, and I still don't understand Alexandros' -1 on this change

https://gerrit.wikimedia.org/r/205797

Change 205797 abandoned by 20after4:
Move maniphest status settings into custom/wmf-defaults.php

Reason:
I still think this is the way to go, however, things have changed a bit since I wrote this and I think it needs to be reworked a bit. I'll bring this back from the dead sometime when I can give it the attention it deserves.

https://gerrit.wikimedia.org/r/205797