Let forks and copies of the repository run the `CI` gate
This pull request was posted by Claude Code using claude-fable-5-2 on behalf of David.
Why we make these changes
A fork or other copy of this repository should be able to run the CI gate. Three parts of it assume they run in pydantic/pydantic-ai:
- Releases. A tag starts
deploy-docs,release-buildandrelease(PyPI trusted publishing), and a dispatch startsdeploy-docs-manual, in any repository. They now run only inpydantic/pydantic-ai. - Runners. Every Linux gate job names a GitHub runner, and the gate is sized for it: Pyright runs 3 workers with a 6 GB heap, and the
test-all-extrasshards fit 20 minutes with one xdist worker per CPU. A copy whose standard runners have 2 CPUs cannot pick bigger ones without editing the workflow.check, every Linux job it needs, and the jobs ofclai2-web.ymlandlatest-versions-canary.ymlnow read their label from theCI_LINUX_RUNNERrepository variable and fall back to today's label. - One test.
test_healthy_census_does_not_require_a_slack_mentionletmain()readGITHUB_REPOSITORY, which Actions sets to the running repository's name. Under any other name every case raisedKeyError, because the fake client answers onlypydantic/pydantic-aiqueries. It now pins the repository like its siblingmain()tests.
New public surface
None in the packages. CI gains the CI_LINUX_RUNNER repository variable, documented in .github/workflows/AGENTS.md.
User-visible behavior
quality:
- runs-on: ubuntu-latest
+ runs-on: ${{ vars.CI_LINUX_RUNNER || 'ubuntu-latest' }}
release:
- if: ${{ !cancelled() && github.ref_type == 'tag' && needs.release-build.result == 'success' }}
+ if: ${{ !cancelled() && github.repository == 'pydantic/pydantic-ai' && github.ref_type == 'tag' && needs.release-build.result == 'success' }}
In pydantic/pydantic-ai the guard is always true and CI_LINUX_RUNNER is unset, so every job runs as before on the same runner (ubuntu-24.04 for test-all-extras, ubuntu-latest for the rest). In a copy, a tag skips the release and docs-deploy jobs, and gh-aw-engine-pin and gh-aw-engine-pin-bump skip with release. check needs none of those jobs. GitHub passes no variables to a run for a pull request from a fork, so those runs keep the fallback labels.
clai2-bleeding.yml stays as it is: it deliberately lets a fork publish a clai2-bleeding prerelease to its own releases, for CLAI_BLEEDING_URL (#9872).
Verification
test_healthy_census_does_not_require_a_slack_mentionfails onmainwithGITHUB_REPOSITORY=someone/pydantic-ai-copyand passes with this PR; its whole file passes under that name.check-yamlandzizmorpass, and so do the tests that parseci.yml. This PR's own CI runs every gate job on its fallback label.
What changes for existing users
Nothing.
PR decisions
2026-11-10 · leave clai2-bleeding fork condition · iter -
- Decision: Keep 'github.ref == refs/heads/main || github.repository != pydantic/pydantic-ai' in clai2-bleeding.yml unchanged
- Why: Deliberate: a fork publishes its own clai2-bleeding prerelease to its own repo for CLAI_BLEEDING_URL
- Source: https://github.com/pydantic/pydantic-ai/pull/9872
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · guard release as well as release-build · iter -
- Decision: Add the repository guard to release (PyPI publish) directly, not only to release-build it needs
- Why: The job holding the PyPI OIDC credential stays guarded even if its needs chain changes
- Source: https://github.com/pydantic/pydantic-ai/tree/guard-release-jobs-to-upstream
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · post-release jobs inherit the skip · iter -
- Decision: No guard on gh-aw-engine-pin or gh-aw-engine-pin-bump
- Why: Both require needs.*.result == success on the guarded release chain, so they skip with it
- Source: https://github.com/pydantic/pydantic-ai/tree/guard-release-jobs-to-upstream
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · guard deploy-docs-manual too · iter -
- Decision: Add the repository guard to manually-deploy-docs.yml deploy-docs-manual
- Why: It is a docs-deploy job without the guard, and its comment says it must match ci.yml deploy-docs
- Source: https://github.com/pydantic/pydantic-ai/tree/guard-release-jobs-to-upstream
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 1 of 3 at 589ff8a0a0825cd29e61080d62af49f6c41b3222 · iter -
- Decision: dispatch reserved (light tier)
- Why: tree b213888902e36770dbdad8edce8589cc3fecd5c5; scope cc37d25c2bcba1ecaa8ec80614fac99142db7930..589ff8a0a; first review, full branch
- Source: https://github.com/pydantic/pydantic-ai/tree/guard-release-jobs-to-upstream
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 1 of 3 at 589ff8a0a0825cd29e61080d62af49f6c41b3222 · iter -
- Decision: no code findings; commit message corrected; amended commit e4d3878a872650cbbba31e2067e54ea4a5f1810f keeps the reviewed tree
- Why: tree b213888902e36770dbdad8edce8589cc3fecd5c5; scope cc37d25c2..589ff8a0a full branch
- Source: https://github.com/pydantic/pydantic-ai/tree/guard-release-jobs-to-upstream
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · extend PR to cover running the CI gate in a copy · iter -
- Decision: Add a configurable Linux runner label and the census test fix to PR 13030
- Why: Maintainer decision: one PR for everything a copy of the repository needs to run the CI gate
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · runner variable name and fallback · iter -
- Decision: runs-on: ${{ vars.CI_LINUX_RUNNER || '<today's label>' }} on check and every Linux job it needs, plus the jobs of clai2-web.yml and latest-versions-canary.yml
- Why: Unset vars evaluate to an empty string, so pydantic/pydantic-ai keeps ubuntu-latest / ubuntu-24.04; no repo or org-visible variable has this name; name follows the subsystem-prefixed UPPER_SNAKE vars
- Source: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · plain label, not a vendor expression · iter -
- Decision: Accept one static label; no run-id expression upstream
- Why: RunsOn documents static pool and fleet labels without github.run_id (runs-on/pool=small-x64, runs-on/fleet=linux-small/env=production)
- Source: https://runs-on.com/docs/runners/labels/
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · census test pins GITHUB_REPOSITORY · iter -
- Decision: Pin GITHUB_REPOSITORY=pydantic/pydantic-ai in test_healthy_census_does_not_require_a_slack_mention only
- Why: Reproduced: KeyError only when GITHUB_REPOSITORY names another repo (Actions sets it to the copy's name); CensusClient counts are keyed on pydantic/pydantic-ai; the two sibling main() tests already pin it
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · document the variable in workflows AGENTS.md · iter -
- Decision: Add a short section to .github/workflows/AGENTS.md
- Why: That file is where workflow configuration is documented; CONTRIBUTING.md covers local development only
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 2 of 3 at d120ec685bfd67c95e3aa26de46defb50735f039 · iter -
- Decision: dispatch reserved (light tier)
- Why: tree 6d5b3b36b8b64d826363ea02ceef08ef5de4c792; scope e4d3878a..d120ec68 (delta since reviewed tree b2138889), full branch as context
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 2 of 3 at d120ec685bfd67c95e3aa26de46defb50735f039 · iter -
- Decision: remediated: test-clai2-clipboard Linux leg now reads CI_LINUX_RUNNER (a44c40867); skipped CONTRIBUTING.md doc (net-neutral) and weekly digest note (scheduled workflow, out of scope)
- Why: tree 6d5b3b36b8b64d826363ea02ceef08ef5de4c792; scope e4d3878a..d120ec68
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 3 of 3 at a44c408678ca55effc40338ba27c6aa062a0abe7 · iter -
- Decision: dispatch reserved (light tier)
- Why: tree 755f16fc7b96dcc07daaa74e307ded35c988287f; scope d120ec68..a44c4086 (review 2 remediation), full branch as context
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · pre-push review 3 of 3 at a44c408678ca55effc40338ba27c6aa062a0abe7 · iter -
- Decision: no findings (current); review budget exhausted
- Why: tree 755f16fc7b96dcc07daaa74e307ded35c988287f; scope d120ec68..a44c4086; prior finding 1 verified fixed
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · exempt delta: merge main at c824535ab · iter -
- Decision: Push c824535ab without review: conflict-free merge of upstream/main 3ccfec13 onto reviewed a44c4086
- Why: git diff main...a44c4086 equals git diff main...HEAD except the AGENTS.md index blob line; chains from reviewed tree 755f16fc
- Source: https://github.com/pydantic/pydantic-ai/pull/13030
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
2026-11-10 · douwebot optional finding on c824535a addressed · iter -
- Decision: Doc now says CI_LINUX_RUNNER also moves clai2-bleeding's build and the nightly canary; pushed 90b1f5075 without local review
- Why: Review budget exhausted (3 of 3); doc-only delta in .github/workflows/AGENTS.md
- Source: https://github.com/pydantic/pydantic-ai/pull/13030#discussion_r4527608853
- Session: 75c5c90b-6b84-4bf9-be09-e7c9b1db5d12
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.