Skip to content

fix(hub): keep a policy read going when listing branches or the refresh fails - #767

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-11706-policy-read-partial-failures
Oct 29, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-11706-policy-read-partial-failures

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The policy file read no longer fails when the open policy pull request cannot be listed or its branch copy cannot be read. It returns the default branch's file with pullUnread: true, so "could not check" is no longer shown as "no pull request". A repository the shared listing does not cover is asked of the host directly; if that read fails it is pullUnread too. A refused listing or an error row is pullUnread as before. Opening a policy pull request no longer turns into an error when the listing refresh afterwards fails: the refresh failure is logged and the opened pull request is returned.

  • The code is in policy-file.ts (pullCopy, opened), which both GitHub and Bitbucket Data Center records go through, so one fix covers both hosts. The files named in the issue do not hold this path.
  • One optional field is added to the policy file response, pullUnread; older clients ignore it. It is documented in docs/ARCHITECTURE.md and the route's OpenAPI description.
  • Verified: policy-file.postgres.test.ts covers a listing that throws, a branch read that fails, a repository the listing omits (asked of the host, and unread when that fails) and a refresh that fails after opening. bun run check and bun run lint pass (existing warnings only).

Closes CL-11706

@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

CL-11706

@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 29, 2026 16:05
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Notes:

  • Risk: medium (2 recently fixed files)

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a pullUnread flag to the policy file response so that when the open policy pull request cannot be listed or its branch copy cannot be read, the default branch file is returned instead of reporting "no pull request". It also stops an opened policy pull request from becoming an error when the follow-up listing refresh fails, logging the refresh failure and returning the opened pull request.

@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 5ef0988 Oct 29, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant