Repository navigation
test(bundle): drive createCommentOnce's already-carries-marker arm through dist/index.js - #349
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…rough dist/index.js Adds __tests__/bundle/commentOnce.test.ts: both callers of createCommentOnce (the stale-lgtm strip on pull_request labeled, and tide's fork-workflows explanation on the lgtm cron) run against a fake GitHub whose comment listing already carries the marker from a bot, asserting no second comment is posted; plus the counter-case where a human quoting the marker, or a bot marker for another head, does not count. Closes #348 Signed-off-by: quality <quality@hive.kubestellar.io>
|
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 |
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Agreed — 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
Test Improvement
Adds
__tests__/bundle/commentOnce.test.ts(3 tests, new file only — no production,dist/,helpers.ts,fakeGithub.tsor config change), drivingsrc/utils/comments.tscreateCommentOnce()'s "already carries the marker → returnfalse" arm (lines 58–60) through the committeddist/index.jsvia both of its callers:pull_request labeled lgtmby a bot, lgtm not bound (src/plugins/lgtmBinding.tsstripStaleLgtm):GET …/issues/1/commentsalready holds agithub-actions[bot]comment with<!-- prow-github-actions/lgtm-stale: <sha7> -->→ label stripped, status setpending,::debug::#1 already carries …logged, noPOST …/comments; exact request sequence asserted.type: Usercomment, plus a bot marker for a different head → neither counts, the explanation is posted once with the marker.src/plugins/tide.tsexplainForkWorkflows):GET …/issues/2/commentsalready carries<!-- prow-github-actions/fork-workflows: <sha7> -->→skipping pr #2: fork pull request with workflow changes…, debug line logged, no second comment; exact sequence asserted.Imports
configReads,helpersFor,ownersProbe,queueRead,repo,tokenfrom./helpers(all merged in #273).Coverage (
npm run test:coverage:e2e,main@ 3fc21f2, Node v26.10.0, vitest 5.0.3)src/utils/comments.tscreateComment's throw, driven by held #244)Unit coverage of the file was already 100 %; this is end-to-end-only evidence.
Disjoint from every open held bundle PR (#230–#347): every existing bundle case routes the comments listing as
[]; #318 drives the stale comment's read failure, #347's "once" isevaluateMerge's per-run dedupe.npx vitest run __tests__/bundle/commentOnce.test.ts→ 3/3;npx eslintclean;npx tsc --noEmitclean.Related Issue
Closes #348
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1