-
Notifications
You must be signed in to change notification settings - Fork 40
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
Files restored using restore_keys dont trigger upload at the end #44
Comments
Hey @ryangraham-ge! When you say:
I think we've a bug there. Will look ASAP and get back to you for this case. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We want to manage caching of the
.eslintcache
file in nodejs projects. Its different because its a file that isnt committed because it causes merge conflicts.In the pre-hook, we'd like buildkite to load the most recent version. And on post-hook, we want to upload the new version (ideally only pushing if the file changed).
We've tried a few different setups, and this is the closest to what we want:
Expected processing
222
. A cache currently exists for commit id111
. The app workdir is/app
.222
). There should be no match, so we use restore-keys to load a previous cache.111
,v1-cache-eslint-111.tar
available.v1-cache-eslint-111.tar
is loaded into the workdir to/app/v1-cache-eslint-111.tar
and extracted.yarn lint
. This looks at the extracted.eslintcache
file, uses it to speed up the lint command, and slightly updates the.eslintcache
to match the current files in the app.222
,/app/v1-cache-eslint-222.tar
. The file doesnt exist. So we compress the local.eslintcache
into a tar with that name, and upload it to s3.Actual processing
v1-cache-eslint-111.tar
file is pulled, but saved locally as/app/v1-cache-eslint-222.tar
. This makes step 6 believe we dont have any updates, and therefore ignores the upload.Workaround
We can force this to work as we'd like by changing the linting step from
yarn lint
toyarn lint && rm v1-cache-eslint-*
. This will force step6 to not see any existing cache, and therefore upload the new version. But it feels a little hacky to us.The situation seems to be caused by the TAR_FILE var being overwritten in https://github.com/gencer/cache-buildkite-plugin/blob/master/lib/backends/s3.bash#L89, and I dont think its intentional behavior. What are your thoughts?
The text was updated successfully, but these errors were encountered: