Surface the Forge API response in the tag_deploy Forge step - #44
Conversation
curl --fail discards the response body, so a failed publish reports only an HTTP status (the simp-gpasswd 2.0.0 release died with a bare 403). Capture the body and status, print both, and fail on any non-2xx result so the Forge's own error message lands in the job log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCnDsYaJDLiP8z8tafz9Tp
Mirrors #44 so the two branches merge cleanly in either order. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCnDsYaJDLiP8z8tafz9Tp
A failed Forge upload previously left nothing to download - the tarball existed only on the runner and the GitHub release carries no assets. Upload it before attempting the Forge POST so every tag run, pass or fail, leaves the exact archive available from the run page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCnDsYaJDLiP8z8tafz9Tp
|
Added a second robustness improvement prompted by the gpasswd post-mortem: the built module archive is now uploaded as a workflow artifact before the Forge POST, so every tag run — pass or fail — leaves the exact tarball downloadable from the run page (previously a failed upload left nothing: no artifact, and the GitHub release carries no assets). Mirrored to #42 as before. |
Release assets are permanent and publicly downloadable, unlike workflow artifacts (authenticated, expiring). Uploaded before the Forge POST so a failed publish still leaves the exact archive on the release. --clobber keeps job re-runs idempotent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XCnDsYaJDLiP8z8tafz9Tp
|
Third improvement: the module archive is now also attached to the GitHub release ( |
hcaballero2
left a comment
There was a problem hiding this comment.
Skeptical review — I went looking for the usual failure modes in "attach assets + surface API errors" changes and verified the PR's claims against the actual branch contents rather than the description. What checks out:
- Ordering is sound.
deploy-to-puppet-forgehasneeds: [create-github-release], so the release exists beforegh release uploadruns — no race. And attaching before the Forge POST is the right order, not just for evidence-preservation: the inverse order plus a transient attach failure would force a job re-run whose Forge POST would then 409 on the already-published version. - The prerelease claim is accurate: the skip is the job-level
if: needs.create-github-release.outputs.prerelease != 'yes', so the new artifact/attach steps can't run for prereleases (where no non-draft release semantics would apply). - The token claim is accurate:
create-github-releasealready doesgh release createwith the defaultGITHUB_TOKEN, sogh release uploadneeds nothing the workflow doesn't already rely on. actions/upload-artifact@v7is the current major (v7.0.1), andif-no-files-found: errormeans a missing tarball now fails fast at the artifact step instead of producing a cryptic curl--form file=@error two steps later.- The "mirrored to #42" claim is true —
openvox9-ruby4-template-refreshcarries the identical three-step change (verified lines 188/196/202-215 of itstag_deploy.yml). - Error handling holds up at the transport level too: GitHub
run:steps default tobash -e, so a non-HTTP curl failure (DNS, TLS) fails the step at thehttp_code=assignment with--show-erroroutput; thecaseonly needs to cover HTTP-level failures, which is exactly what the old--failwas eating. Failing on 3xx (which--faildid not) is a behavior change, but a correct one for a POST that should never redirect.
Two small suggestions inline; neither blocks.
curl --faildiscards the response body, so a failed Forge publish reports only a bare HTTP status — the simp-gpasswd 2.0.0 release died with an unexplained 403 (valid token, new-module creation refused; the Forge's JSON error would have said why outright).The deploy step now captures the response body and status via
--write-out/--output, prints both, and fails on any non-2xx result. Same upload semantics otherwise (also quotes thefindproperly, replacing the odd''*.tar.gz''quoting).Note for #42: that branch rewrites
tag_deploy.ymlwholesale — I've applied the same step change there so the two merge cleanly in either order.🤖 Generated with Claude Code
https://claude.ai/code/session_01XCnDsYaJDLiP8z8tafz9Tp