Skip to content

test(bundle): drive /hold cancel's no-label, failed-read, failed-removal and already-gone arms through dist/index.js - #326

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-hold-cancel-arms
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-hold-cancel-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/holdCancelArms.test.ts (new file only; imports comment, configReads, helpersFor, repo, token from ./helpers) — six cases run through the committed dist/index.js against fakeGithub, covering the cancelHold arms of src/labels/hold.ts that no bundle suite reached:

  1. /hold cancel, /unhold, /remove-hold on an issue whose labels are [lgtm] → exit 0, no DELETE, requests are the config reads then GET /issues/1 (hold.ts L67–69).
  2. /hold cancel with GET /issues/1 → 500 → exit 1, error carries could not get labels from issue, no DELETE (L60–61).
  3. /hold cancel with DELETE …/labels/do-not-merge%2Fhold → 500 → exit 1, error carries both could not remove the hold label and the cause could not remove label do-not-merge/hold (L75–76).
  4. /hold cancel with hold + do-not-merge/hold present, DELETE …/labels/hold → 404, the other → 200 → exit 0, both DELETEs sent (src/utils/labeling.ts L202–203, the benign gone-label arm).

Cluster: src/labels/hold.ts cancelHold + src/utils/labeling.ts removeLabels 404 arm. Disjoint from #293 (holdSweepSettings: configured hold.label, label present) and from bundle.test.ts's /unhold case (both labels present, writes accepted).

Measured with npm run test:coverage:e2e on main @ 3fc21f2, before → after: src/labels/hold.ts 80 % → 96 % lines, 81.81 % → 90.9 % branches; src/utils/labeling.ts 73.07 % → 76.92 % lines; bundle suite 142 → 148 tests. The remaining hold.ts line (L30, missing issue number) cannot be produced through the API.

Verified locally: npx vitest run __tests__/bundle/holdCancelArms.test.ts → 6 pass; npx eslint and npx tsc --noEmit clean.

Related Issue

Closes #325


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

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

…val and already-gone arms through dist/index.js

Adds __tests__/bundle/holdCancelArms.test.ts: /hold cancel, /unhold and
/remove-hold on an issue carrying no hold label, a 500 on the labels
read, a 500 on the label DELETE, and a 404 on one DELETE (a label gone
between read and removal), all run through the committed bundle against
fakeGithub.

Measured with npm run test:coverage:e2e on main @ 3fc21f2:
src/labels/hold.ts 80 % -> 96 % lines, 81.81 % -> 90.9 % branches;
src/utils/labeling.ts 73.07 % -> 76.92 % lines (removeLabels' benign
404 arm). The one remaining hold.ts line is the missing-issue-number
throw, unreachable through the API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 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.

@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.

  • holdCancelArms.test.ts:27: reduce it.each(['/hold cancel', '/unhold', '/remove-hold']) to a single /hold cancel case. All three rows reach the same lines and branches (hold.ts:67–69), and the alias handling is already covered on main.

quality added 2 commits October 7, 2026 21:50
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: the it.each over /hold cancel, /unhold, /remove-hold is now a single /hold cancel case. Also merged main (picks up #287's meow network fix, which was what failed build-test here).


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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 8a99d52: the it.each over the three spellings is reduced to a single /hold cancel case.

CI is green on the new head.


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

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

@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.

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 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. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@github-actions github-actions Bot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-kind labels Oct 9, 2026
@github-actions
github-actions Bot merged commit 62c645b into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-hold-cancel-arms branch October 9, 2026 17:32
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] /hold cancel's no-label, failed-read and failed-removal arms in src/labels/hold.ts are unit-only

1 participant