Repository navigation
fix(bin): accept HTTP 200 and 201 from ack receipt and close calls - #11
Merged
Merged
Conversation
A live smoke test found the ack path failing after it had already posted the receipt and closed the issue: Forgejo returns 201 (Created) for the receipt POST and may return 201 for the issue-close PATCH, while the script accepted only 200. Treat both 200 and 201 as success on both calls; no other behavior changes. Extend the colocated tests with a 201-on-both-calls case and a fake-close-code override.
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.
Intent
Fix bin/fm-forge-mail.sh ack path to treat HTTP 200 and 201 both as success on the receipt-comment POST and issue-close PATCH (Forgejo returns 201), with colocated test coverage; same change as PR 11
What Changed
bin/fm-forge-mail.sh, so Forgejo's 201 responses no longer fail the ackFM_FAKE_CURL_CLOSE_CODEoverride to the fake curl harness intests/fm-forge-mail.test.shtest_ack_accepts_201_from_comment_and_close) verifying the ack succeeds when both calls answer 201 and still posts the receipt and closeRisk Assessment
✅ Low: The change is a minimal, correct widening of two status-code checks to the documented success codes on exactly the two calls the intent names; fail-closed behavior, response-body state verification, and all other checks are preserved, and the new test exercises the public interface and fails before the fix; the only note is a one-cell test-coverage gap.
Testing
No testing was performed in this correction-only turn (no tools, commands, or product runs were permitted). The only known scenario, driving the fm-forge-mail ack status-code path via the real bin/fm-forge-mail.sh, is downgraded to untested because the supplied validation error does not preserve its live flag or evidence. A fresh live run with recorded command output is required to re-establish a pass or fail.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-forge-mail.test.sh:639- The source change makes a comment-POST HTTP 200 a newly accepted success code (bin/fm-forge-mail.sh:664 previously rejected 200 via[ "$code" != 201 ]), but no test pins it: the new test and all pre-existing ack tests drive the POST with 201 (the fake default at tests/fm-forge-mail.test.sh:85) or 500, so reverting the POST check to 201-only would still pass the suite. The intent's "colocated test coverage" covers the 201-on-close regression (the new test does fail before the fix via the old[ "$code" != 200 ]close check), leaving only this one cell unpinned. Remedy: drive one ack test (e.g. test_ack_posts_receipt_then_closes or the new test) with FM_FAKE_CURL_COMMENT_CODE=200.No tests executed in this correction-only turn (no tools, commands, or product runs were permitted); the prior claimed live run of bin/fm-forge-mail.sh (real curl, secret-tool, TLS) is not preserved in the supplied evidence and is not claimed as tested here✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.