bug mentions in commit messages only get the last bug linkified

VERIFIED FIXED

Status

P2
normal
VERIFIED FIXED
4 years ago
3 years ago

People

(Reporter: camd, Assigned: jfrench)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Created attachment 8564309 [details]
Screenshot 2015-02-13 11.52.21.png

it should linkify all bug mentions in the comments
Blocks: 1081041
Priority: -- → P2
Priority: P2 → P3
This is pretty surprising behavior, esp. since the last bug number is often not clickable at all, because it's not shown within the fairly narrow space we have for the commit message.
Bug 1081041 should have done something similar to:
https://hg.mozilla.org/webtools/tbpl/file/547a7de112ac/js/UserInterface.js#l777
(well, not as unreadably as TBPL, but still)

Jonathan, interest in taking this? :-)
Priority: P3 → P2
(Assignee)

Comment 3

4 years ago
Sure, will have a go.
Assignee: nobody → tojonmz
Status: NEW → ASSIGNED
Duplicate of this bug: 1141403

Comment 5

4 years ago
(In reply to Ed Morley [:edmorley] from comment #2)
> Bug 1081041 should have done something similar to:
> https://hg.mozilla.org/webtools/tbpl/file/547a7de112ac/js/UserInterface.
> js#l777
> (well, not as unreadably as TBPL, but still)

Or at least wrap the logic in <https://github.com/mozilla/treeherder-ui/pull/351/files#diff-7d56811a875af3d6e14e635462174245R43> in a |while (bug_matches || pr_matches)| loop...
(Assignee)

Comment 6

4 years ago
Thanks Ehsan, sorry I didn't get to this yet, I had other Treeherder bugs in front of this in my queue.

I'm out for a bit tomorrow, but back all day Friday. If it's urgent feel free to reassign if needed.
(Assignee)

Comment 7

4 years ago
I have a local wip that linkifies correctly using the offending string, I just need to sort out the most efficient way to construct a new bug_match list using the current .exec(str) regex.
(Assignee)

Comment 8

4 years ago
It looks like there's issues in the way we generate the titles also. If you hover on a linked bug in a 'multi-bug' summary line, all linkified bugs will inherit the parent span title, and so will be wrong on all but 1 of the links.
(Assignee)

Comment 9

4 years ago
I think I have all the possible matches covered, multiple bug numbers with different prefixes, repeated bug numbers, PRs, combinations of bug numbers and PR's, etc. I still have to sort the title injection to override the overall span title, mentioned in comment 8.
(Assignee)

Comment 10

4 years ago
I spoke too soon. More failure cases to sort out, and may have to look at another way of building the array.
(Assignee)

Comment 11

4 years ago
Created attachment 8580216 [details] [review]
treeherder-ui-PR#430

Please see above PR for status and review. Wlach, if/when it's an r+, if you can give it some brief local testing, that would be awesome :)
Attachment #8580216 - Flags: review?(wlachance)
Comment on attachment 8580216 [details] [review]
treeherder-ui-PR#430

Some debugging code left in unintentionally, plus some minor adjustments needed.
Attachment #8580216 - Flags: review?(wlachance) → review-
(Assignee)

Comment 13

4 years ago
Yup, I had just left them in for PR testing :) I've pulled them and made the other corrections.
(Assignee)

Updated

4 years ago
Attachment #8580216 - Flags: review- → review?
(Assignee)

Updated

4 years ago
Attachment #8580216 - Flags: review? → review?(wlachance)
Attachment #8580216 - Flags: review?(wlachance) → review+

Comment 14

4 years ago
Commits pushed to master at https://github.com/mozilla/treeherder-ui

https://github.com/mozilla/treeherder-ui/commit/a66933c8defeccbf7fa2ad9528568cc6ab7847ba
Bug 1133021 - Linkify all bugs and prs in revision commit messages

https://github.com/mozilla/treeherder-ui/commit/7b418c30ea3b591602a0083a3a71f2dd4553efa0
Merge pull request #430 from tojonmz/commit-msg-links

Bug 1133021 - Linkify all bugs and prs in revision commit messages
(Assignee)

Comment 15

4 years ago
Marking fixed per above merge. I'll verify on the next push to stage/prod.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Comment 16

3 years ago
Verified fixed on stage. It will be live on the next push to production.

Per comment 8 above, to expedite the fix and avoid unknowns with bmo and github api's we inject a proxy title on all blue linkified issues (PRs, Bugs) with "github.com" and "bugzilla.mozilla.org", rather than what we had before, which was nothing and only incidentally worked if the commit message happened to match the Bug summary or PR title.

I will open a follow up for possible title injection. If folks prefer as-is we can mark that new bug wont fix, or we can keep it open in case there's a way to access the titles with no performance cost.
Status: RESOLVED → VERIFIED
(Assignee)

Comment 17

3 years ago
Bug 1146142.

Comment 18

3 years ago
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/fd6f811019a926521f67f9ce0ac6eca4c99c512b
Bug 1133021 - Linkify all bugs and prs in revision commit messages

https://github.com/mozilla/treeherder/commit/5e23d58e854f8e623b00b414f4109145445c1549
Merge pull request #430 from tojonmz/commit-msg-links

Bug 1133021 - Linkify all bugs and prs in revision commit messages
You need to log in before you can comment on or make changes to this bug.