-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add support to cache on specific json keys #51
Conversation
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.
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.
👏
- package.json#.devDependencies | ||
- package.json#.pnpm.overrides | ||
- yarn.lock | ||
- docker#v3.12.0: |
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.
Might be time to renovate these references 😅
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.
I'll tweak them in a separate PR, too many changes otherwise
README.md
Outdated
@@ -76,6 +76,23 @@ steps: | |||
- /workdir/node_modules | |||
``` | |||
|
|||
It also supports caching on specific JSON keys which can be specified following a `#` character using [jq syntax](https://jqlang.github.io/jq/manual/#object-identifier-index). This requires [jq](https://jqlang.github.io/jq/) to be installed on the build agent. You cannot use this in conjunction with Bash globbing. |
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.
More for our internal understanding, is it worth clarifying
- The implementation matches on the first
.json#
substring, which would be silly to have elsewhere in your file path but is nonetheless possible on Unix systems - A given entry cannot mix globbing and jq paths, but you can do
['**/LICENSE.md', 'package.json#.dependencies']
README.md
Outdated
- command: npm test | ||
plugins: | ||
- seek-oss/docker-ecr-cache#v2.2.0: | ||
cache-on: | ||
- package.json#.dependencies | ||
- package.json#.devDependencies | ||
- package.json#.pnpm.overrides | ||
- yarn.lock |
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.
Would it be useful to list our recommended set of cache keys for a typical pnpm project here?
- command: npm test | |
plugins: | |
- seek-oss/docker-ecr-cache#v2.2.0: | |
cache-on: | |
- package.json#.dependencies | |
- package.json#.devDependencies | |
- package.json#.pnpm.overrides | |
- yarn.lock | |
- command: pnpm install --offline && pnpm test | |
plugins: | |
- seek-oss/docker-ecr-cache#v2.2.0: | |
cache-on: | |
- .npmrc | |
- package.json#.dependencies | |
- package.json#.devDependencies | |
- package.json#.packageManager | |
- package.json#.pnpm.overrides | |
- pnpm-lock.yaml |
Addressing: seek-oss/skuba#1512
Tested on one of my repos:
Cache hit in pipeline while changing package.json
https://github.com/SEEK-Jobs/hirer-budgets/compare/eb9853f8c9cc4aa4939faaf9ca764148dc351aa8...b0d8c4db2e9a6e501a51a52356c41987b1de8b53