Skip to content
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

Do not upload an empty tarball #11

Merged
merged 4 commits into from
Jun 2, 2023
Merged

Conversation

paymand
Copy link
Contributor

@paymand paymand commented Jun 1, 2023

Change

Make sure we do not upload an empty tarball to S3.

Example build when node_modules folder doesn't exist: https://buildkite.com/peakon/backoffice-browser-tests/builds/532#018875e0-be0d-4b57-b05b-fd5707ca50d0/329-334

Uploading new cache for key: v2-node-modules-c81a986317355c12556a1aad2700cfb046285f61
tar: node_modules: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Failed to upload new cache for key: v2-node-modules-c81a986317355c12556a1aad2700cfb046285f61

Problem / Why

There's bug in the plugin where when tar -cz ... fails, for instance when we have a non-existing path, since we are using --ignore-failed-read we end up creating and uploading an empty tarball.

Example build when node_modules folder doesn't exist:
https://buildkite.com/peakon/backoffice/builds/3230#018875d5-f91c-4714-b961-a1deec8f2fb0/383-388

Uploading new cache for key: v2-node-modules-c81a986317355c12556a1aad2700cfb046285f61
tar: node_modules: Warning: Cannot stat: No such file or directory
Uploaded new cache for key: v2-node-modules-c81a986317355c12556a1aad2700cfb046285f61

Here we uploaded an empty tarball 🐛

References

@paymand paymand changed the title Payman/fix empty tarball bug Do not upload an empty tarball Jun 1, 2023
@paymand
Copy link
Contributor Author

paymand commented Jun 1, 2023

mmm, unit tests pass for me locally: 😢
image

@paymand paymand requested a review from threesquared June 2, 2023 10:47
@paymand paymand merged commit 05de2f9 into master Jun 2, 2023
@paymand paymand deleted the payman/fix_empty_tarball_bug branch June 2, 2023 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants