Skip to content

test(bundle): drive lgtmBinding's failure arms and /lgtm cancel's failed reads and writes through dist/index.js - #318

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-lgtm-binding-arms
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-lgtm-binding-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one file, __tests__/bundle/lgtmBindingArms.test.ts (8 tests), which runs the shipped dist/index.js against the fake GitHub API for the failure arms of src/plugins/lgtmBinding.ts and src/labels/lgtm.ts that no bundle suite reached:

  • /lgtm by a member reviewer when POST /statuses/{sha} answers 500: refused with could not bind lgtm to … (not the 403 permission hint), no label applied, and the post-command sweep still runs; and the same when the refusal comment itself fails (both errors logged, run fails)
  • /lgtm cancel when GET /issues/1 fails and when DELETE /issues/1/labels/lgtm is refused: run fails naming the step, head never unbound
  • pull_request labeled lgtm by a human when GET /commits/{sha}/status answers 500 and 403: run fails naming the read (403 names statuses: write), nothing merged or stripped
  • pull_request labeled lgtm by a bot when the stale-lgtm comment read fails: label stripped, status set pending, the comment failure is a warning, run passes
  • pull_request labeled lgtm on a payload with no pull_request.head: run fails, no status written

No production code, dist/, helpers.ts, fakeGithub.ts or config changes.

Coverage (npm run test:coverage:e2e, main @ 3fc21f2)

file before after
src/plugins/lgtmBinding.ts 88.63 % lines 100 % lines
src/labels/lgtm.ts 88.88 % lines 97.77 % lines (39, the missing-issue-number guard, is unreachable from handleIssueComment)

Disjoint from the open bundle PRs: #289 routes only a successful prow/lgtm status read, #310 covers handlePullReq's jobs input (onPrLgtm), #246 holds helpers.ts/bundle.test.ts — none of them drive these arms.

Related Issue

Closes #317


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

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

…led reads and writes through dist/index.js

Adds __tests__/bundle/lgtmBindingArms.test.ts, which runs the shipped bundle
against the fake GitHub API for the arms the e2e suite never reached:

- /lgtm when POST /statuses/{sha} fails with 500 (refused, no label, the
  sweep still runs), and when the refusal comment fails too
- /lgtm cancel when the labels read fails and when the removal is refused
- pull_request labeled lgtm when GET /commits/{sha}/status answers 500 or
  403 (the 403 names statuses: write), when the stale-lgtm comment read
  fails (stripped, warned, run passes), and on a payload with no head

e2e lines (npm run test:coverage:e2e): src/plugins/lgtmBinding.ts
88.63% -> 100%; src/labels/lgtm.ts 88.88% -> 97.77%.

Closes #317

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 5, 2026 03:17
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 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.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

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

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] lgtmBinding.ts failure arms and /lgtm cancel failures are never driven through dist/index.js

0 participants