Closed Bug 1755434 Opened 2 years ago Closed 2 years ago

Remove debugger devtools-utils package

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(firefox99 fixed)

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

I was poking at how sourcemaps were working between devtools & the debugger, and I think it should be relatively easy to remove devtools-utils.

We can inline the networkRequest helper in devtools-source-map and move the worker helpers as regular devtools modules.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

No significant gain to expect as we are mostly moving things around, but this could reduce the confusion around the debugger.

Comment on attachment 9263918 [details]
Bug 1755434 - [devtools] Add some documentation for debugger bin/bundle artifacts

Revision D138764 was moved to bug 1755529. Setting attachment 9263918 [details] to obsolete.

Attachment #9263918 - Attachment is obsolete: true

As mentioned on Phabricator, the issue with this approach is that bundling the sourcemap-helper & the various debugger workers would depend on a regular DevTools module. This means that whenever we update the module, we should run node devtools/client/debugger/bin/bundle.js.

Without any safeguards, it's very likely we will forget to do that. It could be acceptable if we had a CI job to check if the bundles need to be regenerated.

Unassigning for now, I won't have time to complete this.

Assignee: jdescottes → nobody
Status: ASSIGNED → NEW
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Hubert, Nicolas, just curious to get your feeling about the issue I faced here.

I was trying to remove devtools-utils. Doing that I extracted the worker-related modules to a regular DevTools module called worker-utils. The issue is that the workers built by devtools/client/debugger/bin/bundle.js rely on worker-utils, so each modification to this file means we should regenerate the bundles.

For me that's a deal breaker because I feel like we will forget to update the bundle.

One option would be to add a CI step which runs devtools/client/debugger/bin/bundle.js, then runs hg diff and fails if anything has changed, but I get the feeling it would be flaky?

Another option would be documentation + herald rules to have a mandatory review whenever any file which impacts a bundle is updated.

We can also just postpone this until we have a better idea of what to do with our build steps. I thought it would be an "easy small task while I have to look at source maps" so I don't really have to land this work :)

What do you think?

Flags: needinfo?(nchevobbe)
Flags: needinfo?(hmanilla)

(In reply to Julian Descottes [:jdescottes] from comment #6)

One option would be to add a CI step which runs devtools/client/debugger/bin/bundle.js, then runs hg diff and fails if anything has changed, but I get the feeling it would be flaky?

That kinda look similar to what we do for console stubs, and it could work well as a node test I guess (if we can execute the hg diff from CI)
I don't think it would be flaky, the only file that is modified "randomly" is devtools/client/debugger/bin/module-manifest.json , but I don't think we take advantage of it anywhere, so we can probably remove it.

Flags: needinfo?(nchevobbe)

Oh good point, module-manifest.json was the one I was concerned about, but if we hgignore it we should be fine!

it's added by: devtools/client/debugger/webpack.config.js#27

And given the documentation on recordspath: https://webpack.js.org/configuration/other-options/#recordspath I don't think we have use for it, so we can probably remove the property in webpack.config.js and it should be fine?

As discussed on Slack, it seems webpack.config.js actually brings some persistence to the bundles, otherwise they might significantly differ from one build to another. So let's go ahead and simply ignore this file from the diff.

For the record I have a very dumb test for this: https://treeherder.mozilla.org/jobs?repo=try&revision=cd2076d03e54afb07dde3f024edbf324eaf1b1d7&selectedTaskRun=QdXI2Y6jTMC1uplm5e7Low.0

It's just failing if there is any hg diff output, but that's a start.
In our case a hg status would probably be enough and easier to work with. Just split all the lines, ignore devtools/client/debugger/bin/module-manifest.json (as well as anything outside of devtools).

(clearing the ni for bomsy, I think we have good next steps for now)

Flags: needinfo?(hmanilla)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a81965b4dfa3
[devtools] Remove debugger devtools-utils package r=bomsy
https://hg.mozilla.org/integration/autoland/rev/aeab90b13a07
[devtools] Replace netmonitor duplicated worker-utils with shared worker-utils r=bomsy
https://hg.mozilla.org/integration/autoland/rev/bd9e34c0a3d9
[devtools] Regenerate debugger and source-map bundles r=bomsy
https://hg.mozilla.org/integration/autoland/rev/b6a5caccd1d8
[devtools] Add job to check devtools bundles don't need to be regenerated r=jmaher
Blocks: 1758301
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: