Repository navigation
test(bundle): drive the missing issue/pull number guards of every command handler and onPrLgtm through dist/index.js - #343
Open
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…mand handler and onPrLgtm through dist/index.js Every command handler throws 'github context payload missing issue number' (pull number in cc/uncc, pr number in onPrLgtm) before its first api call when the payload carries no number. The unit suite reaches all 18 guards; the bundle suite never did because every fixture carries a number. Delete issue.number from the issue_comment fixture for each command (and pull_request.number from the synchronize payload for the lgtm job) and assert the guard's message reaches core.setFailed, with no api request for the hand-written commands that read nothing before the guard. Closes #342 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 6, 2026
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
__tests__/bundle/missingNumberGuards.test.ts(27 tests), driving throughdist/index.jsthe one arm every command handler shares and no bundle fixture had ever reached: thegithub context payload missing issue numberguard (pull numberincc.ts/uncc.ts,pr numberinonPrLgtm.ts) thrown before the first API call.Claimed ground — exactly these 18 statements, all at 0 end-to-end hits on
main@ 3fc21f2 and still at 0 after overlaying every open hold-gated bundle PR (#242–#341):src/issueComment/{assign.ts:29, unassign.ts:25, cc.ts:26, uncc.ts:25, approve.ts:44, retitle.ts:26, close.ts:24, lock.ts:33, reopen.ts:21, milestone.ts:28, meow.ts:35, trigger.ts:207 (prepare)},src/labels/{remove.ts:25, hold.ts:30, lgtm.ts:39, fixed.ts:70, prefixed.ts:146},src/pullReq/onPrLgtm.ts:19./assign /unassign /cc /uncc /approve /retitle /remove /hold /lgtm /close /lock /reopen /milestone /meow /retest /help /kind: anissue_commentpayload withissue.numberdeleted exits 1 andcore.setFailedcarrieserror handling issue comment: Error: github context payload missing issue|pull number: [object Object]./assign /cc /retitle /close /lock /reopen /milestone /meow /retest): the fake GitHub receives no request.jobs: lgtmon apull_requestsynchronizepayload withpull_request.numberdeleted fails witherror handling pull request: Error: github context payload missing pr number.Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:src/77.9 % → 79.16 % lines; all 18 listed statements go from 0 to ≥1 hits. The file passes against both the committeddist/index.js(npx vitest run __tests__/bundle/missingNumberGuards.test.ts) and the source-mapped coverage bundle;eslintandtsc --noEmitclean. Nosrc/,dist/or workflow changes.Related Issue
Closes #342
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1