Closed
Bug 1355166
Opened 7 years ago
Closed 6 years ago
Remove remote newtab's dead code
Categories
(Firefox :: New Tab Page, enhancement)
Firefox
New Tab Page
Tracking
()
RESOLVED
FIXED
Firefox 60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: ursula, Assigned: adam.kasztenny)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 4 obsolete files)
53.15 KB,
patch
|
Details | Diff | Splinter Review |
Files found in browser/components/newtab used to belong to the remote newtab project. Since this died we should get rid of the dead code. One approach is what is mentioned in bug 1329955
Comment 1•7 years ago
|
||
As noted in bug 1360316, there was some problems caused by relying on dead code as NewTabPrefsProvider is no longer being `init`ed.
Depends on: 1360316
Updated•6 years ago
|
Keywords: good-first-bug
Comment 2•6 years ago
|
||
See also: https://dxr.mozilla.org/mozilla-central/rev/c38d22170d6f27e94c3c53093215d20255fab27a/browser/base/content/test/static/browser_all_files_referenced.js#93
Assignee | ||
Comment 3•6 years ago
|
||
I'd like to work on this.
Comment 4•6 years ago
|
||
Is there a good way to just remove the "remote newtab" stuff without impacting tiles and activity stream? In particular, both depend on aboutNewTabService but probably not everything in browser/components/newtab https://searchfox.org/mozilla-central/search?q=aboutNewTabService Any good way for Adam to test if things get broken or not when cleaning up?
Flags: needinfo?(usarracini)
Reporter | ||
Comment 5•6 years ago
|
||
Hey Adam, thanks for your interest here. You can delete everything in browser/components/newtab EXCEPT for aboutNewTabService, also delete https://dxr.mozilla.org/mozilla-central/source/browser/base/content/test/static/browser_all_files_referenced.js#93-95, and also delete test_NewTabPrefsProvider.js and test_NewTabSearchProvider.js in browser/components/newtab/tests/xpcshell - that means removing them from xpcshell.ini as well. As a first step, make sure to run the tests in browser/components/newtab/tests to make sure they're still good. If you want to make sure tiles code isn't busted you can run the tests in browser/base/content/test/newtab and make sure they still pass. But really, running it on try is your best bet to make sure nothing is broken. If you don't have try privileges, I can apply your patch and run the test suite to double check. The remote newtab code should be pretty isolated, so nothing should be breaking the new stuff when removed, and as long as you remove all the stuff mentioned above, you should be ok. There's also some content signing stuff that's left over in https://dxr.mozilla.org/mozilla-central/source/dom/security/ContentVerifier.cpp#51, and tests associated with it: https://dxr.mozilla.org/mozilla-central/source/security/manager/ssl/tests/unit/test_content_signing.js#15. This should also be dead code
Flags: needinfo?(usarracini)
Assignee | ||
Comment 6•6 years ago
|
||
Thanks a lot for the information. Does it make sense to run the entire test suite locally before submitting the patch? Or does that take too long? (I'm new here, and I haven't tried running any tests yet)
Reporter | ||
Comment 7•6 years ago
|
||
I wouldn't run the entire test suite locally, that would take much too long! The great thing about try is that you can run it on multiple platforms. I think starting with the tests that I mentioned above is good, and then I can push it to try and see if there's anything else broken :) Have you run tests locally before?
Assignee | ||
Comment 8•6 years ago
|
||
Okay, thanks, I'll do that then. I haven't tried running any tests locally yet.
Reporter | ||
Comment 9•6 years ago
|
||
Here are some docs on running them locally to get you started: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Running_automated_tests You'll mostly be interested in xpcshell tests: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Writing_xpcshell-based_unit_tests and mochitests: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Mochitest
Assignee | ||
Comment 10•6 years ago
|
||
I was able to run tests fine. Everything passed before I started deleting things, and afterwards as well. I ended up deleting: browser/components/newtab/NewTabPrefsProvider.jsm browser/components/newtab/NewTabRemoteResources.jsm browser/components/newtab/NewTabSearchProvider.jsm browser/components/newtab/NewTabWebChannel.jsm browser/components/newtab/tests/xpcshell/test_NewTabPrefsProvider.js browser/components/newtab/tests/xpcshell/test_NewTabSearchProvider.js along with modifying moz.build and xpcshell.ini. However, I'm not sure what to delete from https://dxr.mozilla.org/mozilla-central/source/dom/security/ContentVerifier.cpp (it seems to be used, along with its init method which references newtab) and from the tests, https://dxr.mozilla.org/mozilla-central/source/security/manager/ssl/tests/unit/test_content_signing.js (should I delete every test that makes reference to newtab?). When I'm done, how should I submit my patch? Should I post it here or email it to you? Thanks.
Reporter | ||
Comment 11•6 years ago
|
||
Hey Franziskus, Adam is working on removing some of the leftover dead code for remote newtab, some code was added for Bug 1263793 that can probably be deleted now, including some tests in dom/security/test/contentverifier/. Would you be able to provide Adam some help on what parts can be deleted in ContentVerifier.cpp and which tests to make sure are ok? If it's out of scope for this patch, or a first time contributor, then maybe we can just stick to removing the dead code in browser/components/newtab and file another bug to remove the content signing bits later? What do you think Franziskus? Adam, when you're finished with the patch, submit it as an attachment to this Bug so we can review it and land it for you.
Flags: needinfo?(franziskuskiefer)
Comment 12•6 years ago
|
||
> some code was added for Bug 1263793 that can probably be deleted now, including some tests in dom/security/test/contentverifier/
The tests can definitely be deleted. They are disable anyway.
The only two services (I know of) using content signatures right now are blocklist updates and normandy. They both use the CS service directly. So I think ContentVerifier.cpp can go completely. To make that work there are changes to nsHTTPChannel necessary.
However, before doing that it might be advisable to check whether this is used anywhere else. I don't think it is and a quick check doesn't reveal any callers of LoadInfo::SetVerifySignedContent (and without it content signature verification is not invoked from nsHTTPChannel). The LoadInfo bits can be removed as well then as it can't really be used anymore.
This is touching a couple different parts but I think it's all dead code right now and should probably be removed.
Flags: needinfo?(franziskuskiefer)
Assignee | ||
Comment 13•6 years ago
|
||
Thanks. nsHTTPChannel seems to be still used. What file/function are you referring to when you say "whether this is used anywhere else"?
Assignee | ||
Comment 14•6 years ago
|
||
This patch doesn't include any of the cpp changes.
Comment 15•6 years ago
|
||
> nsHTTPChannel seems to be still used. nsHTTPChannel is our HTTP channel so that won't go away ;) But it calls functions from ContentVerifier.cpp. So you can't remove ContentVerifier.cpp without touching nsHTTPChannel. > What file/function are you referring to when you say "whether this is used anywhere else"? Any public function from ContentVerifier. If it's used in a context that's not protected by the SetVerifySignedContent LoadInfo flag, or the SetVerifySignedContent LoadInfo flag is set anywhere, then it's used. (I don't think that's the case but you should probably double check.)
Assignee | ||
Comment 16•6 years ago
|
||
Thanks. So I should remove the unused functions from ContentVerifier? Ursula, could you please check if any tests are broken as a result of my JS changes in the patch?
Reporter | ||
Comment 17•6 years ago
|
||
Hey Adam, can you rebase this patch on the latest mozilla-central? I'm not getting a clean apply
Assignee | ||
Comment 18•6 years ago
|
||
Yeah, I'll do that.
Assignee | ||
Comment 19•6 years ago
|
||
Assignee | ||
Comment 20•6 years ago
|
||
Okay, the patch should be ready to go now.
Updated•6 years ago
|
Attachment #8951873 -
Flags: review?(usarracini)
Updated•6 years ago
|
Attachment #8949073 -
Attachment is obsolete: true
Reporter | ||
Comment 21•6 years ago
|
||
Try push for the most recent patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bb7cc4c93092b7391daf63e3f5ef3e9d7e8b2c2f If this is green then I'll start the review. Thanks for the rebase Adam!
Reporter | ||
Comment 22•6 years ago
|
||
Adam, you'll need to delete these lines of code: https://dxr.mozilla.org/mozilla-central/rev/c38d22170d6f27e94c3c53093215d20255fab27a/browser/base/content/test/static/browser_all_files_referenced.js#93-95 That will fix some of the initial test failures from the try push.
Assignee | ||
Updated•6 years ago
|
Attachment #8951873 -
Attachment is obsolete: true
Attachment #8951873 -
Flags: review?(usarracini)
Assignee | ||
Comment 23•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Attachment #8952578 -
Flags: review?(usarracini)
Reporter | ||
Comment 24•6 years ago
|
||
Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=59b817676db41111b3e48568b9689018881132fa
Assignee | ||
Comment 25•6 years ago
|
||
I see 3 test failures. Are these all unrelated to my changes?
Reporter | ||
Comment 26•6 years ago
|
||
They don't look related to your changes. I'll have a review for you done today :)
Assignee | ||
Comment 27•6 years ago
|
||
Excellent, thanks!
Reporter | ||
Comment 28•6 years ago
|
||
I think you can remove the remaining file dom/security/test/contentverifier/file_contentserver.sjs. So you can remove the entire folder
Assignee | ||
Comment 29•6 years ago
|
||
Attachment #8952578 -
Attachment is obsolete: true
Attachment #8952578 -
Flags: review?(usarracini)
Attachment #8953296 -
Flags: review?(usarracini)
Reporter | ||
Comment 30•6 years ago
|
||
Comment on attachment 8953296 [details] [diff] [review] Bug 1355166 - Remove remote newtab's dead code r=ursula This looks good to me. We can properly remove ContentVerifier.cpp as a follow up bug, but this is a good start. Thanks!
Attachment #8953296 -
Flags: review?(usarracini) → review+
Reporter | ||
Comment 31•6 years ago
|
||
Can you change the commit message to be: "Bug 1355166 - Remove remote newtab's dead code r=ursula" And we can set check-in needed to land it
Assignee | ||
Updated•6 years ago
|
Attachment #8953296 -
Attachment description: Latest patch, with all of dom/security/test/contentverifier/ deleted → Bug 1355166 - Remove remote newtab's dead code r=ursula
Assignee | ||
Comment 32•6 years ago
|
||
Thanks, I changed the name of the patch. I'll start on the CPP changes.
Reporter | ||
Comment 33•6 years ago
|
||
If you want to make the patch for the cpp changes on this bug, make sure to attach the patch as a separate attachment from the JS changes, and probably ask Franziskus for review on that one.
Assignee | ||
Comment 34•6 years ago
|
||
Yes, I'll be sure to do that.
Assignee | ||
Comment 35•6 years ago
|
||
A few files that I deleted were just changed today: browser/components/newtab/NewTabPrefsProvider.jsm browser/components/newtab/NewTabRemoteResources.jsm browser/components/newtab/NewTabSearchProvider.jsm browser/components/newtab/NewTabWebChannel.jsm
Comment 36•6 years ago
|
||
Looks like bug 1440284. Should still be able to just delete them.
Assignee | ||
Comment 37•6 years ago
|
||
Should the status of this bug be changed to "check-in needed"?
Reporter | ||
Comment 38•6 years ago
|
||
Well that depends, if you want to file the c++ changes in a different bug then yes I can set check-in needed, but I thought you were planning on attaching the changes to this bug? If so we have to wait for all the changes to be ready to land, then change the bug status so both patches can land
Assignee | ||
Comment 39•6 years ago
|
||
Oh okay, I thought it could be done in parts. I'll leave it up to you whether the C++ changes should be done in a different bug or this one. I'm fine either way.
Reporter | ||
Comment 40•6 years ago
|
||
Let's just do them in a separate bug so this can land. I can file it. Thanks!
Reporter | ||
Updated•6 years ago
|
Keywords: good-first-bug → checkin-needed
Assignee | ||
Comment 41•6 years ago
|
||
Thank you!
Reporter | ||
Updated•6 years ago
|
Assignee: nobody → adam.kasztenny
Reporter | ||
Comment 42•6 years ago
|
||
Filed bug 1441989 for deleting ContentVerifier.cpp. And assigned Adam
Comment 43•6 years ago
|
||
This patch fails to apply. Please take a look at it. Thanks! applying 1355166-with-fix-2.patch patching file browser/components/newtab/NewTabPrefsProvider.jsm Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file browser/components/newtab/NewTabPrefsProvider.jsm.rej patching file browser/components/newtab/NewTabRemoteResources.jsm Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file browser/components/newtab/NewTabRemoteResources.jsm.rej patching file browser/components/newtab/NewTabSearchProvider.jsm Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file browser/components/newtab/NewTabSearchProvider.jsm.rej patching file browser/components/newtab/NewTabWebChannel.jsm Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file browser/components/newtab/NewTabWebChannel.jsm.rej patch failed, unable to continue (try -v) patch failed, rejects left in working directory errors during apply, please fix and qrefresh 1355166-with-fix-2.patch
Flags: needinfo?(usarracini)
Keywords: checkin-needed
Comment 44•6 years ago
|
||
Pretty sure the patch needs to be rebased as per comment 36
Flags: needinfo?(usarracini) → needinfo?(adam.kasztenny)
Assignee | ||
Comment 46•6 years ago
|
||
Attachment #8953296 -
Attachment is obsolete: true
Attachment #8954987 -
Flags: checkin?(csabou)
Updated•6 years ago
|
Keywords: checkin-needed
Updated•6 years ago
|
Attachment #8954987 -
Flags: checkin?(csabou)
Comment 47•6 years ago
|
||
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/42c835f417b5 Remove remote newtab's dead code. r=ursula
Keywords: checkin-needed
Comment 48•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/42c835f417b5
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in
before you can comment on or make changes to this bug.
Description
•