Repository navigation
test(bundle): serve comment.body and label.name absent to drive the '?? ""' folds through dist/index.js - #508
Open
hivecommons-hive[bot] wants to merge 1 commit into
Open
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…?? ""' folds through dist/index.js Every bundle scenario serves body on each listed comment and name on each label object, so the folds that stand in for the REST schema's optional fields never ran through the packed bundle: - src/utils/comments.ts:58 createCommentOnce (comment.body ?? '') - src/plugins/requireMatchingLabel.ts:248 botCommentsWithMarker (comment.body ?? '') - src/issueComment/trigger.ts:181 okToTestOnPullRequest (label?.name ?? '') Four cases drive them: synchronize with a nameless label object next to ok-to-test (runs approved) and alone (no runs read); a bot-applied lgtm with no binding whose only bot comment has no body (stale notice still posted); and labeled kind/bug whose comments hold a bodyless bot comment and a marker comment (only the marker comment deleted). Refs #507 Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
Contributor
|
Please add a kind label with |
This was referenced Oct 18, 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
Files claimed:
__tests__/bundle/absentOptionalFields.test.ts(new, test-only). Functions:src/utils/comments.tscreateCommentOnce(line 58,comment.body ?? ''),src/plugins/requireMatchingLabel.tsbotCommentsWithMarker(line 248,comment.body ?? ''),src/issueComment/trigger.tsokToTestOnPullRequest(line 181,label?.name ?? ''). Nosrc/,dist/or workflow change.The REST schema types
issue-comment.bodyas optional and the object form ofissue.labels[]with an optionalname, but every bundle scenario serves both fields, so atmain@1062ce7npm run test:coverage:e2ereports the three folds with zero hits (coverage-e2e/lcov.info:BRDA:58,2,1,0,BRDA:248,32,1,0,BRDA:181,29,1,0); the unit suite covers all three files at 100 / 100 / 100 / 100.Four cases, each serving the field absent and driving
dist/index.js:pull_requestsynchronizewithlabels: [{ id: 2 }, { name: 'ok-to-test' }]: the nameless object is skipped, theaction_requiredrun on the head is still approved; request sequence asserted.labels: [{ id: 2 }]alone:::debug::trigger: the pull request does not carry ok-to-test, noactions/runsread.pull_requestlabeledlgtmby a bot (no binding) whoseGET /issues/1/commentslists one bot comment with nobody: the label is stripped and the stale-lgtm notice with its marker is posted once (the bodyless comment is not taken as already carrying it); full request sequence asserted.issueslabeledkind/bugwithneeds-kindpresent whose comments list holds a bodyless bot comment (id 11) and the marker comment (id 12):needs-kindis removed and only comment 12 is deleted.Verification (local, this branch, main @ 1062ce7)
npx eslint __tests__/bundle/absentOptionalFields.test.tscleannpx vitest run __tests__/bundle/absentOptionalFields.test.ts: 4 passednpm run test:coverage:e2e: 79 files / 491 tests pass (was 78 / 487); Branches 97.96 % → 98.14 % (1633 → 1636 / 1667);comments.tsandrequireMatchingLabel.tsnow 100 % branches;trigger.ts98.96 % with only line 323 (errorStatus, unreachable through Octokit) leftDisjoint from the open held PRs: #497 (
approve.ts,meow.ts), #498 (tideOptionalFields.test.ts:tide.ts,sweep.ts), #500/#502 (thresholds), #501 (docs YAML), #504 (octokit.ts), #505 (nullIssueUser.test.ts:issueComment/approve.ts,close.ts,reopen.ts).Related Issue
Refs #507 (needs-human: the issue's own item, dropping or v8-ignoring the
getErrorDetailsnon-object arm atauth.ts:24, is a production-code change the quality lane does not PR; this PR lands the folded finding on that issue — the three?? ''folds — and ticks its four boxes)Refs #466 (tracker for every
dist/index.jse2e-coverage finding)Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88