Repository navigation
test(owners): pin the fail-closed OWNERS group read when a later members page cannot be fetched (owners.ts:153-162) - #564
Open
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…ers page cannot be fetched (owners.ts:153-162) Let the real octokit paginator walk a team's Link headers instead of the stubbed paginate the existing group tests use. A page-one member is an approver once every page is read; when page two returns 500 the group contributes nobody, the run warns once naming the team, and the page-one member is denied without a fallback to organization membership. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
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 Hive will keep the |
Contributor
Author
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
__tests__/utils/ownersGroupPagination.test.ts, which reads an OWNERS@codertocat/maintainersgroup through the realoctokit.paginateagainst mswLinkheaders (the existing group tests in__tests__/utils/owners.test.tsstubpaginate;__tests__/bundle/ownersGroups.test.tsserves a single page). It pinsexpandGroups(src/utils/owners.ts:150-165) and the/approveoutcome throughassertAuthorizedByOwnersOrMembership:Linkto page two, so a member listed only there is an approver (and both pages are requested withper_page=100);dave is not an approver for any changed file), exactly one warning is emitted (OWNERS: could not read the members of @codertocat/maintainers: HttpError: Server Error), and both pages were requested — i.e. the read fails closed rather than trusting the members fetched so far;GET /orgs/{org}/members/{login}is made; the unhandled-request guard would reject one).Evidence at
maine3119ad:npm run test:coverage(99.92 / 99.35 / 100 / 99.91) andnpm run test:coverage:e2e(100 / 99.46 / 100 / 100) both already hitowners.ts:160-162, so this is a behavioural contract, not a line-coverage change — per #554's "judge tests by behavior" section.Related Issue
Refs #554 — ticks only the "OWNERS pagination failure: fail a subsequent membership page and assert the warning and fail-closed behavior" box of the P2 cross-request section. Decision taken by hive: the scenario is pinned at the unit layer with a real
Octokitrather than in__tests__/bundle/, because the bundle variant needs thefakeGithubresponse-header support that #555 adds and that file is occupied ground until #555 merges. The tracker's other boxes (paginated OWNERS/timeline in #555, boundaries in #558, successive sweeps in #559, scheduling outage recovery, and the P1 CI/release/harness sections) stay open; the issue states a single test PR must not close it.Disjoint from the open hold-gated PRs: touches only the new file; no change to
fakeGithub.ts,ownersGroups.test.ts,blunderbussDelay*.test.ts,sweep*.test.ts,tide.test.ts,auth.ts, orconfig.ts.Tests
npx vitest run __tests__/utils/ownersGroupPagination.test.ts— 4 passednpx eslint __tests__/utils/ownersGroupPagination.test.ts— cleanFiled by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 requested_by=@mrbobbytables