Custom Label Order on new change screen not working?

49 views
Skip to first unread message

Welch, Ronald P (US SSA)

unread,
Sep 18, 2014, 11:39:10 AM9/18/14
to Repo and Gerrit Discussion
I have Project level labels specified as follows in the
project.config file:

[label "Devl-Build"]
value = -1 Fails-Devl
value =  0 No score
value = +1 Verified-Devl
        abbreviation = D
function = MaxWithBlock
[label "Qual-Build"]
value = -1 Fails-Qual
value =  0 No score
value = +1 Verified-Qual
        abbreviation = Q
function = MaxWithBlock
[label "Prod-Build"]
value = -1 Fails-Prod
value =  0 No score
value = +1 Verified-Prod
        abbreviation = P
function = MaxWithBlock

They do not appear in Devl/Qual/Prod order on the change screen
but rather as Devl/Prod/Qual as can be seen in this screen shot:



Is this a bug or am I doing something wrong?

Thanks,
Ron

----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

Thomas Swindells (tswindel)

unread,
Sep 18, 2014, 12:03:21 PM9/18/14
to Welch, Ronald P (US SSA), Repo and Gerrit Discussion

Looks like they are appearing in alphabetical order.  What makes you think they should appear in the same order that they are defined as in the config file?

 

Thomas

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Welch, Ronald P (US SSA)

unread,
Sep 18, 2014, 12:45:39 PM9/18/14
to Thomas Swindells (tswindel), Repo and Gerrit Discussion
Hi Thomas,

In the "Your Label Here" section of the labels config-labels.html
file at:

https://gerrit-review.googlesource.com/Documentation/config-labels.html

The last paragraph says:

"Labels are laid out in the order they are specified in project.config, with inherited 
labels appearing first, providing some layout control to the administrator."


Maybe I am not interpreting what is meant by that correctly…

Ron
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

<image001.png>
 
 
Is this a bug or am I doing something wrong?
 
Thanks,
Ron
 
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------
 

Zu, Bruce

unread,
Sep 18, 2014, 1:10:39 PM9/18/14
to Welch, Ronald P (US SSA), Repo and Gerrit Discussion, Thomas Swindells (tswindel)
How about provide a config option to decide alphabetical order or their place order(default)?
/Bruce

Sent from my Sony Xperia™ smartphone


---- Thomas Swindells (tswindel) wrote ----
[cid:image0...@01CFD362.6D776270]


Is this a bug or am I doing something wrong?

Thanks,
Ron

----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com Phone:(607)206-8718
BAE SYSTEMS 1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

--
--
To unsubscribe, email repo-discuss...@googlegroups.com<mailto:repo-discuss...@googlegroups.com>
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com<mailto:repo-discuss...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com<mailto:repo-discuss...@googlegroups.com>.

Dave Borowitz

unread,
Sep 18, 2014, 1:34:06 PM9/18/14
to Welch, Ronald P (US SSA), Thomas Swindells (tswindel), Repo and Gerrit Discussion
On Thu, Sep 18, 2014 at 9:45 AM, Welch, Ronald P (US SSA) <ronald....@baesystems.com> wrote:
Hi Thomas,

In the "Your Label Here" section of the labels config-labels.html
file at:

https://gerrit-review.googlesource.com/Documentation/config-labels.html

The last paragraph says:

"Labels are laid out in the order they are specified in project.config, with inherited 
labels appearing first, providing some layout control to the administrator."


Maybe I am not interpreting what is meant by that correctly…

I suspect they are coming back in the right order in the REST API and then reordered on the client. (Either that or I was lying when I wrote that sentence...)

Can you look at the REST API response and confirm?

Welch, Ronald P (US SSA)

unread,
Sep 18, 2014, 1:35:14 PM9/18/14
to Zu, Bruce, Repo and Gerrit Discussion, Thomas Swindells (tswindel)
That would be good, but one could easily achieve alphabetical 
order just by listing them that way in the config file if the 
file-based layout ordering worked…

BTW, the order is the same in the "Reply…" button dialog:

 
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

On Sep 18, 2014, at 1:10 PM, Zu, Bruce wrote:

How about provide a config option to decide alphabetical order or their place order(default)?
/Bruce

Sent from my Sony Xperia(tm) smartphone
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Dave Borowitz

unread,
Sep 18, 2014, 1:45:13 PM9/18/14
to Welch, Ronald P (US SSA), Thomas Swindells (tswindel), Repo and Gerrit Discussion
On Thu, Sep 18, 2014 at 10:33 AM, Dave Borowitz <dbor...@google.com> wrote:


