New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 733412 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

LoginCustomFlags section of enums.xml mangled

Project Member Reported by elawrence@chromium.org, Jun 14 2017

Issue description

Open enums.xml and look at LoginCustomFlags.

Expect: Comment and summary at the top of the enumeration.
Actual: They were moved to the middle of the file sometime in the last few weeks.

Also, the summary seems to be inaccurate.

 
Owner: holte@chromium.org
Status: Assigned (was: Untriaged)
Steve, could you take a look? Possibly related to the histograms.xml/enums.xml split?
Cc: twelling...@chromium.org
I suspect this was either a copy-paste error or a bug in the pretty printer script.

Regression introduced here: https://chromium.googlesource.com/chromium/src/+/d1ada059c7362462bf72dc44c103db994362d9c3%5E%21/#F18
It was a git cl format.

Comment 4 by holte@chromium.org, Jun 14 2017

This isn't related to the xml split, it's been around for a while.  This occurs when the node immediately after the summary/comment is sorted to a new position, the summary/comment follows it.  So it's pretty-print stable to just move them back up to the top again.

There is a relevant comment in pretty_print_xml.py
          # Subnodes that we don't want to rearrange use the next node's key,
          # so they stay in the same relative position.
          # Therefore we delay setting key until the next node is found.

Basically all other kinds of nodes than the one being sorted (in this case, int) are considered attached to the next node.  This usually makes sense for comments, e.g. if you write a comment about the integer it should follow that value around when it gets sorted.  It doesn't make sense for summary, since there is a correct position for it, but the alphabetization rules don't currently express our preference for that.


I put the comment and summary back in the right place in https://chromium.googlesource.com/chromium/src/+/408bddbca79a0709ec2daa97872426c39bfe04b7. 

I'm not clear whether there's anything else we should do to the scripts to prevent future recurrence.

Comment 6 by holte@chromium.org, Jun 15 2017

There are 2 things that need to happen.

1. We need to update the alphabetization rules in
tools/metrics/histograms/print_style.py to express an order preference

2. We need to update the code that applies those rules in:
tools/metrics/common/pretty_print_xml.py to to be able to understand and apply the rules we added in #1

Sign in to add a comment