Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit ad1403d

Browse files
committedMay 14, 2018
Fix bug ID ordering in commit messages
Some commit messages contain multiple bug IDs, often from other systems in addition to BMO. Picking one of those IDs by accident confuses the review system classifier. Make sure we follow the Firefox convention and pick the first ID found in commit message strings.
1 parent 965bc5f commit ad1403d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎committelemetry/classifier.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,14 @@ def determine_review_system(revision_json):
152152

153153
# TODO handle multiple bugs?
154154
try:
155-
bug_id = parse_bugs(summary).pop()
155+
# Take the first bug # found. For Firefox commits this is usually at
156+
# the front of the string, like "Bug XXXXXX - fix the bar". try to
157+
# avoid messages where there is a second ID in the message, like
158+
# 'Bug 1458766 [wpt PR 10812] - [LayoutNG] ...'.
159+
# NOTE: Bugs with the BMO bug # at the end will still get the wrong ID,
160+
# such as:
161+
# '[wpt PR 10812] blah blah (bug 1111111) r=foo'
162+
bug_id = parse_bugs(summary)[0]
156163
except IndexError:
157164
log.info(
158165
f'could not determine review system for changeset {changeset}: unable to find a bug id in the changeset summary'

0 commit comments

Comments
 (0)
Failed to load comments.