Skip to content

test(bundle): drive label-sync's refused-write and description-drift arms through dist/index.js - #312

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-label-sync-failure-arms
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-label-sync-failure-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/labelSyncFailureArms.test.ts (new file; nothing else touched), driving the failure arms of src/cronJobs/labelSync.ts through the committed dist/index.js against the fake GitHub API:

  • a workflow_dispatch jobs: label-sync run where POST /labels answers 403: one core.error per refused built-in, every create still attempted after the first refusal (write() catch, lines 107-109), then the single TypeError: error handling cron job: Error: 16 label(s) could not be synced: … failure (line 94)
  • the one existing label, kind/bug, has the configured description missing and no configured colour, so the only write that succeeds is PATCH /labels/kind%2Fbug with { description } alone (drift() line 134)

Measured with npm run test:coverage:e2e on main @ 3fc21f2: labelSync.ts 85.41 → 97.91 % lines (only line 55 remains). Unit coverage of the file is already 100 %.

Cluster: labelSync refused writes / description drift — disjoint from the held bundle PRs (#242 cron jobs input, #283–#310 issue_comment commands, plugins and handlePullReq).

Related Issue

Closes #311


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

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

…arms through dist/index.js

Adds __tests__/bundle/labelSyncFailureArms.test.ts: a workflow_dispatch
label-sync run where every create answers 403 and the one existing label
drifts only in its description. Covers src/cronJobs/labelSync.ts lines
94, 107-109 and 134 end-to-end (npm run test:coverage:e2e:
labelSync.ts 85.41 -> 97.91 % lines).

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 4, 2026 21: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 4, 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

Copy link
Copy Markdown
Contributor Author

build-test is red here for a baseline cause this PR's diff does not touch: all 81 test files pass, and the job exits 1 on a single vitest Unhandled Error — assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID") originating in __tests__/issueCommentTest/meow.test.ts (runs 37234340602, 37234245909 on f5e5587). This PR only changes __tests__/bundle/labelSyncFailureArms.test.ts.

Tracked as shared incident #294; fix is #287. Deferring — no re-runs or pushes to this branch until that lands.


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

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

  • labelSyncFailureArms.test.ts:46–47: replace toEqual(perLabel) with a fragment check per entry, e.g. toContain(\could not sync ${name}`)`.
  • :49: assert toContain(\${builtins.length} label(s) could not be synced`)instead of the full string, which also locks in theTypeError: … Error:` wrapper.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: per-label errors are checked with toContain(\could not sync ${name}`)and the final line withtoContain(`${builtins.length} label(s) could not be synced`). Merged maintoo (it brings #287's meow network fix, which is whatbuild-test` was failing on).


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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 2568bc8: per-entry toContain(\could not sync ${name}`)andtoContain(`${builtins.length} label(s) could not be synced`)` replace the full-string comparisons.

CI is green on the new head.


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

— 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; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 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 9, 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 9, 2026
@github-actions
github-actions Bot merged commit 2ecbc35 into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-label-sync-failure-arms 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] label-sync's refused-write and description-drift arms are never exercised end-to-end through dist/index.js

1 participant