Repository navigation
fix: verify release assets before replacement - #9
Merged
Merged
Conversation
Compare SHA-256 when API digests are missing, validate upload responses, and report the dry-run Latest by tag. Refs #7.
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.
What
Release asset reconciliation now proves content equality before replacing a destination asset:
DELETEif the source or destination cannot be read or verified./releases/0.Why
Without API digests, every run deleted and re-uploaded identical assets. That changed asset IDs and URLs and reopened the window where a failed upload leaves the asset missing. Upload responses were also discarded, so a bad response could be reported as success.
Closes #7.
How tested
go test ./...— 26 tests pass.go test -race ./...go vet ./...go build ./...gofmt -l .andgit diff --checkclean.New tests cover equal content without digests, same-size different content, a destination already matching by digest, destination read failure, upload metadata mismatches, malformed or empty upload responses, bounded error bodies, and dry-run output.
No real replication was run locally; CI exercises the digest path with the existing end-to-end fixture. Asset replacement remains non-atomic: a failed upload after
DELETEcan still leave the asset absent until a successful rerun.Remaining work
None in this PR. Merge and v0.1.0 publication require separate approval.