Update pdf.js through updatebot
Categories
(Firefox :: PDF Viewer, task)
Tracking
()
People
(Reporter: marco, Assigned: tjr)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Currently pdf.js update is a tedious manual process. It would be nice to instead automate it with updatebot.
We might want to run try pushes periodically to ensure things are working well, but then only open a bug on a tag or on a less frequent cadence
From Brendan:
The current process is pretty hacky, but here are my steps:
In pdf.js github repo
- git reset --hard && git remote update && git checkout upstream/master && npm install && gulp mozcentral && node ~/projects/utils/update_pdfjs.js
- generate release notes for bugzilla: python ~/projects/utils/release.py -n 8 XXX (where XXX is the last github pull request number that went into the previous release)
- for testing I usually just run ./mach build && ./mach mochitest toolkit/components/pdfjs/test/ && ./mach mochitest browser_parsable_css.js
The two scripts can be found in https://drive.google.com/drive/folders/1Tv82Ubbcb2TBI3qWdgiqUdeJU_OaWxwm?usp=sharing
| Reporter | ||
Comment 1•4 years ago
|
||
Tom, June, is this something you could help with?
| Assignee | ||
Comment 2•4 years ago
|
||
I've started looking at this. The amount of things that happen as part of node install and gulp mozcentral seem pretty substantial. (Including downloading the latest Firefox nightly for some reason?) I'm wondering if there's anyway we can minimize the amount of things that happen there. For example pre-loading all the npm dependencies in the docker image would help....
| Assignee | ||
Comment 3•4 years ago
|
||
Alright, I've gotten it to work successfully, so I think we're in good shape here. Just have to rebase and refine and then figure out what we want to do in terms of frequency.
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1631749
https://treeherder.mozilla.org/jobs?repo=try&revision=c2dfb4c95b52065e8731dd35a4ffbba05c6fe1db
| Assignee | ||
Comment 4•4 years ago
|
||
| Assignee | ||
Comment 5•4 years ago
|
||
Depends on D142366
Comment 6•4 years ago
|
||
(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #2)
I've started looking at this. The amount of things that happen as part of
node installandgulp mozcentralseem pretty substantial. (Including downloading the latest Firefox nightly for some reason?) I'm wondering if there's anyway we can minimize the amount of things that happen there. For example pre-loading all the npm dependencies in the docker image would help....
Firefox is downloaded in order to run some tests.
| Reporter | ||
Comment 7•4 years ago
|
||
(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #3)
Alright, I've gotten it to work successfully, so I think we're in good shape here. Just have to rebase and refine and then figure out what we want to do in terms of frequency.
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1631749
https://treeherder.mozilla.org/jobs?repo=try&revision=c2dfb4c95b52065e8731dd35a4ffbba05c6fe1db
I think the first comment in the bug that updatebot opens looks good. We mainly need the PR title, and it is there (we mention the bug ID linked to the PR in its title, so the autonag bot can mark the update bug as blocking the bugs that are fixed by the PRs part of the update).
For the frequency, does it have to be defined in terms of days or can it be defined in terms of commits/PRs?
| Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Calixte Denizet (:calixte) from comment #6)
(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #2)
I've started looking at this. The amount of things that happen as part of
node installandgulp mozcentralseem pretty substantial. (Including downloading the latest Firefox nightly for some reason?) I'm wondering if there's anyway we can minimize the amount of things that happen there. For example pre-loading all the npm dependencies in the docker image would help....Firefox is downloaded in order to run some tests.
Do those tests need to be run at vendoring time? Are they/can they be run on try?
(In reply to Marco Castelluccio [:marco] from comment #7)
(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #3)
Alright, I've gotten it to work successfully, so I think we're in good shape here. Just have to rebase and refine and then figure out what we want to do in terms of frequency.
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1631749
https://treeherder.mozilla.org/jobs?repo=try&revision=c2dfb4c95b52065e8731dd35a4ffbba05c6fe1dbI think the first comment in the bug that updatebot opens looks good. We mainly need the PR title, and it is there (we mention the bug ID linked to the PR in its title, so the autonag bot can mark the update bug as blocking the bugs that are fixed by the PRs part of the update).
This reminds me that I did not integrate the release.py script to generate a nice commit message. But if what is happening now looks good that is great and less work.
For the frequency, does it have to be defined in terms of days or can it be defined in terms of commits/PRs?
I can fairly easily make it every N new commits. How many commits before an update would you like?
Comment 9•4 years ago
•
|
||
Looking at:
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1631749
I think we must filter out merge PRs: they're useless and they add some noise.
About the frequency: every week if more than 3 commits in the week (except merge).
About running tests: tests are ran on every PR so I think useless to do them one more time.
About the phab commit message, is it possible to keep something like Bug XXX - Update pdf.js to version ${version} (like we've at the end of update_pdfjs.js script) ?
Updated•4 years ago
|
| Assignee | ||
Comment 10•4 years ago
•
|
||
- I've added support for waiting until N new commits have occured and then further support for waiting to satisfy both at least N weeks since the last job and M new commits
- I've excluded merge commits from the count of commits and the bug description
- Changing the commit message (to add the word 'version') is actually more trouble than it seems because the verification script has t be able to parse it; and landing an updatebot bump and the verification script is a flag day type thing - I figured not having 'version' isn't that big a deal?
- Instead of
npm install / gulp mozcentralis there an argument to omit the download of FF Nightly and tests run on it during the vendoring process, so they can just run during PR merging?
But I think we're pretty close.
| Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
| bugherder | ||
Comment 13•4 years ago
|
||
Firefox download is done thanks to:
https://github.com/mozilla/pdf.js/blob/2be19e828fcf9ce7740a2136087da028dff56e00/package.json#L69
so in order to avoid it, passing --ignore-scripts to npm should be enough.
| Assignee | ||
Comment 14•4 years ago
|
||
Okay here is the latest run:
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1631951
https://phabricator-dev.allizom.org/D3289
https://treeherder.mozilla.org/jobs?repo=try&revision=0cfbecb1ce60ae12b6703441082795321f0fbf83
I think this is ready for review
Updated•4 years ago
|
Comment 15•4 years ago
|
||
(In reply to Tom Ritter [:tjr] (sec-approvals paused as we're past last uplift) from comment #14)
Okay here is the latest run:
Looking at that patch, it doesn't appear that the update scripts are able to correctly deal with files being deleted.
Note that as part of the changes in that patch the toolkit/components/pdfjs/content/web/images/toolbarButton-openFile.svg file should have been removed, since it's no longer being included when the gulp mozcentral command is run.
| Assignee | ||
Comment 16•4 years ago
|
||
You're right. I fixed that by being a lot more explicit about what we copy, and for the two directories using rsync's --delete option. Here's a new run:
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1632010
https://phabricator-dev.allizom.org/D3305
https://treeherder.mozilla.org/jobs?repo=try&revision=f2fb80fcf37b2b87816eeb24844082980fdb070d
Comment 17•4 years ago
|
||
Is it a bot error: https://bugzilla-dev.allizom.org/show_bug.cgi?id=1632010#c1 ?
| Assignee | ||
Comment 18•4 years ago
•
|
||
(In reply to Calixte Denizet (:calixte) from comment #17)
Is it a bot error: https://bugzilla-dev.allizom.org/show_bug.cgi?id=1632010#c1 ?
No; but it can be improved.
- Updatebot will attempt to edit moz.build files when it add/removes files from the repository. It is somewhat successful in doing that, depending on the complexity of the moz.build file. If it cannot figure it out, it will report a warning and put the entire contents of the command into a comment. The relevant line is
Could not remove toolkit/components/pdfjs/content/web/images/toolbarButton-openFile.svg from the appropriate moz.build file - The entire output of the update script is included in that comment.
I can improve this by making the rsync commands quiet (so we don't see the files it copies) or since it looks like pdf.js moz.build file isn't really going to change based on pdfjs updates, I can just tell it to skip the moz.build editing step. (I edited the patch to do the latter)
Comment 19•4 years ago
|
||
Would it be possible to use this set of tests for the try:
https://hg.mozilla.org/try/rev/07f31fe1578e0cb1bd266209d43b9a202714e5f6
And is there a way to trigger a release ourselves ?
Comment 20•4 years ago
|
||
without this test:
https://hg.mozilla.org/try/rev/07f31fe1578e0cb1bd266209d43b9a202714e5f6#l1.39
there is no need to have a pgo build.
| Assignee | ||
Comment 21•4 years ago
|
||
This try run https://treeherder.mozilla.org/jobs?repo=try&revision=753229c88319359e7755ae0da965cf294ea8106a encompasses those tests and some additional platforms, does that work?
There is not a way to poke Updatebot to trigger a release currently.
| Assignee | ||
Updated•4 years ago
|
Comment 22•4 years ago
|
||
Is it possible to only run tests with opt and debug builds ?
pdf.js by itself is well-tested upstream and we've only few tests in m-c, so running on every possible builds is almost useless.
| Assignee | ||
Comment 23•4 years ago
|
||
Yes; I've updated the patch to do so.
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 26•4 years ago
|
||
I think we can call this fixed now. Thanks Tom for taking care of this!
Description
•