Skip to content

fix(sysext): warn, do not fail, when a pruned payload is not deleted - #105

Merged
bketelsen merged 2 commits into
mainfrom
fix/pruned-delete-warning
Nov 14, 2026
Merged

bketelsen merged 2 commits into
mainfrom
fix/pruned-delete-warning

Conversation

@frostyard-machines

Copy link
Copy Markdown

Summary

Follow-up to #104 (ADR-0019, issue #102).

scripts/delete-pruned-payloads.sh runs after the guarded metadata is live. A pruned payload that it cannot delete (a failed delete-object, an unreadable live manifest, a missing local manifest), or must not delete (a live manifest still lists it), stays in the bucket. That costs storage, nothing else: no manifest lists it, or it is listed and must stay. Until now each such object was ::error:: and the step exited 1, so a publish whose packages and metadata were already live went red.

Now:

  • each such object is a ::warning:: that names the key;
  • after every line was tried, the script prints 1 summary warning (N pruned sysext payload object(s) were not deleted from s3://… (M deleted); …) and appends the same line to $GITHUB_STEP_SUMMARY when it is set;
  • the step exits 0.

Unchanged: a missing input or a malformed pruned-report line still fails the step before any delete, and the delete rule itself (delete only when neither the live nor the local manifest lists the payload) is the same.

Checks

  • make check scope: make verify green locally (tidy, vet, gofmt, lint at the mise pin, docs integrity, unit tests)
  • make ci — make verify vuln test-race build-cross green locally; the Docker-built packages and the integration suite run in CI (no Docker on this host)
  • Generator/scanner/signer changes: n/a (shell script and tests only)

Risk tier

  • Tier 1: Low
  • Tier 2: Moderate
  • Tier 3: High
  • Tier 4: Critical

Rationale: the PR touches the L1 path scripts/delete-pruned-payloads.sh (publication: the pruned-payload delete). Safe: no condition for a delete changes, so no object can be deleted that was kept before; only the exit status and the annotation level of an object that is not deleted change, and input or report errors still stop the step before any delete.

Docs housekeeping

  • ADR-0019 (Status: Proposed) consequence updated; docs/design/ci-cd.md step 10 updated
  • Conformance aliases (ADR-0012) untouched

Verification

  • node scripts/check-docs.mjs green (inside make verify)
  • Tests (internal/releaseasset/sysext_write_guard_test.go): TestDeletePrunedPayloadsWarnsOnDeleteFailure (warning, summary warning, exactly 1 step-summary line, exit 0, object kept; a malformed report still fails and writes no summary), and the refusal cases in TestDeletePrunedPayloadsOnlyAfterMetadataIsLive and TestDeletePrunedPayloadsNeverAfterFailedMetadataWrite now expect a warning and exit 0, with the object kept.
  • Revert test: with the old script, TestDeletePrunedPayloadsWarnsOnDeleteFailure, TestDeletePrunedPayloadsOnlyAfterMetadataIsLive and TestDeletePrunedPayloadsNeverAfterFailedMetadataWrite fail.
  • The tests set GITHUB_STEP_SUMMARY to a temporary file, so a CI run never writes to the job's real summary.

The metadata is already live when the delete step runs, and a pruned payload that stays in the bucket costs storage, nothing else. Each payload the step cannot or must not delete is now a ::warning::, followed by 1 summary warning and 1 line in $GITHUB_STEP_SUMMARY; the step exits 0. A missing input or a malformed pruned-report line still fails before any delete (ADR-0019).
@github-actions github-actions Bot added level:L1 Read every line risk:high Touches a high-risk path (ADR-0068) labels Nov 14, 2026
@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@frostyard-machines

Copy link
Copy Markdown
Author

Cross-review record

  • Reviewer: openai/gpt-6.1-sol (coder: anthropic/claude-opus-5-5)
  • Base: 13037884f27bf6ac3a30bb3bb76f0ed615a98e20
  • Initial review at 771f0b728976499da541813ecfdbe35c61a19b67: Ready, Blocking: none. 1 low, non-blocking finding, fixed: the step-summary append could still fail the step under set -e (unwritable $GITHUB_STEP_SUMMARY). It is now best effort and warns instead.
  • Re-review 1 at d5264eb2f2bf897197f5e49f8452bb6214b05c6f: Ready. Findings: none. Blocking: none.

Tests: TestDeletePrunedPayloadsWarnsOnDeleteFailure (warning, summary warning, 1 step-summary line, exit 0, object kept; an unwritable step summary still exits 0; a malformed report still fails) and the refusal cases of TestDeletePrunedPayloadsOnlyAfterMetadataIsLive and TestDeletePrunedPayloadsNeverAfterFailedMetadataWrite fail with the old script.

Checks: make verify vuln test-race build-cross green locally (no Docker here); CI make ci, pr-triage and codecov/patch green at d5264eb.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 14, 2026
@bketelsen
bketelsen added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 6c6f541 Nov 14, 2026
4 checks passed
@bketelsen
bketelsen deleted the fix/pruned-delete-warning branch November 14, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L1 Read every line ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a high-risk path (ADR-0068)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants