Use searchfox for crash callstack source links instead of mercurial
Categories
(Socorro :: Webapp, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: ktaeleman, Unassigned)
References
Details
It would be nice if crash callstacks could show a link to searchfox instead of the mercurial depot.
Use case:
When analyzing crashes, we often look up the code and have to manually search for the code in searchfox to identify:
- potential reasons for the crash (often requires navigating around in the code)
- who changed code recently
- who has contributed to the sourcecode
These are not easy to identify using the mercurial depot site.
Comment 1•6 years ago
|
||
I don't know searchfox enough to know how to figure out what the link scheme should be. Can you provide examples of source links using searchfox?
| Reporter | ||
Comment 2•6 years ago
|
||
@Kats: I think you mentioned that some translation was required in case we want to look up the file at a specific changeset. Could you give some insight here?
Comment 3•6 years ago
|
||
Here is an example URL: https://searchfox.org/mozilla-central/rev/19c23d725f27d0989e4a60f36d64004cebb39736/gfx/layers/apz/src/APZCTreeManager.cpp#82
The hash is the git hash of the change from gecko-dev/cinnabar but if you only have the mercurial hash we could hook up an equivalent /hgrev/<hg-hash> URL endpoint. The bit after the hash is the path and line number of the file in mozilla-central. Searchfox also indexes mozilla-beta, mozilla-release and a few ESR branches (see the "Repositories indexed" list at https://searchfox.org/) and the URLs work similarly.
Comment 4•6 years ago
|
||
I can't spend time on this any time soon. My suggestion is for someone else to prototype this with a Firefox addon. If you need me to make changes to the HTML to make that easier, I can probably do that.
If someone wants to try making changes to Socorro to have both an hg and a searchfox link, I'd be game for reviewing those changes. The code is kind of tangled and hard-coded and all over the place, but the thing that's generate the hg link is roughly here:
Comment 5•4 years ago
•
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.staktrace.com) from comment #3)
but if you only have the mercurial hash we could hook up an equivalent
/hgrev/<hg-hash>URL endpoint.
This was done in bug 1669776.
One idea would be to change settings/base.py from this:
"hg": {
"hg.mozilla.org": (
"https://hg.mozilla.org/%(repo)s/file/%(revision)s/%(file)s#l%(line)s"
)
},
to this:
"hg": {
"hg.mozilla.org": (
"https://searchfox.org/%(repo)s/hgrev/%(revision)s/%(file)s#%(line)s"
)
},
This would work for mozilla-central. For crashes from other branches, e.g. integration/autoland, searchfox does not have the code, and this would generate URLs that 404.
So maybe the vcs_mappings structure needs to be extended to allow for per-repo URLs, not just per-server URLs.
For example:
"hg": {
"hg.mozilla.org/mozilla-central": (
"https://searchfox.org/mozilla-central/hgrev/%(revision)s/%(file)s#%(line)s"
),
"hg.mozilla.org": (
"https://hg.mozilla.org/%(repo)s/file/%(revision)s/%(file)s#l%(line)s"
)
},
and then instead of
link = vcs_mappings[vcstype][server]
you'd do
server_link = vcs_mappings[vcstype][server]
# See if there is a more specific "server/repo" link format.
server_repo_key = "%s/%s" % (server, repo)
link = vcs_mappings[vcstype].get(server_repo_key, server_link)
Comment 6•4 years ago
|
||
I like this idea. Plus we could support multiple urls.
Making it a P2 to do at some point.
Description
•