-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make generation of demo.svg deterministic #625
Conversation
62af2cd
to
c116eaf
Compare
c116eaf
to
fa2b1a4
Compare
@@ -1,11 +1,15 @@ | |||
sudo: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this as it's deprecated according to Travis documentation.
Any news from the maintainers ? |
Unfortunately not. I can't seem to find any trace of their activity on the project over the past 3 weeks. Probably due to it being the summer holiday season, so quite understandable. 🙂 |
thank you! |
You're welcome. 🙂 Happy to see this getting merged! |
While working on #605 we found out that the PR's CI revealed an unexpected diff in
docs/demo.svg
. CI onmaster
looked fine as well but I could reproduce the failure nonetheless locally by runningmake -B docs/demo.svg
.The rootcause is as follows:
The generation of
demo.svg
depends on a Node tool that is installed vianpm install svg-term-cli
. Underneath this thenpm
command performs its own recursive dependency resolution and fetches the latest version (that is compatible with any existing version constraints) of all required direct & indirect dependencies.The latest CI run on
master
dates back to 13/14 July and passed correctly. Since then thesvgo
NPM package, a direct dependency ofsvg-term-cli
, released a new minor version making the most recent version1.3.0
instead of1.2.2
which is still compatible with the>=1.0.3
constraint defined bysvg-term-cli
. The move from1.2.2
to1.3.0
apparently introduced a change that resulted in a diff in the generateddocs/demo.svg
file.The solution here (and which will help prevent this occurring in the future as well) is to fix the versions of all (in)direct dependencies used to install the
svg-term-cli
package.This is achieved by creating a fake NPM package in the
tools
folder using apackage.json
withsvg-term-cli
as a dependency and apackage-lock.json
file to hardcode the required version for each dependency. This also allows us to runnpm ci
instead ofnpm install svg-term-cli
which is designed specifically for the automated runs of a CI environment.This will make the generation of
docs/demo.svg
deterministic and allows the safe upgrade of any of the required package versions in the future via code-reviewed updates to thepackage.json
andpackage-lock.json
files.