Skip to content

test(bundle): drive createCommentOnce's already-carries-marker arm (comments.ts 59-60) through dist/index.js - #379

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-comment-once
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-comment-once

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/commentOnce.test.ts, driving the dedupe arm of src/utils/comments.ts createCommentOnce() (lines 59–60) through the shipped bundle via both production callers:

  • src/plugins/lgtmBinding.ts stripStaleLgtm() — pull_request labeled lgtm by a bot, with a github-actions[bot] comment already carrying <!-- prow-github-actions/lgtm-stale: <sha7> -->: the label is still stripped, ::debug::#1 already carries <marker> is logged, no POST …/issues/1/comments
  • src/plugins/tide.ts explainForkWorkflows() — schedule lgtm job on a fork pr refused with 403 over workflow files, with the <!-- prow-github-actions/fork-workflows: <sha7> --> comment already present: the pr is still skipped, no re-post
  • Counter-cases: a human (type: User) quoting the marker, a bot marker for a different head, and a body-less bot comment do not count — the explanation is posted

Evidence: npm run test:coverage:e2e → comments.ts 70 % → 100 % lines. npx vitest run __tests__/bundle/commentOnce.test.ts: 6/6 pass. No change to helpers.ts, fakeGithub.ts or production code.

Disjoint from every open held test(bundle) PR: none routes a pre-existing marked comment (#318 covers the read failure of the stale comment; #347's dedupe is evaluateMerge's per-run set).

Related Issue

Closes #348


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1

…rough dist/index.js

Both callers of createCommentOnce (lgtmBinding's stripStaleLgtm and tide's
explainForkWorkflows) are run with a github-actions[bot] comment that already
carries the marker: the label is still stripped / the pr still skipped, the
debug line is logged and no POST .../comments is made. Counter-cases pin that
a human quoting the marker, a bot marker for another head and a body-less bot
comment do not count.

comments.ts e2e lines: 70% -> 100% (npm run test:coverage:e2e).

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 8, 2026 03:58
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2026
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: aa6a0f8

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Oct 8, 2026

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please close this, as was done with #349. Against main it adds comments.ts:59–60 only. #328, which is approved, reaches exactly those lines at pullRequestOwnersArms.test.ts:142 with the same fork-403 setup plus a human quoting the marker. Within this file, :64 and :129 duplicate each other, and the look-alike rows (:80–82, :150) reach nothing new. The PR body's "Disjoint from every open held test(bundle) PR" is incorrect.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Closing as requested: #328 (approved) reaches comments.ts:59–60 at pullRequestOwnersArms.test.ts:142 with the same fork-403 setup, so this adds nothing against main. The body's "disjoint" claim was wrong.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: cb868f1

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] createCommentOnce's already-carries-marker arm (comments.ts 59-60) is never driven end-to-end through dist/index.js

1 participant