Closed Bug 1389217 Opened 7 years ago Closed 7 years ago

Support linking to generated source files uploaded to s3 from builds

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ted, Unassigned)

References

Details

In bug 1259832 I'm making Firefox builds upload source files that were generated during the build to a public S3 bucket. Currently when these source files show up in crash stacks we just get broken links. Once the patches for that bug lands we'll get filenames that look like: s3:gecko-generated-sources:ef250c60128260894400275afac2c7372cf4489e7f60e6dcf7c54ec25152b2fb95483e4fcfedc56419927548cdf4907d8d0e8f6295bf8d9cf5a6ab20d1ae613f/accessible/xpcom/xpcAccEvents.cpp: (the hex string is the SHA-512 digest of the contents of the file) We should be able to support this by adding a new entry to the existing `VCS_MAPPINGS` config: https://github.com/mozilla-services/socorro/blob/7fb3759c6d7c78e568c389d3adad1d5a4aaf5e84/webapp-django/crashstats/settings/base.py#L205 One quirk is that the files in S3 are just the raw source files, and we expect to have a nice HTML view we can link to so that we can link to the correct line number. To support this I wrote a tiny webapp that uses pygments to format the source file and provide line numbers: https://github.com/luser/source-highlight I stood it up in Heroku, so it looks like this in practice: https://source-highlight.herokuapp.com/https://gecko-generated-sources.s3.amazonaws.com/318c1e8eb64b13914272e71f5c084728437cbe739235e89199ff606667d7f6a80e6e65e1da4a226a24737b4c03cdba307fc820c1a0222e929eb4906aba073e48/dom/bindings/AudioNodeBinding.cpp#l-309 Using that, I think the new entry in `VCS_MAPPINGS` probably should look like: ``` 's3': { 'gecko-generated-sources': ('https://source-highlight.herokuapp.com/https://gecko-generated-sources.s3.amazonaws.com/' '%(file)s#l-%(line)s') }, ```
Got a crash ID I can test this out with? Also, is that Heroku app "solid"? I.e. is it run by the mozilla corp account? Is there desire to port this code into Socorro's webapp? I don't know enough about Flask, but I noticed it's hardcoded `debug=True` in there.
(In reply to Peter Bengtsson [:peterbe] from comment #1) > Got a crash ID I can test this out with? My patches only finally landed and stuck today, so we'll have to wait for tomorrow's nightly to get a useful test crash. > Also, is that Heroku app "solid"? I.e. is it run by the mozilla corp > account? Is there desire to port this code into Socorro's webapp? I don't > know enough about Flask, but I noticed it's hardcoded `debug=True` in there. It's not in the Mozilla Heroku account, but I can move it there! I was going to run that by you and see what you thought--I am not attached to it being a standalone thing, and the only place that really needs it is Socorro, so if you'd rather just have this be a view in the Socorro app itself that is A-OK with me. I just stood that up as a simple proof-of-concept to try it out.
PR https://github.com/mozilla-services/socorro/pull/3931 actually applies this new VCS_MAPPING setting. Links work now in the report index. (only tested locally) However, I'm not convinced about this new Heroku dependency so let's move that to a new discussion.
Commit pushed to master at https://github.com/mozilla-services/socorro https://github.com/mozilla-services/socorro/commit/f2852740b1a3112cdf65f223a9489a5de5b67df7 fixes bug 1392236, 1389217 - ValueError in enhance_json_dump (#3931) * fixes bug 1392236, 1389217 - ValueError in enhance_json_dump * Implement highlight_file view This internalizes the source-highlight system that Ted wrote here: https://github.com/luser/source-highlight/ * right source * its own app
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.