Closed Bug 665986 Opened 13 years ago Closed 13 years ago

rewrite codebases.php to be less verbose (fix vcsMappings)

Categories

(Socorro :: General, task, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rhelmer, Assigned: rhelmer)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 2 obsolete files)

codebases.php defined a vcsMappins array which looks like this:

    'hg' => array(
        'hg.mozilla.org/camino' =>
            'http://hg.mozilla.org/camino/annotate/%(revision)s/%(file)s#l%(line)s',
        'hg.mozilla.org/mozilla-central' =>
            'http://hg.mozilla.org/mozilla-central/annotate/%(revision)s/%(file)s#l%(line)s',
        'hg.mozilla.org/releases/mozilla-1.9.1' =>
            'http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/%(revision)s/%(file)s#l%(line)s',
...

It is occasionally updated manually such as bug 649418.

Since these all follow the same pattern, we should have that as a hardcoded default and allow overriding instead.
I actually think we should just make it smarter. Maybe just drop CVS support, and add built-in support for hgweb, so that we take:
hg:<repo>:<path>:<changeset> -> http://<repo>/<annotate/<changeset>/<path>
(and tack on the #l<line> at some point).

It'd probably be trivial to add equivalent built-in support for gitweb too, if someone wanted it.
Attached patch use the same pattern for all hg repos (obsolete) β€” β€” Splinter Review
Ted I think we are pretty much in agreement, but I decided to respond with a patch instead :) I think we can get to the goal of not having to touch codebases.php anymore with a very small change.

This simply splits out the repo from the server, so we can build all the links from one pattern. Leaves CVS support etc. in place, at least for now.

codebases.php should not need any updates for new repos if we do something along these lines.
Attachment #541086 - Flags: review?(bsavage)
This sounds reasonable, just one possible bug I see in your patch. You probably need to pass a limit of 2 to explode, so that this doesn't break repos like /releases/foo.
Assignee: nobody → rhelmer
Attached patch use the same pattern for all hg repos (obsolete) β€” β€” Splinter Review
Oops use the correct/tested patch
Attachment #541086 - Attachment is obsolete: true
Attachment #541092 - Flags: review?(bsavage)
Attachment #541086 - Flags: review?(bsavage)
Thanks Ted, right you are. Tested this with repos of the form:
hg.mozilla.org/blah
hg.mozilla.org/projects/blah
Attachment #541092 - Attachment is obsolete: true
Attachment #541094 - Flags: review?(bsavage)
Attachment #541092 - Flags: review?(bsavage)
Fixing this is necessary to get linking working for builds from mozilla-releases. Any chance you can look at this patch soon bsavage? It looks good to me.
Target Milestone: --- → 2.1
Priority: -- → P1
Can we get a review on this or bounce this to someone else? The broken stacks are a serious productivity loss for people who have to look at them.
Summary: rewrite codebases.php to be less verbose → rewrite codebases.php to be less verbose (fix vcsMappings)
Comment on attachment 541094 [details] [diff] [review]
address ted's concern in comment 3

A stroke of genius. r+ from me.
Attachment #541094 - Flags: review?(bsavage) → review+
(In reply to comment #11)
> Comment on attachment 541094 [details] [diff] [review] [review]
> address ted's concern in comment 3
> 
> A stroke of genius. r+ from me.

Let's not get carried away :P Thanks for the review.

Landed on trunk:
Committed revision 3268.

I've added this bug to today's status meeting discussion, so we can figure out how soon this will get deployed https://wiki.mozilla.org/Breakpad/Status_Meetings/2011-July-06
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Blocks: 662680
Blocks: 644448
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [qa-]
Component: Socorro → General
Product: Webtools → Socorro
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: