fix(sail): fail archive action on tar errors#110
Merged
Conversation
ALX99
marked this pull request as ready for review
July 23, 2026 23:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem and impact
The Sail
archiveaction pipestarintozstdwhile enabling only Basherrexit. Pipeline status therefore comes fromzstd, nottar. If an input disappears, is unreadable, or otherwise makestarfail,zstdcan still successfully compress the partial stream. The action then exits 0 and leaves a valid-looking but incomplete or empty.tar.zstfile.Reproduction and observed result
Validated against untouched
mastercommita7005ced78ddfcb7dc70e17a1fe29b88ecadc667using the exact current.config/sail/actions/archivein an isolated temporary directory.Observed with GNU Bash 5.2.37, GNU tar 1.35, and zstd 1.5.7:
Expected: a nonzero status and no archive output.
Root cause and fix
set -edoes not make a failing non-final pipeline command determine the pipeline status. The fix enablespipefail, sotarfailures propagate, and installs a top-levelERRtrap that removes the selected output name if either pipeline command fails. The trap is cleared after a successful archive.Validation commands and results
The same reproduction against the fixed script produced:
A nearby successful case still created an archive containing:
The following checks passed:
Scope and risk
Only
.config/sail/actions/archivechanges: three additions and one replacement. Archive naming, timestamp collision behavior, input ordering, tar format, zstd settings, and successful output remain unchanged. No tests, fixtures, temporary harnesses, generated files, dependency changes, credentials, or unrelated edits are committed.A direct fresh clone was attempted but the sandbox could not resolve
github.com; the branch was created from the verified currentmasterSHA through the GitHub integration, and reproduction used the exact connector-fetched parent and committed file contents.