Invalidate cached dependencies on dependency updates #759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #756.
Related to #757 and #758.
Our caching of dependencies is based only on the content of
package.json
. This means that CI is running with versions that were most recent when it was last updated. This PR adds the output ofnpm outdated
to the cache key to invalidate the cache whenever new versions appear.Note that this is still not foolproof:
x@^1.0.0
, the release of[email protected]
will still trigger it, even though we'd only pull the last version of the 1.x series.x@^1.0.0
and[email protected]
already exists,[email protected]
will not trigger it.Despite these flaws, this is probably good enough and better than the current situation. We update
package.json
on every release anyway so we already do notice such breakage eventually. This PR would just make it much more likely that it won't remain undiscovered until the very day of the next release.This becomes more important if we decide to merge #758, because that change would make solc-js automatically switch to new dependencies even if their version indicates they're breaking. We'd need to more actively react by adding an upper limit when that happens.