Skip to content

test(bundle): drive /test and lgtm cancel (/lgtm cancel, /remove-lgtm) through dist/index.js - #240

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-test-command-lgtm-cancel
Oct 2, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-test-command-lgtm-cancel

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/triggerTestAndLgtmCancel.test.ts — a new file only. It reuses fakeGithub.ts and runBundle.ts to spawn the committed dist/index.js and drives the two issue_comment paths the bundle e2e suite never exercised: the /test trigger command (src/issueComment/trigger.ts test()) and lgtm cancel (src/labels/lgtm.ts cancelLgtm() via /lgtm cancel and /remove-lgtm, plus unbindLgtm in src/plugins/lgtmBinding.ts).

14 cases, one describe per path:

  • /test (GITHUB_WORKFLOW=Prow so the Prow run is filtered out of every listing and re-run)
    • no argument and ? → one comment with the run table (CI, Lint, E2E; no Prow), no re-run
    • all → POST actions/runs/1/rerun, POST actions/runs/2/rerun (the two completed runs), rocket reaction, no comment, no sweep
    • LINT (name, case-insensitive) → re-runs 2 only; ci (file stem of ci.yml) → re-runs 1 only
    • e2e (in progress only) → No completed GitHub Actions workflow run on \headsha` matches `e2e`.` + table, no re-run
    • every re-run 409 → … are already being re-run. comment, no rocket, exit 0
    • re-run 403 → comment and ::error:: cannot re-run workflows: grant \actions: write` to the workflow`, exit 1
    • non-member commenter → Cannot /test because Error: stranger is not a org member or collaborator, exit 1, runs never read
    • on a plain issue → `/test` only applies to pull requests. as the only API call
  • lgtm cancel
    • /lgtm cancel by a reviewer on an lgtm'd pr → owners + membership reads, GET issues/1, DELETE issues/1/labels/lgtm, configuration reads, POST statuses/headsha {state: 'pending', context: 'prow/lgtm', description: 'lgtm cancelled by Codertocat'}, then tide's sweep reads the pr, the OWNERS probe and the queue state and logs skipping pr #1: missing lgtm; no merge
    • /remove-lgtm by the pr author → no /orgs/ or /collaborators/ read; the label removed, the pr and its OWNERS context read for the head, the status reset, then the sweep
    • /lgtm cancel with no lgtm label → no DELETE, no status write
    • /lgtm cancel by a non-reviewer non-author → refused, exit 1, nothing removed, no status write

Verified on main @ c48bd6d:

  • npx vitest run __tests__/bundle → 2 files / 102 tests pass (88 existing + 14 new)
  • npx eslint __tests__/bundle/triggerTestAndLgtmCancel.test.ts clean
  • unit coverage unchanged (All files 99.83 | 98.35 | 100 | 99.82); this adds e2e coverage only

Disjoint from every open hold-gated PR: #236 edits one line of bundle.test.ts, #238 adds collaborationCommands.test.ts (/cc /uncc /unassign /retitle /lock /reopen); none of #217, #219, #221, #223, #225, #227, #229, #230, #232, #234 touch __tests__/bundle/. This PR creates one new file and edits nothing existing.

Related Issue

Closes #239


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

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

…) through dist/index.js

Adds __tests__/bundle/triggerTestAndLgtmCancel.test.ts, a new file that
reuses fakeGithub.ts and runBundle.ts to spawn the committed bundle for
the two issue_comment paths the e2e suite never exercised:

- /test: run table for no argument and ?, all, name and file matching,
  the no-match comment, 409 already-re-running, 403 actions: write
  refusal, non-member refusal, and the non-pull-request comment.
- lgtm cancel: /lgtm cancel by a reviewer and /remove-lgtm by the author
  remove the label and reset prow/lgtm to pending; no label is a no-op;
  a non-reviewer non-author is refused.

Closes #239

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner September 30, 2026 06:36
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 30, 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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@jeefy

jeefy commented Oct 2, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 2, 2026
@github-actions
github-actions Bot merged commit 1b2258c into main Oct 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the bundle e2e suite never drives /test or lgtm cancel (/lgtm cancel, /remove-lgtm) through dist/index.js

1 participant