Skip to content

test(label-sync): pin the case-insensitive name and color folds, the null-description fold, the dry-run counts and per_page - #531

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-label-sync-case-fold
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-label-sync-case-fold

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/cronJobTest/labelSync.test.ts only. No src/, dist/, docs/ or config change. Disjoint from every open held PR (#510–#530): none touches this file; #528 adds only __tests__/bundle/ files for labelSync.ts:107.

A single-operator mutation probe over src/cronJobs/labelSync.ts on main @ 88241f4 (18 mutants against npx vitest related src/cronJobs/labelSync.ts --run, 4 files / 77 tests) left six non-equivalent survivors. The headline one: the test titled writes nothing when only the case of the name or color differs … built its fixture with withChanges(...), whose change.name === label.name match is exact, so the re-cased Kind/Bug / LGTM entries never replaced anything and the served fixture was complete unchanged — the test passed with every .toLowerCase() fold deleted.

This PR:

  • makes withChanges match names case-insensitively and asserts the served fixture really contains Kind/Bug and LGTM (kills labelSync.ts:57 map key and :130 color compare); adds a mixed-case configured name Needs-Triage against a lowercase repository needs-triage (kills :63, which no lowercase catalog name can reach)
  • adds: configured description: "" vs repository description: null → no write, one more unchanged (kills :133 ?? '')
  • pins the dry-run core.info line exactly — would create 1 [kind/bug], would update 1 [lgtm (color, description)], unchanged 17 (kills :86)
  • asserts per_page=100 on the label listing in the paging test (kills :52)

Equivalent survivors left alone: :117/:118 spread folds (JSON.stringify drops undefined, so the wire body is identical either way).

Verification (this branch, local)

  • npx vitest run __tests__/cronJobTest/labelSync.test.ts: 15 passed (was 14)
  • each of the six mutants applied in turn to src/cronJobs/labelSync.ts, npx vitest related src/cronJobs/labelSync.ts --run: 1 failed | 77 passed for every one (mutants reverted, not committed)
  • npx eslint __tests__/cronJobTest/labelSync.test.ts: clean

Related Issue

Refs #523 — this lands the labelSync.test.ts finding the hive folded onto that tracker (five boxes, all in this PR). The tracker's own trigger.test.ts finding is #524's, and its other folded items (approveReview, the run.ts:40/config.ts:657 v8-ignore) are #527's and a src/ change respectively, so the issue stays open.


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

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

…null-description fold, the dry-run counts and per_page

The 'only the case of the name or color differs' test built its fixture
with withChanges, which matched names exactly, so the re-cased Kind/Bug
and LGTM entries never replaced anything and the test passed with the
.toLowerCase() folds removed. withChanges now matches case-insensitively
and the test asserts the fixture really carries the re-cased entries,
plus a mixed-case configured name against a lowercase repository label.

Also pins: a configured empty description against a null repository
description is in sync; the exact dry-run summary line; per_page=100 on
the label listing. Each of the six surviving mutants on
src/cronJobs/labelSync.ts (lines 52, 57, 63, 86, 130, 133) now fails
exactly one test.

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 02:14
@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 re-cased fixture now actually replaces labels, and the cases observe case-insensitive names/colors, null-versus-empty description equivalence, pagination and exact dry-run counts.

Verified successful build-test, e2e-coverage and DCO results on head 71dd891. 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 3cd9b41 into main Oct 21, 2026
18 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant