-
Notifications
You must be signed in to change notification settings - Fork 80
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
Please consider using several partial keys in restore_cache #63
Comments
I would just add the |
Yes, unfortunately, because caching is achieved via CircleCI config and is not "programable", it would be difficult to support multiple cache keys via an orb. The addition of In semi relation, I have also opened this feature request for CircleCI to allow more programmatic access to cache and artifacts. Please feel free to vote here: https://ideas.circleci.com/api-feature-requests/p/programmatic-cache-and-artifact-access |
I think it's quite easy to support the partial keys, what's more difficult is to make it configurable :-) But not sure there's a downside in having it all the time. |
Yeah, sorry, could you clarify that point, @KyleTryon? I don't see why this feature request would imply any special programmatic access to caches. The proposal as I understand it is to apply partial cache restoration as recommended by CircleCI. Having partial cache restoration all the time would break NPM users without a lock file as well as NPM users on version 4-. That being said, I don't personally feel there is a need for this feature being configurable at least in its first iteration since the command can inspect the presence of a lock file and |
It looks like we could enable this as non-configurable. |
Have a solution prepared: #83 |
Also drop link to <CircleCI-Public/node-orb#63>: the issue has been resolved, but there still isn't a partial restore key without the branch name when include-branch-in-cache-key is enabled.
* ci(circleci): fix Node versions to 16 (LTS), rather than 17 This avoids the following Yarn / Node 17 regression: [Bug?]: node17 compat: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close #3597 <yarnpkg/berry#3597> (This has already been fixed in newer Yarn, but we want to stick to the LTS anyway.) * ci(circleci): update circleci/node orb, and use new yarn-berry support Also drop link to <CircleCI-Public/node-orb#63>: the issue has been resolved, but there still isn't a partial restore key without the branch name when include-branch-in-cache-key is enabled.
Describe Request:
It is very common, and actually recommended in the CircleCI documentation, that we specify several keys in
restore_cache
, so that the cache can be reused and primed even if the underlying lock files change.For example, Here is a real-life configuration from my project:
Saving is:
Restoring is:
But this isn't what the orb is doing:
node-orb/src/commands/install-packages.yml
Lines 62 to 67 in a8e4186
node-orb/src/commands/install-packages.yml
Lines 100 to 105 in a8e4186
Is there a drawback to always doing this? Or should we make this a configuration option?
I'd be happy looking at this if there is consensus about it.
Thanks!
The text was updated successfully, but these errors were encountered: