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
Conversation
…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>
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 Hive will keep the |
Contributor
|
Please add a kind label with |
This was referenced Oct 5, 2026
Open
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.
Test Improvement
Adds one file,
__tests__/bundle/lgtmBindingArms.test.ts(8 tests), which runs the shippeddist/index.jsagainst the fake GitHub API for the failure arms ofsrc/plugins/lgtmBinding.tsandsrc/labels/lgtm.tsthat no bundle suite reached:/lgtmby a member reviewer whenPOST /statuses/{sha}answers 500: refused withcould 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 cancelwhenGET /issues/1fails and whenDELETE /issues/1/labels/lgtmis refused: run fails naming the step, head never unboundpull_requestlabeledlgtm by a human whenGET /commits/{sha}/statusanswers 500 and 403: run fails naming the read (403 namesstatuses: write), nothing merged or strippedpull_requestlabeledlgtm by a bot when the stale-lgtm comment read fails: label stripped, status setpending, the comment failure is a warning, run passespull_requestlabeledlgtm on a payload with nopull_request.head: run fails, no status writtenNo production code,
dist/,helpers.ts,fakeGithub.tsor config changes.Coverage (
npm run test:coverage:e2e, main @ 3fc21f2)src/plugins/lgtmBinding.tssrc/labels/lgtm.tshandleIssueComment)Disjoint from the open bundle PRs: #289 routes only a successful
prow/lgtmstatus read, #310 covershandlePullReq'sjobsinput (onPrLgtm), #246 holdshelpers.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