On Thu, Sep 18, 2014 at 9:45 AM, Welch, Ronald P (US SSA) <ronald....@baesystems.com> wrote:
Hi Thomas,

In the "Your Label Here" section of the labels config-labels.html
file at:

https://gerrit-review.googlesource.com/Documentation/config-labels.html

The last paragraph says:

"Labels are laid out in the order they are specified in project.config, with inherited 
labels appearing first, providing some layout control to the administrator."


Maybe I am not interpreting what is meant by that correctly…

I suspect they are coming back in the right order in the REST API and then reordered on the client. (Either that or I was lying when I wrote that sentence...)

Can you look at the REST API response and confirm?

I found at least one place in the code where we're sorting label names returned by the server. We probably shouldn't, but I don't know that the iteration order of results is the same as they came on the wire, is probably why it is the way it is.

Welch, Ronald P (US SSA)

unread,
Sep 18, 2014, 1:54:24 PM9/18/14
to Dave Borowitz, Thomas Swindells (tswindel), Repo and Gerrit Discussion
Hi Dave,

Here is the REST output:

)]}'
[
  {
    "kind": "gerritcodereview#change",
    "id": "wc10_Windchill~environment%2Frelease-candidate~If33e305919825bf70e4656cacae96049bc2cfeb5",
    "project": "wc10_Windchill",
    "branch": "environment/release-candidate",
    "change_id": "If33e305919825bf70e4656cacae96049bc2cfeb5",
    "subject": "[IT-TMS-14675] Workflow robot logging update",
    "status": "NEW",
    "created": "2014-09-13 19:07:14.851000000",
    "updated": "2014-09-18 12:08:29.039000000",
    "mergeable": true,
    "insertions": 66,
    "deletions": 26,
    "_sortkey": "002fde180000009a",
    "_number": 154,
    "owner": {
      "name": "Ronald Welch"
    },
    "labels": {
      "Code-Review": {},
      "DevlBuild": {},
      "QualBuild": {},
      "ProdBuild": {}
    }
  }
]


Looks like the are coming back in the "wrong" order.

Thanks for your help,

Ron
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

Thomas Swindells (tswindel)

unread,
Sep 19, 2014, 4:06:07 AM9/19/14
to Welch, Ronald P (US SSA), Zu, Bruce, Repo and Gerrit Discussion

Yep, I can definitely see why that part of the doc would make you think that.

A configuration option would be needed as child projects can’t enforce alphabetical order when inheriting labels from their parents.

Thomas Swindells (tswindel)

unread,
Sep 19, 2014, 4:06:44 AM9/19/14
to Welch, Ronald P (US SSA), Dave Borowitz, Repo and Gerrit Discussion

[Thomas Swindells] That’s the order that is defined in your config file isn’t it (Q before P) so must be  a client side rendering issue.

Welch, Ronald P (US SSA)

unread,
Sep 19, 2014, 7:35:48 AM9/19/14
to Thomas Swindells (tswindel), Dave Borowitz, Repo and Gerrit Discussion
Yes you are correct, it is the order from the config file. So the
client side rendering does appear to be holding a smoking gun.

----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

David Ostrovsky

unread,
Sep 19, 2014, 8:04:50 AM9/19/14
to repo-d...@googlegroups.com, tswi...@cisco.com, dbor...@google.com

Am Freitag, 19. September 2014 13:35:48 UTC+2 schrieb Ron Welch:
Yes you are correct, it is the order from the config file. So the
client side rendering does appear to be holding a smoking gun.

Sorting by label name happens here (from the first CS2 version) [1].

  1. boolean set(ChangeInfo info, boolean current) {
  2. List<String> names = new ArrayList<>(info.labels());
  3. Collections.sort(names);

Welch, Ronald P (US SSA)

unread,
Sep 19, 2014, 8:46:45 AM9/19/14
to David Ostrovsky, <repo-discuss@googlegroups.com>, <tswindel@cisco.com>, <dborowitz@google.com>
Ok, that makes sense. But alas I think the "problem" may be a bit
wider spread. For example, the labels are also sorted on the search
results table:




And also in the "Reply…" dialog on the change page:




Maybe other places too…I haven't explored completely.


----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

David Ostrovsky

unread,
Sep 21, 2014, 5:05:43 AM9/21/14
to repo-d...@googlegroups.com, david.o...@gmail.com, tswi...@cisco.com, dbor...@google.com

Am Freitag, 19. September 2014 14:46:45 UTC+2 schrieb Ron Welch:
Ok, that makes sense. But alas I think the "problem" may be a bit
wider spread. 

Reply all
Reply to author
Forward
0 new messages