Repository navigation
[quality] createCommentOnce's already-carries-marker arm (comments.ts 59-60) is never driven end-to-end through dist/index.js #348
Description
Finding
src/utils/comments.ts createCommentOnce() promises "one explanation per fact, however many runs observe it": it lists the issue's comments and returns false without posting when a bot comment already carries the marker (lines 58–60). That arm is the whole point of the function, and both of its callers rely on it on every repeat run:
src/plugins/lgtmBinding.tsstripStaleLgtm()— everypull_request labeled lgtm/ cron pass over a pull request whoselgtmis not bound to the headsrc/plugins/tide.tsexplainForkWorkflows()— every cron pass over a fork pull request GitHub refuses with 403 over workflow files
Yet no bundle suite ever drives either caller with the marker already present, so the shipped dist/index.js has never been observed not re-posting.
Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3):
- Unit:
npx vitest run --coverage→comments.ts100 % statements / branches / functions / lines (__tests__/utils/comments.test.ts). - End-to-end:
npm run test:coverage:e2e(local run, lcov incoverage/lcov.info) →comments.ts70 % lines, uncovered34and59–60. Every existing bundle case routesGET …/issues/N/commentsas[](bundle.test.tsrouteStrip()and the fork-403 case), so the dedupe is never taken. Line 34 (could not add comment) is already driven by held test(bundle): drive /meow through dist/index.js against a stubbed cat api #244 and is not part of this finding. - Checked against all 35 open held bundle PRs (chore(coverage): emit lcovonly and json-summary reporters from vitest.config.mjs #230–test(bundle): drive tide's verdict arms (unknown-retry exhaustion, moved head, 405/409 refusals, merged/closed/locked, check_suite guards, once-per-run) through dist/index.js #347): none routes a pre-existing marked comment; test(bundle): drive lgtmBinding's failure arms and /lgtm cancel's failed reads and writes through dist/index.js #318 covers the read failure of the stale comment, test(bundle): drive tide's verdict arms (unknown-retry exhaustion, moved head, 405/409 refusals, merged/closed/locked, check_suite guards, once-per-run) through dist/index.js #347's "once" is
evaluateMerge's per-run dedupe, not this one.
Priority 2 under the lane's coverage rules: unit-covered, not end-to-end-covered.
Recommendation
- Add
__tests__/bundle/commentOnce.test.tsdriving both callers throughdist/index.jswithGET …/issues/N/commentsreturning agithub-actions[bot]comment that carries the marker: the label is still stripped / the pr still skipped,::debug::#N already carries <marker>is logged, and noPOST …/commentsis made - Counter-case: the marker quoted by a human (
type: User) and a bot marker for a different head do not count — the explanation is posted
Priority
- Impact: medium — a regression here would re-post the same explanation on every cron tick and every re-label, which is user-visible spam; unit tests catch it, the e2e suite would not
- Effort: low — one new bundle file, no harness or
helpers.tschange
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2
— hive: agent=quality backend=copilot model=claude-fable-5.1
Activity
hivecommons-hive commentedon Oct 6, 2026
/kind cleanup
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:3f6238d— hive: agent=quality backend=copilot model=claude-fable-5.1