Skip to content

Commit d357b25

Browse files
committed
chore(S02/T05): Harden published smoke cleanup and capture the stale pu…
- scripts/verify-published-release.sh - internal/release/published_release_smoke_contract_test.go - .gsd/milestones/M004/slices/S02/published-release-smoke-evidence.md - .gsd/KNOWLEDGE.md
1 parent b867fa4 commit d357b25

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

internal/release/published_release_smoke_contract_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ func TestPublishedReleaseSmokeContract(t *testing.T) {
150150
"--version <tag-or-latest>",
151151
"--install-kind <all|binary|docker|go-install|brew>",
152152
"--chart-path <path>",
153+
"cleanup() {",
154+
"local exit_code=$?",
155+
"chmod -R u+w \"$WORK_ROOT\" 2>/dev/null || true",
156+
"warning: failed to clean work root %s",
157+
"exit \"$exit_code\"",
153158
"BREW_FORMULA=\"belyaev-dev/homebrew-tap/helmdoc\"",
154159
"brew install \"$BREW_FORMULA\"",
155160
"docker pull",

scripts/verify-published-release.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ MODULE_PATH=$(awk '/^module / { print $2; exit }' "$REPO_ROOT/go.mod")
1313
TMP_ROOT=${TMPDIR:-/tmp}
1414
WORK_ROOT=$(mktemp -d "$TMP_ROOT/helmdoc-published-release.XXXXXX")
1515
GO_WORK_ROOT="$WORK_ROOT/go-install"
16-
trap 'rm -rf "$WORK_ROOT"' EXIT
16+
17+
cleanup() {
18+
local exit_code=$?
19+
chmod -R u+w "$WORK_ROOT" 2>/dev/null || true
20+
if ! rm -rf "$WORK_ROOT"; then
21+
printf 'verify-published-release: warning: failed to clean work root %s\n' "$WORK_ROOT" >&2
22+
fi
23+
exit "$exit_code"
24+
}
25+
trap cleanup EXIT
1726

1827
log() {
1928
printf 'verify-published-release: %s\n' "$*"

0 commit comments

Comments
 (0)