Repository navigation
π [fix] hooks: deny editing a posted π approval request - #106
Open
chadhuskops wants to merge 1 commit into
Open
chadhuskops wants to merge 1 commit into
chadhuskops wants to merge 1 commit into
Conversation
- New PreToolUse(Bash) guard `guard-approval-edit.py`: an edit (`--edit-last`, PATCH `issues/comments/<id>`, `updateIssueComment`) whose body keeps `approval-request:` or a π `Reason tag:` is denied; posting a new comment never is - The merge gate refuses an edited request, so the human's `done` was lost (seen in a downstream run) - Wired in settings-snippet.json (on by default); run.md, block-template and the writing standard: post the request once, as the exit's last write; a correction is a new comment - test-guard-hooks.sh gains 14 cases; install/get counts move to 7 guard hooks
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more β On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
This branch has not been deployed
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.
Note
β³ Ready for review Β· β 4/4 AC Β· head
7ae3b8fProblem
approval-request:/Reason tag: β¦ π)super-board-approval.py) refuses an edited requestdoneon edited requests was refused. The rule "never edit a request; post a new one" was in the docs, but nothing enforced itSolution
hooks/guard-approval-edit.py, built likeguard-protected-push.py(same deny format, fails open)gh issue|pr comment --edit-last, PATCHissues/comments/<id>, GraphQLupdateIssueComment) when the new body carriesapproval-request:or a πReason tag:line. Body found inline, in a heredoc, or via--body-file,-F body=@file,--input,$(cat file)or< fileSB_ALLOW_APPROVAL_EDIT=1turns it offhooks/settings-snippet.json(on by default); listed inhooks/README.mdandREADME.md(7 guard hooks)run.md,block-template.md,writing-standard.md: post the request once, as the exit's last GitHub write; a correction is a new commentAcceptance criteria
β³
tests/test-guard-hooks.shΒ· 7 deny casesβ³
tests/test-guard-hooks.shΒ· 7 allow casesβ³
tests/test-install.shΒ· 24 scenariosmainand pass hereβ³
bash tests/test-guard-hooks.shΒ· stops onmain(no hook); 105 cases pass now, on Python 3.7 and 3.12. Guard count intest-get.shis 7; that suite needs network and wasn't run locallyRisk
π’ Low Β· a new deny-only hook.