Tests: end-to-end test for the force-merge-on-MAX_ROUNDS path #140
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a developer, I want an integration test that drives
handleChangesRequested → guardAuthorDispatch → dispatchMerge({ force: true })end-to-end so that regressions in the MAX_ROUNDS terminator (#137) are caught at commit time instead of in production.Context
PR #137 added the auto-force-merge behavior: on the reviewer's 3rd REQUEST_CHANGES, the address-review dispatch is skipped and a force-merge is dispatched to boss instead. Coverage today:
src/review-loop.test.ts— unit test forguardAuthorDispatch. AssertsforceMerge: true, reason contains "force-merging", comment body. Good.handleChangesRequested(repo, pr)with a reviewer mock returningMAX_ROUNDSREQUEST_CHANGES, and asserts:dispatchMergewas called with{ force: true }"⚠️ FORCE MERGE — review-loop terminator"(the prefix string defined inwebhook-ci.ts)Without this test, someone refactoring the handler could drop the
cap.forceMergebranch and only the operator would notice (via a stuck PR on the next runaway review loop).Acceptance criteria
Test file
src/webhook-handlers.test.ts(or a newforce-merge.integration.test.tsif cleaner) titledhandleChangesRequested MAX_ROUNDS force-merge path.GET /pulls/:n— mergeable: trueGET /pulls/:n/reviews—MAX_ROUNDSREQUEST_CHANGES reviews by reviewerPOST /issues/:n/comments— accept (for the capped-auto-merge comment)handleChangesRequested(repo, pr); asserts:taskstring starts with the FORCE MERGE prefixPre-force-merge path test (negative)
Out of scope
handleChangesRequested's unit tests).References
src/review-loop.ts::guardAuthorDispatch,src/webhook-ci.ts::dispatchMerge,src/webhook-handlers.ts::handleChangesRequested.src/review-loop.test.ts::guardAuthorDispatch.src/webhook-ci.ts— "⚠️ FORCE MERGE — review-loop terminator".Dependencies
main.