fix(bonedigger): cleanup trap returns 0 so report exits cleanly - #889
fix(bonedigger): cleanup trap returns 0 so report exits cleanly#889Xarianne wants to merge 1 commit into
Conversation
8050eeb to
2af8006
Compare
The cleanup() EXIT trap's last statement tested an always-empty OTEL_STDERR, returning 1 and making just report 'recipe report failed with exit code 1' even though ujust report fully succeeds. Append return 0 so the trap can never override a successful exit. Supersedes bonedigger#25, which fixed a dead just/report.just that never propagated to the shipped bonedigger-report. Wires the existing bats test into CI and adds a regression test. Refs: common#655, bonedigger#25, dakota#940 Assisted-by: GLM 5.2 via opencode
2af8006 to
74f9590
Compare
|
Soery for the amends, my agent decided to have an identity crisis and called itself CoPilot and went from following agents.md TO THE LETTER to ignoring it, so was trying to tame it before I posted the PR. |
hanthor
left a comment
There was a problem hiding this comment.
Approving. Correct fix — an EXIT trap handler's return value becoming the script's exit status is exactly the failure mode, and return 0 is the right guard rather than relying on every exit path remembering trap - EXIT. Regression test is well-targeted (extracts cleanup() and asserts status 0), and it's wired into both the Justfile and CI.
The note about the fix having previously landed in the bonedigger repo's stale just/report.just instead of the shipped common script is a genuinely useful post-mortem.
Generated by Claude Code
|
Just saw #895 rewrote bonedigger-report and removed the cleanup trap entirely. Does the exit-code-1 issue still reproduce on main? Happy to close this if superseded. |
|
Sorry I totally stepped on this while revising the report format. It should be much smoother for users though, once we get past this backlog it won't be so hectic, thanks! |
|
That's not a problem at all. Would you like me to close this? :) |
bluefin-common PR
What does this change?
Appends
return 0to thecleanup()EXIT trap insystem_files/bluefin/usr/libexec/bonedigger-reportsoujust reportexits 0 on success instead of 1.Why?
ujust reportfully succeeds (gist uploaded, browser opened) but printsrecipe 'report' failed with exit code 1because the trap's last statement —[[ -n "$OTEL_STDERR" ]] && rm -f ...— returns 1 on an always-empty variable, and the happy path has notrap - EXITto neutralize it.Triggered by dakota#940. This supersedes bonedigger#25, which correctly fixed this in
just/report.justin the bonedigger repo on 2026-06-13. Twelve hours later, bonedigger#26 centralized the report recipe into common assystem_files/bluefin/usr/libexec/bonedigger-reportand deleted the bonedigger copy — but the fix was not re-applied to the new common file, regressing the bug. common#655 stayed closed while the bug returned.PR pipeline
Checklist
fix:,feat:,docs:,ci:,refactor:, etc.)just checkpassespre-commit run --all-filespassesdocs/skills/skill-improvement.md)AGENTS.md/docs/SKILL.md/docs/skills/links remain validgh run list --repo projectbluefin/common --limit 5AI attribution