Last Comment Bug 789576 - Automatically linkify "bug XXXXXX" when present in tree status reason/motd
: Automatically linkify "bug XXXXXX" when present in tree status reason/motd
Status: RESOLVED FIXED
:
Product: Tree Management Graveyard
Classification: Graveyard
Component: TBPL (show other bugs)
: Trunk
: All All
: -- normal
: ---
Assigned To: Graeme McCutcheon [:graememcc]
:
Mentors:
Depends on: 790559 805550
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-07 13:32 PDT by Graeme McCutcheon [:graememcc]
Modified: 2015-04-13 15:57 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (1.48 KB, patch)
2012-09-07 13:34 PDT, Graeme McCutcheon [:graememcc]
arpad.borsos: review-
Details | Diff | Review
v2 (1.13 KB, patch)
2012-09-07 14:00 PDT, Graeme McCutcheon [:graememcc]
arpad.borsos: review+
Details | Diff | Review
v3 (3.30 KB, patch)
2012-09-08 04:00 PDT, Graeme McCutcheon [:graememcc]
arpad.borsos: review+
Details | Diff | Review

Description Graeme McCutcheon [:graememcc] 2012-09-07 13:32:17 PDT
Per https://github.com/catlee/treestatus/pull/28/ catlee would prefer this is handled on the TBPL side rather than the TreeStatus side.

Again, I'm using the simple heuristic that a bug number followed by a </a> is already linked, and won't change it in this case.

I'm using {6,7} for the digit count: at this stage I assume any future tree closures are not going to be due to 5-digit bugs.
Comment 1 Graeme McCutcheon [:graememcc] 2012-09-07 13:34:02 PDT
Created attachment 659343 [details] [diff] [review]
v1
Comment 2 Arpad Borsos [:Swatinem] 2012-09-07 13:42:37 PDT
Comment on attachment 659343 [details] [diff] [review]
v1

Review of attachment 659343 [details] [diff] [review]:
-----------------------------------------------------------------

We already have a function for that: http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/file/2d0555694735/js/UserInterface.js#l755
Use that and we are good to go :-)
Comment 3 Graeme McCutcheon [:graememcc] 2012-09-07 14:00:11 PDT
Created attachment 659351 [details] [diff] [review]
v2

Ah never spotted that - thanks!
Comment 4 Arpad Borsos [:Swatinem] 2012-09-07 14:17:27 PDT
Comment on attachment 659351 [details] [diff] [review]
v2

Review of attachment 659351 [details] [diff] [review]:
-----------------------------------------------------------------

Good. Although it has no </a> handling, well then we just need to have the convention to not have linked bugs in the tree status.
Comment 5 Graeme McCutcheon [:graememcc] 2012-09-07 14:22:19 PDT
Actually, that escapeContent() call in _linkBugs will prevent us adding other links in to the reason field - e.g. the wiki.m.o link in the current inbound message - the HTML will be rendered as plaintext.
Comment 6 Arpad Borsos [:Swatinem] 2012-09-07 14:25:04 PDT
Hm, I missed that then. So we could add another option to prevent that.
Comment 7 Graeme McCutcheon [:graememcc] 2012-09-08 04:00:00 PDT
Created attachment 659471 [details] [diff] [review]
v3

Added an additional parameter to _linkBugs to signal whether to escape the string. This let me reinstate the </a> check - it was redundant when the text was escaped.
Comment 9 Ed Morley [:emorley] 2012-09-08 07:23:56 PDT
Thank you for this Graeme! :-)

Note You need to log in before you can comment on or make changes to this bug.