Repository navigation
test(bundle): drive label-sync's custom-section, needs-* and dedup catalog arms through dist/index.js - #351
Conversation
…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>
|
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 Hive will keep the |
|
Evidence from the red run 37481271088 (SHA 3ef0ff5):
Deferring until #294 closes; no PR-local change is warranted. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
/kind cleanup |
|
/lgtm |
Test Improvement
Adds
__tests__/bundle/labelSyncCatalog.test.ts(new file only; importsconfigReads,helpersFor,repo,tokenfrom./helpers). Cluster:src/utils/labelCatalog.tsdesiredLabels()as reached by thelabel-synccron job, driven through the committeddist/index.jsagainst the fake GitHub.One
workflow_dispatchjobs: label-syncrun on a repository with no labels, configured with:labels.kind: [bug]plus a non-registry sectionlabels.team: [{ name: docs, color: 0E8A16, description: … }]→team/docsis created with the color lowercased (labelCatalog.ts:52)require_matching_labelrules,missing_label: needs-kind(issues) andmissing_label: Needs-Kind(prs) → exactly oneneeds-kindcreated with theedededdefault color and no description (:61, dedup:68)Asserts the full sorted
POST /labelssequence (16 built-ins +kind/bug,needs-kind,team/docs), the three bodies, thelabel-sync: created 19 […]summary line, noPATCH/DELETE, and the request order after the config and labels reads viaexpectRequests.Measured with
npm run test:coverage:e2eonmain@ 3fc21f2:labelCatalog.tsend-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.tsrefused-write / description-drift arms) and #242 (cronJobsInput.test.ts, thejobsinput) do not touch the catalog;bundle.test.ts' three label-sync cases use akindsection only.src/,dist/,vitest.config.mjsand.github/unchanged.Verified locally:
npx vitest run __tests__/bundle/labelSyncCatalog.test.ts(1 passed against the committed bundle),npx eslint __tests__/bundle/labelSyncCatalog.test.tsclean,npx tsc --noEmitclean,npm run test:coverage:e2e6 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