Skip to content

feat(prs): linked Repositories stay current; follow a rename whose old name was taken (#362, #390) - #409

Merged
bRRRITSCOLD merged 6 commits into
mainfrom
feat/362-repositories-stay-current
Nov 24, 2026
Merged

bRRRITSCOLD merged 6 commits into
mainfrom
feat/362-repositories-stay-current

Conversation

@bRRRITSCOLD

Copy link
Copy Markdown
Owner

Closes #362
Closes #390

Linked Repositories now stay current without a Pull request to carry them, and a renamed Repository whose old name another repository took no longer leaves its PRs Unreachable.

What changes

Repositories read by id (full sync only). GraphQL has no lookup by a Repository's GitHub id, so a full sync reads one with REST GET /repositories/{id}, 4 at a time, with the same token, timeout, retries and wording as the other REST calls. It reads:

  • every linked Repository that GitHub showed no PR of in this sync (a superset of "no kept PR": one whose only kept PRs are Finished or Unreachable is read too). GitHub's answer updates its name, URL, private and archived, so a Link follows a rename or transfer.
  • the Repository of a PR that left the list and that a fetch by its last known name didn't find as asked (not shown, or shown as another Repository's PR). If GitHub calls the Repository by another name now, it is stored under that name and those PRs are fetched again under it. That is the PR sync: a PR whose Repository was renamed, then lost its old name to another, reads as Unreachable #390 fix: the renamed Repository's merged PR is fetched under its new name and becomes Finished instead of Unreachable. The "is it the PR we asked for" check stays.

No Repository is asked about twice in one sync.

Unreachable. A 404, a 451, or a 403 that isn't a rate limit (an organisation's SSO or OAuth app restrictions) marks the Repository Unreachable. It keeps its Links, its PRs and its last known facts. When GitHub shows it again, by id or with any PR, the mark is cleared. A PR whose Repository GitHub doesn't show by id is marked Unreachable with it. Each change sends changed repository.

Pull requests views. An Unreachable Repository's group header reads "Unreachable: can't sync, PRs may be out of date" in place of the Workspace names, on both the Pull requests view and a Workspace's Pull requests. The group keeps its place among the linked groups and keeps its group menu.

repo ls already marked (unreachable) (and unreachable in --json). Now something sets the mark, and a CLI test covers it.

No route, field or message changed, so API_VERSION stays as it is.

What a sync costs

  • An incremental sync makes no REST calls, as before.
  • A full sync costs what it did before, plus one REST request per Repository it reads by id. In the usual case that is only the linked Repositories that have no open PR GitHub showed. A PR that left the list costs nothing extra while its fetch by its last known name finds it.
  • REST requests come out of REST's own 5,000 per hour, not GraphQL's points. With the hourly full sync, 10 such Repositories cost 10 REST requests an hour and no GraphQL points.

Deviation from the brief

#390's fix says to resolve the Repository by id before fetching by number. This PR resolves it only when that fetch misses, then fetches again under the new name. The outcome is the same, and the common case costs nothing: a merged PR whose Repository wasn't renamed is found by the first fetch, so no REST call is made.

Spec and design

  • docs/spec.md §3, §8 (Repositories read by id, Unreachable, cost), §10 (repo ls), §11 (the header) and §12 (tests) are rewritten.
  • New Penpot board: "Screens · Main" → "Pull requests · unreachable repository". The app capture matches it.

Tests

  • Daemon integration (httpmock):
    • a linked Repository with no PR is renamed by id (Link kept);
    • lost access: Unreachable, Link kept, changed repository;
    • regained access: the mark is cleared;
    • no read by id while a PR shows the Repository;
    • a PR's Repository that GitHub doesn't show is marked with the PR, read once;
    • PR sync: a PR whose Repository was renamed, then lost its old name to another, reads as Unreachable #390's scenario: renamed, old name taken by another Repository with a PR of the same number, the original merged before any sync saw the rename. It ends merged and Finished, not Unreachable.
  • Unit: which REST answers mean GitHub hides a Repository (404/451/SSO 403, and not a rate-limited 403).
  • GUI view tests: the Unreachable header on both views; the group keeps its order.
  • CLI: repo ls text and --json after a pr sync found the Repository Unreachable.

🤖 Generated with Claude Code

bRRRITSCOLD and others added 6 commits November 23, 2026 18:16
…390)

A full sync reads by id every linked Repository no PR showed, and the
Repository of a PR that left the list and wasn't found under its last
known name. A rename is followed, lost access marks it Unreachable with
its Links kept, and GitHub showing it again clears the mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#362)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…390)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bRRRITSCOLD
bRRRITSCOLD merged commit 2ed9d10 into main Nov 24, 2026
6 checks passed
@bRRRITSCOLD
bRRRITSCOLD deleted the feat/362-repositories-stay-current branch November 24, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR sync: a PR whose Repository was renamed, then lost its old name to another, reads as Unreachable Linked Repositories stay current

1 participant