Skip to content

test(bundle): drive the authorization section's schema rejections and the cross-tier users union through dist/index.js - #381

Open
hivecommons-hive[bot] wants to merge 3 commits into
mainfrom
quality/test-authorization-schema-arms
Open

hivecommons-hive[bot] wants to merge 3 commits into
mainfrom
quality/test-authorization-schema-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/authorizationSchemaArms.test.ts, which runs /triage accepted through dist/index.js and reaches the authorization arms of src/utils/config.ts that only unit tests touched:

  • normalizeAuthorization: not a mapping (666), unknown key (671), policy outside the set, review outside the set, users not a list (686)
  • normalizeLogins: a list entry that is not a GitHub login (704)
  • mergeAuthorization: the repository tier repeating an organization-tier login in different case is deduped and the login is admitted with no membership call (753)

Each rejection asserts status 1, an error containing could not get labels from yaml: Codertocat/Hello-World:.github/prow.yaml: authorization.…, and no label write.

Measured with npm run test:coverage:e2e on main @ aa6a0f8: config.ts 73.96 % → 76.85 % lines; all five lines now hit. New file only — disjoint from #339 (configSchemaArms.test.ts, no authorization rows) and #378 (authorizationPolicyArms.test.ts, auth.ts policy arms). 7 tests pass against the committed dist/index.js; eslint clean.

Related Issue

Closes #380


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

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

… the cross-tier users union through dist/index.js

normalizeAuthorization's non-mapping, unknown-key, bad-policy and users
rejections (config.ts 666, 671, 686, normalizeLogins 704) and
mergeAuthorization's case-insensitive dedup of users listed by both the
organization and the repository tier (753) had unit hits only; this file
reaches them through a /triage accepted against a malformed .github/prow.yaml
and a two-tier configuration.

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

/kind cleanup


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

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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Oct 8, 2026

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

Every row adds coverage, and the schema rows match the docs. One case doesn't test what its title says:

  • authorizationSchemaArms.test.ts:71: the "unioned" case runs as friend, but the repository tier also lists friend, so it passes whether users is unioned or replaced. Run it as other, who is listed only by the organization tier. I ran that on main: it passes with the same request sequence.
  • Overlap: rows :51 and :52 reach config.ts:676/681, which #378 also reaches. Whichever lands second should drop them.

…and drop the policy-set rows #378 reaches

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 8474744:


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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

[quality] the authorization section's schema rejections and the cross-tier users union have no end-to-end coverage through dist/index.js

2 participants