Bug 169707 - Provide bug information when https://webkit.org/b/# URLs are added in comments
Summary: Provide bug information when https://webkit.org/b/# URLs are added in comments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-15 15:39 PDT by Devin Rousso
Modified: 2017-05-30 20:30 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.32 KB, patch)
2017-03-15 16:11 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (1.44 KB, patch)
2017-03-15 19:40 PDT, Devin Rousso
joepeck: review+
Details | Formatted Diff | Diff
Patch (1.36 KB, patch)
2017-05-23 13:44 PDT, Devin Rousso
ddkilzer: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews124 for ios-simulator-wk2 (6.71 MB, application/zip)
2017-05-24 12:45 PDT, Build Bot
no flags Details
Patch (1.43 KB, patch)
2017-05-25 10:29 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2017-03-15 15:39:51 PDT
Bug information (such as if the bug is resolved) is applied to links in comments (usually via strikethroughs) so long as the URL matches the pattern https://bugs.webkit.org/show_bug.cgi?id=#
This functionality should be extended to include bug short links, namely https://webkit.org/b/#
Comment 1 Alexey Proskuryakov 2017-03-15 15:54:17 PDT
Adding webkit.org/b would be reasonable.

Note that "bug XXX" turns into a link too (and so does "bug XXX comment YYY"). That's the preferred form for it I think.
Comment 2 Devin Rousso 2017-03-15 16:11:42 PDT
Created attachment 304574 [details]
Patch

I am very inexperienced with Perl, but this is what I was able to figure out.  Not sure if it's correct, as I don't know how to test changes to any WebKit site.  Any feedback (both for the change and future debugging/testing tips) would be greatly appreciated.
Comment 3 Joseph Pecoraro 2017-03-15 17:25:49 PDT
Comment on attachment 304574 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304574&action=review

> Websites/bugs.webkit.org/Bugzilla/Template.pm:213
> +    $text =~ s~\b((\Qhttps?://\E)?\Qwebkit.org/b/\E([0-9]+)(\#c([0-9]+))?)\b

I think the (\Qhttps?://\E) is wrong. \Q...\E eliminates special character matching, so I would expect this to match the literal "https?://" instead of what it looks like you want which is either "http://" or "https://":
http://www.perlmonks.org/bare/?node_id=468052

You probably want:

    s~\b((https?://)?\Qwebkit.org/b/\E([0-9]+)(\#c([0-9]+))?)\b~

In this case, $1 is still the entire URL, $3 is still the bug#, and $5 is still the comment#.

Should be able to test this in JavaScript as such:

    /\b((https?:\/\/)?webkit\.org\/b\/([0-9]+)(\#c([0-9]+))?)\b/
Comment 4 Devin Rousso 2017-03-15 19:40:21 PDT
Created attachment 304598 [details]
Patch
Comment 5 Joseph Pecoraro 2017-05-22 21:02:10 PDT
Comment on attachment 304598 [details]
Patch

This looks good to me. We should rebase this. Sync up with Alexey to ask if there is anything you should do before landing, otherwise this looks good.
Comment 6 Alexey Proskuryakov 2017-05-23 10:27:00 PDT
Yes, please don't land before e-mail discussion is complete.
Comment 7 Devin Rousso 2017-05-23 13:44:49 PDT
Created attachment 311047 [details]
Patch
Comment 8 Joseph Pecoraro 2017-05-24 11:18:40 PDT
Comment on attachment 311047 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311047&action=review

> Websites/bugs.webkit.org/Bugzilla/Template.pm:214
> +    $text =~ s~\b((https?://)?\Qwebkit.org/b/\E([0-9]+)(\#c([0-9]+))?)\b
> +              ~($things[$count++] = get_bug_link($3, $1, { comment_num => $5, user => $user })) &&
> +               ("\x{FDD2}" . ($count-1) . "\x{FDD3}")
> +              ~egox;

Perhaps this should be wrapped in:

    #if WEBKIT_CHANGES
    ...
    #endif

I think ddkilzer knows best here. Otherwise this looks good to me!
Comment 9 Build Bot 2017-05-24 12:45:27 PDT
Comment on attachment 311047 [details]
Patch

Attachment 311047 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3808275

New failing tests:
http/tests/cache/cancel-during-revalidation-succeeded.html
fast/css/target-fragment-match.html
Comment 10 Build Bot 2017-05-24 12:45:28 PDT
Created attachment 311145 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 11 David Kilzer (:ddkilzer) 2017-05-24 13:37:00 PDT
Comment on attachment 311047 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311047&action=review

r=me with adding of a WEBKIT_CHANGES comment.

>> Websites/bugs.webkit.org/Bugzilla/Template.pm:214
>> +              ~egox;
> 
> Perhaps this should be wrapped in:
> 
>     #if WEBKIT_CHANGES
>     ...
>     #endif
> 
> I think ddkilzer knows best here. Otherwise this looks good to me!

Yes, please add a comment, even if it's just this before the new code:

# WEBKIT_CHANGES

This type of comment makes a full-tree diff to upstream lets future mergers know this was an intentional change rather than an accident or a merge artifact.

Note the "#" in Perl is a comment character so the use of #if/#endif is just gratuitous decoration.  :)
Comment 12 Devin Rousso 2017-05-25 10:29:28 PDT
Created attachment 311242 [details]
Patch
Comment 13 WebKit Commit Bot 2017-05-26 13:59:34 PDT
Comment on attachment 311242 [details]
Patch

Clearing flags on attachment: 311242

Committed r217504: <http://trac.webkit.org/changeset/217504>
Comment 14 WebKit Commit Bot 2017-05-26 13:59:36 PDT
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2017-05-30 20:30:33 PDT
<rdar://problem/32479872>