Skip to content

test(plugins): cover the /lgtm cancel and null-body notifier arms of approveOnPullRequest - #221

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-approve-base-fallback
Oct 3, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-approve-base-fallback

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Test Improvement

Adds two cases to __tests__/plugins/approveEvents.test.ts (describe('approveOnPullRequest')) for arms of src/plugins/approve.ts the suite did not reach:

  • upsertNotifier: a bot comment with body: null is skipped rather than matched as the notifier; a fresh notifier is posted and nothing is patched.
  • effectiveKind: /lgtm cancel with lgtm_acts_as_approve unset is ignored, so prior /approves still add the label and both approvers stay listed.

The no-base-ref fallback case originally included here was dropped on review: approveErrorPaths.test.ts:150 and approveEvents.test.ts:237 already cover it.

Only __tests__/plugins/approveEvents.test.ts changes.

Verification on main @ a270568: npx eslint, npx tsc --noEmit, npx vitest run __tests__/plugins/approveEvents.test.ts — 27 pass.

Related Issue

Closes #220


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

@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner September 28, 2026 21:23
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 28, 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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


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

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

The /lgtm cancel and null-body notifier tests are good.

  1. Drop "a payload whose pull request has no base ref probes the repository default branch instead". It adds no coverage; approveErrorPaths.test.ts:150 (#192) and approveEvents.test.ts:237 already cover it.
  2. Fix the PR body, which says all three tests cover branches the suite left uncovered.

…approveOnPullRequest

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot force-pushed the quality/test-approve-base-fallback branch from 2559f30 to f7c252a Compare October 3, 2026 05:12
@hivecommons-hive hivecommons-hive Bot added agent/quality Created by Hive for agent-filed issue provenance hive/hosted-available-lke648397-260827-5q9t Created by Hive for agent-filed issue provenance labels Oct 3, 2026
@hivecommons-hive hivecommons-hive Bot changed the title test(plugins): cover the approve base-ref fallback, null-body bot comment and /lgtm cancel branches test(plugins): cover the /lgtm cancel and null-body notifier arms of approveOnPullRequest Oct 3, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the no-base-ref case (already covered at approveErrorPaths.test.ts:150 / approveEvents.test.ts:237); title and body now describe only the two remaining cases. Rebased on main @ a270568.


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

— 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, thanks.

@jeefy

jeefy commented Oct 3, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added 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 3, 2026
@github-actions
github-actions Bot merged commit dbfa9b5 into main Oct 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Created by Hive for agent-filed issue provenance hive/hosted-available-lke648397-260827-5q9t Created by Hive for agent-filed issue provenance 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] plugins/approve.ts: base-ref fallback, null-body bot comment and /lgtm cancel branches are untested

1 participant