Skip to content

test(pullRequestOwners): omit draft/state/labels for real, pin the rename dedupe and the repository-keyed pull and tip memos - #533

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-pull-request-owners-folds
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-pull-request-owners-folds

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

src/utils/pullRequestOwners.ts is at 100 % lines and branches under both suites, but four of its expressions survive deletion unnoticed (details and the mutation probe in #532). This pins them, all in __tests__/utils/pullRequestOwners.test.ts:

  • defaults test made real — the existing defaults … when the pull omits them case served the shared pullBody, which already carries draft: false and labels: [], so its draft/labels half was vacuous. It now passes undefined overrides for user, draft, state, requested_reviewers, assignees, labels (JSON drops them) and asserts draft: false, open: false, labels: [].
  • draft/open positive case — draft: true, state: 'open' → { draft: true, open: true }; state: 'closed' → open: false. Kills pull.draft === true → !== false.
  • rename dedupe — a.go → b.go plus a new a.go: files is ['b.go', 'a.go'], perFile.size is 2. Kills the new Set(...) removal.
  • repository-keyed memos — a second MockContext for Other/Repo: the same pull number is fetched again, and the same base branch name is read again. Kills dropping ${owner}/${repo} from either memo key (loadPullRequestOwners line 44, baseBranchTip line 109).

Files: __tests__/utils/pullRequestOwners.test.ts only. No src/, dist/ or docs change. Disjoint from every open hold PR: #525 touches __tests__/utils/owners.test.ts, ownersAuth.test.ts, repoHasOwners.test.ts, not this file; none of #510–#531 touches pullRequestOwners.

Verification (this branch, local)

  • npx vitest run __tests__/utils/pullRequestOwners.test.ts: 17/17 pass (was 13)
  • Each of the five mutants (draft fold, Set dedupe, both memo keys, labels ?? [] default) applied to src/utils/pullRequestOwners.ts now fails at least one test in this file; on main each passed the full unit selector and the 502-test __tests__/bundle suite against a repacked dist/index.js
  • npm run test:coverage: 163 files, 2210 passed, thresholds hold (100 / 99.75 / 100 / 100)
  • npx eslint __tests__/utils/pullRequestOwners.test.ts: clean
  • The one ::warning:: … Cannot bypass a request line in this file's output is pre-existing on main (the forces a fresh fetch case serves no branch handler) and is unchanged here

Not in this PR

The memo keys cannot be exercised from dist/index.js (one repository per process), and the bundle routeOwners helper only serves string filenames, so the rename case has no e2e twin either. Both stay unit-suite pins.

Related Issue

Fixes #532


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

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

…name dedupe and the repository-keyed pull and tip memos

The 'defaults ... when the pull omits them' test served the shared pullBody,
which already carries draft: false and labels: [], so the draft and labels
half of its title never ran. Pass undefined overrides so JSON drops the keys,
add the positive draft/open case, a rename whose previous_filename another
entry reuses (the Set dedupe), and a second repository for the pull memo and
the base-tip memo. Each of those expressions survived deletion under both
vitest suites before this change.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 20, 2026 04:00
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 20, 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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

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

Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.

The default-field fixture truly omits the fields; rename overlap is deduplicated; pull and branch-tip memo tests distinguish repositories sharing the same identifiers.

Verified successful build-test, e2e-coverage and DCO results on head cfae542. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.

@mrbobbytables mrbobbytables 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. needs-kind labels Oct 21, 2026
@mrbobbytables
mrbobbytables merged commit fb76be0 into main Oct 21, 2026
15 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-pull-request-owners-folds branch October 26, 2026 20:19
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.

Projects

None yet

1 participant