Skip to content

test(bundle): drive syncApprovalReview's not-open and nothing-to-dismiss short-circuits and withdrawalReason's no-files and lgtm-skip arms through dist/index.js - #363

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-approve-review-short-circuits
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-approve-review-short-circuits

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/approveReviewShortCircuits.test.ts (new file only; helpers.ts, bundle.test.ts, fakeGithub.ts, source and dist/ untouched). Five pull_request_review runs through the committed dist/index.js against the fake GitHub with approve.github_review: true, on a pull request that is not approved — the arms of src/plugins/approveReview.ts the bundle suite never reached:

run expected
the pull request is closed, carries the bot's marked APPROVE review approved removed, ::debug::approve: #1 is not open; its approval review is left alone, no PUT …/dismissals (L156-157)
reviews: a bot review without the marker, a DISMISSED marked one, a user's copy of the marker approved removed, ::debug::approve: #1 carries no approval review to dismiss, no dismissal (L164-165)
GET /pulls/1/files is empty PUT …/reviews/71/dismissals with approved removed: the pull request changes no files (L101)
bob /approve then /approve cancel, carol /lgtm cancel, default config message … withdrawn by bob (/approve cancel) — carol skipped (L111, skip arm)
same comments, approve.lgtm_acts_as_approve: true message … withdrawn by bob (/approve cancel), carol (/lgtm cancel) (L111, counted arm)

Cluster: src/plugins/approveReview.ts syncApprovalReview L156-157, L164-165 and withdrawalReason L101, L111. Disjoint from the held bundle PRs: #286 (approveReview.test.ts) covers the review refusals/failures, draft and already-on-head arms; #333 (approveEvaluationArms.test.ts) covers approve.ts's evaluation arms; #355 the membership-mode issueComment/approve.ts failures. Measured with all 43 open held bundle heads merged onto main, exactly these six lines remained uncovered in this file.

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3)

suite plugins/approveReview.ts lines
unit (npx vitest run --coverage) 100 %
e2e, main only (npm run test:coverage:e2e) 65.38 %
e2e, main + this PR 73.07 %
e2e, main + all 43 held bundle heads 92.3 % (uncovered 101, 111, 156-157, 164-165)
e2e, main + all 43 held bundle heads + this PR 100 % (src/ 96.55 → 96.8 %)

npx eslint __tests__/bundle/approveReviewShortCircuits.test.ts clean; 5 tests, ~1.3 s. Local runs; test.yml has had no push run on main since a270568 (#329), so there is no CI artifact to cite.

Related Issue

Closes #362


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…iss short-circuits and withdrawalReason's no-files and lgtm-skip arms through dist/index.js

Adds __tests__/bundle/approveReviewShortCircuits.test.ts: five pull_request_review
runs through the committed dist/index.js with approve.github_review on, on a pull
request that is not approved, reaching the arms of src/plugins/approveReview.ts
the bundle suite never did: a closed pull request's review left alone (L156-157),
no own approval review to dismiss (L164-165), the 'changes no files' dismissal
message (L101), and /lgtm cancel ignored by default but named under
approve.lgtm_acts_as_approve (L111).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 7, 2026 13:44
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 7, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

build-test on this PR is red for the cause tracked in #294, not for this diff.

Evidence from run 37630955179 (head 482d7e1): all 81 test files / 1644 tests pass; the job exits 1 on the single vitest Unhandled Error assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID") originating in __tests__/issueCommentTest/meow.test.ts (undici pre-connect to the real api.thecatapi.com). The twin push run on the same SHA, 37630215490, is green. This PR touches only __tests__/bundle/approveReviewShortCircuits.test.ts.

Deferring to #294; the durable fix is #287 (held, needs a human to lift the hold). No retrigger will be pushed here.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 7, 2026
@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

1 participant