Skip to content

test(bundle): drive withdrawalReason's 'and N more' tail and no-withdrawer arm (approveReview.ts:105/120) through dist/index.js - #408

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-approve-review-reason-arms
Oct 9, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-approve-review-reason-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/approveReviewReasonArms.test.ts (new file only; no existing test, helper or source file is touched), running pull_request_review through dist/index.js against fakeGithub.ts with approve.github_review: true, the approved label set and the Bot's marker review present, for the two arms of withdrawalReason (src/plugins/approveReview.ts:104-120) the bundle suite never reached:

  • seven uncovered files + /approve cancel by bob → the log names every file, the dismissal message is cut to no approver covers sdk/a.go, sdk/b.go, sdk/c.go, sdk/d.go, sdk/e.go and 2 more; withdrawn by bob (/approve cancel) (approveReview.ts:105)
  • one uncovered file and no comments → approved removed: no approver covers sdk/x.go, no withdrawn by suffix (approveReview.ts:120)

Files/functions claimed: __tests__/bundle/approveReviewReasonArms.test.ts (new) only; src/plugins/approveReview.ts withdrawalReason lines 105 and 120. Disjoint from #333 (src/plugins/approve.ts arms) and from approveReviewShortCircuits.test.ts / approveReview.test.ts, which stay untouched.

Verified locally on main @ 20d49e7: npx vitest run __tests__/bundle/approveReviewReasonArms.test.ts (2 passed), npx eslint clean, and vitest --coverage --config vitest.e2e-coverage.config.mjs --coverage.reporter=json shows both branches on lines 105 and 120 at [1, 1].

Related Issue

Closes #407


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

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

…rawer arm (approveReview.ts:105/120) through dist/index.js

The mirrored approve.github_review review's dismissal message truncates
the uncovered-file list after five entries and only appends 'withdrawn by'
when someone took an approval back. Neither arm was reached by the bundle
suite: the existing short-circuit tests either return before
withdrawalReason runs or always carry a /approve cancel comment and a
single file. Add a bundle test that drives both through dist/index.js.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 9, 2026 09:12
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 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: unknown

— 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 9, 2026
@mrbobbytables
mrbobbytables merged commit 5dde579 into main Oct 9, 2026
9 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-approve-review-reason-arms branch October 9, 2026 15:51
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] withdrawalReason's 'and N more' tail (approveReview.ts:105) and no-withdrawer arm (:120) have no end-to-end coverage

1 participant