Skip to content

test(bundle): drive label-sync's custom-section, needs-* and dedup catalog arms through dist/index.js - #351

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-label-sync-catalog
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-label-sync-catalog

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/labelSyncCatalog.test.ts (new file only; imports configReads, helpersFor, repo, token from ./helpers). Cluster: src/utils/labelCatalog.ts desiredLabels() as reached by the label-sync cron job, driven through the committed dist/index.js against the fake GitHub.

One workflow_dispatch jobs: label-sync run on a repository with no labels, configured with:

  • labels.kind: [bug] plus a non-registry section labels.team: [{ name: docs, color: 0E8A16, description: … }] → team/docs is created with the color lowercased (labelCatalog.ts:52)
  • two require_matching_label rules, missing_label: needs-kind (issues) and missing_label: Needs-Kind (prs) → exactly one needs-kind created with the ededed default color and no description (:61, dedup :68)

Asserts the full sorted POST /labels sequence (16 built-ins + kind/bug, needs-kind, team/docs), the three bodies, the label-sync: created 19 […] summary line, no PATCH/DELETE, and the request order after the config and labels reads via expectRequests.

Measured with npm run test:coverage:e2e on main @ 3fc21f2: labelCatalog.ts end-to-end 32/35 → 35/35 lines (lines 52, 61, 68 now reached; file fully covered e2e); repository e2e 1855 → 1858 of 2381 lines. Unit coverage of the file is already 100 % (__tests__/utils/labelCatalog.test.ts).

Disjoint from the held PRs: #312 (labelSyncFailureArms.test.ts, labelSync.ts refused-write / description-drift arms) and #242 (cronJobsInput.test.ts, the jobs input) do not touch the catalog; bundle.test.ts' three label-sync cases use a kind section only. src/, dist/, vitest.config.mjs and .github/ unchanged.

Verified locally: npx vitest run __tests__/bundle/labelSyncCatalog.test.ts (1 passed against the committed bundle), npx eslint __tests__/bundle/labelSyncCatalog.test.ts clean, npx tsc --noEmit clean, npm run test:coverage:e2e 6 files / 143 tests green.

Related Issue

Closes #350


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

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

…talog arms through dist/index.js

Adds __tests__/bundle/labelSyncCatalog.test.ts: a workflow_dispatch
label-sync run against a configuration with a non-registry labels.team
section and two require_matching_label rules spelling the same
missing_label in different case, asserting the POST /labels sequence and
bodies (team/docs with the lowercased color, needs-kind with ededed, no
duplicate). Reaches src/utils/labelCatalog.ts lines 52, 61 and 68 through
the shipped bundle: e2e 32/35 -> 35/35 lines.

Refs #350

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

Copy link
Copy Markdown
Contributor Author

build-test on this PR is red for the shared cause tracked in #294, not for anything in this diff.

Evidence from the red run 37481271088 (SHA 3ef0ff5):

  • Test Files 81 passed (81), Tests 1640 passed (1640), Errors 1 error
  • the single error is the known unhandled assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID") from __tests__/issueCommentTest/meow.test.ts (undici pre-connect escaping msw to the real cat API)
  • the twin push run on the same SHA, 37480954573, is green
  • this PR only touches __tests__/bundle/labelSyncCatalog.test.ts

Deferring until #294 closes; no PR-local change is warranted.


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

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

@jeefy

jeefy commented Oct 7, 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 7, 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 7, 2026
@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

@github-actions
github-actions Bot merged commit ad79065 into main Oct 7, 2026
13 of 14 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-label-sync-catalog branch October 9, 2026 17:34
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] labelCatalog.desiredLabels' custom-section, require_matching_label and dedup arms are never driven through dist/index.js

1 participant