Repository navigation
Conversation
Nothing ran the test suite on pull requests. The workflow runs on pull requests, pushes to main and manual dispatch, with Python 3.12 as the Docker image uses. It skips the two test files that query the su10:9200 cluster rather than listing the files to run, so new host-free tests (such as tests/test_openapi.py from biothings#42) are picked up without editing it. It installs with `uv pip install`, not `uv sync`, because `uv sync` and `uv run` can't resolve the project until requires-python is raised (biothings#43). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaurav
added a commit
to gaurav/prcoder
that referenced
this pull request
Oct 15, 2026
…itch between them when it has several (#144) A branch pushed to a fork by URL, with no tracking config, had a pull request prcoder could not see: nodenorm-es's `run-tests-in-github-actions` has biothings/NodeNormalizationAPI#52 open from `TranslatorSRI:run-tests-in-github-actions`, and the pane said there was none. `gh pr view` finds a pull request by a head label built from the branch's push config, and a cross-repository one's label is `fork:branch`, which a bare branch name never matches. This PR looks for the branch's pull request in every repository it could be in, shows it with each side of `head → base` labelled by where it lives, and, when a branch has more than one, lets the switcher pick between them without a checkout. It also re-measures every figure in `docs/Verifying.md`, which the lookup moved. Closes #129. ## The calls worth overruling - **Where to look.** `repoInfo` lists the repositories once at startup: gh's base repo, its parent when it is a fork, and the repository behind each GitHub remote. The poll runs one `gh pr list --head <branch>` per repository in place of `gh pr view`. - **Strangers.** `--head main` in a parent matches every fork's `main`. A row is this branch's when its head repository is one of those, or this clone has its head commit, which alone vouches for a fork no remote names. When a plain `git push` of the branch goes to a same-named branch (`pushRepo`, from `%(push)`), only that repository's head counts, so a fork's `main` is not given the parent's `main → release`. - **What a crowded name costs.** The first page is five deep, with the checks, so the common case is one call. One all strangers (vscode has 63 open from a `main`) is asked again 100 deep without them; the branch's found only there gets its checks from `gh pr view`. Unvouched heads go to git as one `cat-file --batch-check` per page. Nothing is remembered between polls; #147 is the proposal to remember the answer instead. - **Which to show** (`pickPr`): the one picked in the switcher; else open over merged, at this clone's HEAD, the one shown last poll (so a comment on the other of two does not swap the pane), gh's base repository first, newest. - **Labels.** A side in origin's repository is bare, as it always was; one another remote names is `upstream:main`; one no remote names is `TranslatorSRI:branch`, as GitHub writes it. `origin:` on every side was the alternative: noise in the common case. - **The URL is a pull request's identity**, not its number, which a fork and its parent can share: `keepPr`, the switcher's options and `/api/pr/switch`, which runs `gh pr checkout <url>`: gh resolves a bare number in its base repository. The route takes only the whole of a `https://github.com/owner/repo/pull/N` in one of the repositories above, and `/api/pr/choose` only a URL the last poll listed ([Security.md](https://github.com/gaurav/prcoder/blob/a96dc21/docs/Security.md#checking-new-work)). - **`scope`** is `current` when the lookup found the pull request, whichever repository it is in, so a fork's pull request into its parent keeps its sync light. The Stack tab and a local patch's base remote go by the pull request's own repository. ## What's here - The lookup, `branchPrs` in `github.js`, its gh and git facts dated in its docstrings. - The head's state row and the terminal's status block label both sides ([Panes.md](https://github.com/gaurav/prcoder/blob/a96dc21/docs/Panes.md#the-head)). - The switcher leads with **On this branch** when the branch has two or more pull requests, each with its stack; a pick there (`POST /api/pr/choose`) shows it without a checkout until the branch changes, even on a dirty tree ([Panes.md](https://github.com/gaurav/prcoder/blob/a96dc21/docs/Panes.md#moving-between-pull-requests)). The pane with no pull request names the repositories it looked in when there was more than one. - `g` in the terminal runs the same lookup as the poll. - Two more git calls per poll on every branch: where it pushes, and HEAD read again beside `git status`, so a commit during the lookup's gh calls cannot pair an old head with a new tree ([figures](https://github.com/gaurav/prcoder/blob/a96dc21/docs/Verifying.md#figures-worth-re-measuring)). ## What it deliberately does not do The git side still asks everything of `origin`: Create PR's push, the sync light's fallback on a branch with no pull request, the stack walk, the compare page's owner. That is #143. The repositories looked in are read once at startup, so a remote added mid-session needs a restart (#145). The switcher's and Stack tab's list is still gh's base repository's alone. A branch with no open pull request still pays a second pass per repository on every poll. ## Verification All 500-odd tests pass on a96dc21, locally and in CI, the browser suite in Chromium and Firefox included; `PRCODER_PR=1 node tools/browser.mjs` in Firefox gives every line its expected value on the same commit. Against nodenorm-es, this tree's server with `cwd` there shows biothings#52 as current and synced. The two-pull-request case and the push-target rule are covered by fixtures only: no branch of this repo has two pull requests. Nothing is blocking. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Nothing runs the test suite on pull requests, so tests drift unnoticed: before #42, the POST set-ID test posted a body the handler rejects and had evidently not been run in some time. This PR adds a GitHub Actions workflow that runs every test that needs no Elasticsearch host on pull requests, pushes to
mainand manual dispatch. Closes #44.It is based on
mainand independent of #42 and #48, so it can merge in any order. Once #42 merges, the workflow also runstests/test_openapi.pywithout changes here.Calls worth overruling
tests/test_normalized_nodes.pyandtests/test_set_identifiers.pyquerysu10:9200, which GitHub can't reach; everything else uses fake or unreachable clients. A new test file therefore runs in CI by default, and one that needs the cluster has to be added to the skip list. A comment in the workflow says so.uv pip install -e ".[tests]", notuv sync/uv run, which fail to resolve the project untilrequires-pythonis raised (Raise requires-python to >=3.10 souv runcan resolve the project #43). Once that's fixed, the workflow can switch touv sync, ideally with a committed lockfile.What it deliberately does not do
Running the cluster tests in CI needs a fixture index in a service container or a reachable test cluster; see #19.
Verification
On 770aaa5,
actionlintpasses on the workflow, and its steps run in a fresh Python 3.12 venv (uv pip install -e ".[tests]", then the samepytestcommand) pass all of the 50-odd host-free tests onmain. The workflow's own run on this PR is the real check.🤖 Generated with Claude Code