Skip to content

Update PDF.js to v2.14.137 and improve automation/documentation of process #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2022

Conversation

robertknight
Copy link
Member

Update PDF.js to v2.14.137, matching hypothesis/browser-extension#799 (almost, this update is a few minor updates newer).

The bin/update-pdfjs script has also been updated to improve the documentation on how to run it and auto-commit the results. In particular the comments in the script now note that it should be run via make update-pdfjs rather than being run directly as a user would do in other repositories. This is necessary to set up the Python environment for the bin/create_pdf_template.py script. Auto-committing the result ensures that the PDF.js version number is included in the commit message and the correct directories are committed. A similar change was recently made for the browser extension in hypothesis/browser-extension#799.

This standardizes the commit messages when PDF.js is updated and makes
sure that the version number is included. To do this it was necessary to
build the template as part of the `bin/update-pdfjs` script rather than
do that afterwards.

The instructions for `bin/update-pdfjs` have also been updated to make
it clear that the script needs to be invoked via `make update-pdfjs`
rather than run directly, as is done in other repositories.
Update PDF.js using bin/update-pdfjs.
@robertknight robertknight changed the title Update PDF.js to v2.14.137 and improve automation of process Update PDF.js to v2.14.137 and improve automation/documentation of process Apr 6, 2022
Comment on lines +12 to +14
# 1. Create a new branch and run `make update-pdfjs`. This will download the
# newest release of PDF.js, update the HTML template for the viewer and
# commit the changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little concerned that this script looks so similar to that in other projects that devs might "read past" this different instruction. What "happens" if this script is run directly instead of with make update-pdfjs. Is it possible to build in a safety check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I have pushed a commit that adds a check, using the presence of the TOX_ENV_NAME var to test if the script is being run directly or via tox.

@robertknight robertknight force-pushed the update-pdfjs-apr-2022 branch from 2248566 to 6c66502 Compare April 7, 2022 15:13
@robertknight robertknight requested a review from lyzadanger April 7, 2022 15:15
Copy link
Contributor

@lyzadanger lyzadanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for safeguarding that script!

@robertknight robertknight merged commit cfe6b87 into master Apr 12, 2022
@robertknight robertknight deleted the update-pdfjs-apr-2022 branch April 12, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants