Repository navigation
ci(circleci): clone the public repo over HTTPS so main jobs stop failing at checkout - #49394
Conversation
…ing at checkout The project's SSH checkout key stopped authenticating on Oct 27, so every job's built-in checkout step failed with Permission denied (publickey). The repo is public, so each job now fetches its pipeline's commit anonymously over HTTPS, the way the migration jobs already did
[Medium impact] The reviewed changes appear safe to merge, with no new blocking findings SummaryThis PR replaces CircleCI's SSH checkout with an HTTPS fetch of the requested commit. It keeps history and retries failed downloads. The latest change adds No new actionable issues were found. The earlier behavior-test concern is addressed by tests that run the checkout command. After mateo-berri explained the existing shell-test practice, Greptile withdrew the request to move these tests out of
Reviews (7) · Last reviewed commit: "fix(circleci): fetch the routing parity ..." · Reviewed by Greptile |
This comment has been minimized.
This comment has been minimized.
…clone and test the clone step itself
…tch, and record the integration schedule The depth-1 clone left the PR path filter without a merge base, and the unshallow that fixed it pulled about 1.4 GB per filtered job. A blobless fetch gives every job the history the built-in checkout step gave, so the path filter change goes back to main's version. The fetch now gets three tries, the tests run the step under the Windows job's bare bash too, and .circleci/AGENTS.md records the integration schedule's cron
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…and name the GitHub App fallback as the cause
…ce a dropped download failed the job outside the retry
…since the blobless clone downloaded each file separately
|
bugbot run |
| for attempt in 1 2 3; do | ||
| git fetch --filter=blob:none origin "$revision" && git checkout --detach FETCH_HEAD && break | ||
| [[ $attempt -lt 3 ]] || exit 1 | ||
| sleep 5 |
There was a problem hiding this comment.
Retry checkout fails after partial write
Medium Severity
A failed git checkout can leave untracked files in the empty git init work tree. The next loop attempt runs git checkout --detach without --force, so git aborts rather than overwriting those files and the remaining retries die on the leftover tree instead of the original network error.
Reviewed by Cursor Bugbot for commit 582dc59. Configure here.
There was a problem hiding this comment.
Git fetches all missing files in one batch before writing any, so a failed download leaves no files. The file-drop proof shows the retry passing
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 582dc59. Configure here.


Since Oct 27 every CircleCI job on main fails at Checkout code with
Permission denied (publickey), because CircleCI lost its GitHub App access and falls back to a deploy key GitHub rejects. The repo is public, so this PR clones each job's commit anonymously over HTTPS instead. After merge I recreate the main integration schedule, deleted with the old pipeline definitionOriginal
TLDR
Problem this solves:
How it solves it:
checkout_over_httpscommand clones the commit anonymously over HTTPS, with history but no file contentscheckoutsteps, the migration checkout and the Windows wheel job (underbash.exe) use it--no-filter.circleci/AGENTS.mdrecords the integration schedule's cronDecisions
.gitgrows from 89M to 154M) and can fail on its own, and the third failed try ends the step on that errormain: every caller in.circleci,testsandlitellmonly runsgit rev-parse HEADCIRCLE_REPOSITORY_URL, which is the SSH form that fails. GitHub serves a fork's commits from that URL too, so a fork's own CircleCI still clones: the step checked out a fork commit 10 ahead of main with no PR, 7884a6b--no-filteron the routing parity base fetch: the fetch inherits the clone's blobless filter, sogit checkout <base> -- <paths>downloaded each file on its own, 210 s for a main base and 896 s for a stable-line base on the machine image's git 2.34, where--no-filtertakes 15 s and 10 striggers:block in config, since a workflow withtriggers:runs only on its schedule and would drop out of the API pipelines that setrun_migration_testsorrouting_parity_baseUser Flow
Before: a maintainer watching main's CircleCI sees every job fail before any test runs
git@github.com: Permission denied (publickey)and exits 128After: the same pipeline clones the commit and runs its tests
Pre-Submission checklist
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreScreenshots / Proof of Fix
Last updated: 582dc59. QA ran on 6306dea. Changes since QA:
--no-filteron the parity base fetch, its test, and an AGENTS.md line. Proof remains valid becausecheckout_over_httpsis byte-identical. Verification: the parity case below and the 17 checkout testsPR pipelines are off here, so each After case runs the step on a stand-in with no
~/.sshor git credentialsBefore (c7c895d)
c7c895db45's.circleci/is byte-identical to this PR's merge basebad98c4b02A machine job clones its commit
The other cases
Steps and output
After (6306dea)
A docker job clones its commit
docker run --rm -e CIRCLE_SHA1=a392a39627f51bf0369944556c22268ee8cffe83 -e REQUESTED_REVISION= cimg/python:3.12-browsers@sha256:b432899a... /bin/bash -eo pipefail checkout_step.sh, the docker jobs' image, shell and user:What the clone holds
git log -1 --format=%Hprintsa392a39627f51bf0369944556c22268ee8cffe83, main's tip,git rev-parse --is-shallow-repositoryprintsfalsewith 55660 commits of history in a 154M.git, and.circleci/config.ymlexistscimg/python:3.12@sha256:9c796c23...image the other 9 docker jobs use prints the same lines,exit=0 in 27s, the same sha, 55660 commits and a 154M.gitREQUESTED_REVISION=main(not a 40-character sha) printsexit=1and leaves the directory emptyA machine job clones its commit
Steps and output
ubuntu:22.04@sha256:076e7bf8..., the machine image's base, with its own git, as a non-rootcircleciuser in~/project:The Windows wheel job clones its commit
Steps and output
windows-2022GitHub Actions run writes the same step to a file and runsbash.exe <file>in an empty directory, likewindows_release_wheeldoes on CircleCI's Windows Server 2022 executor:A docs-only PR skips backend jobs
Steps and output
path_filter.sh backend, which this PR leaves as it is on main, withCIRCLE_PULL_REQUESTset:path-filter[backend]: running job (could not resolve a merge base against main)A commit GitHub does not have
Steps and output
CIRCLE_SHA1=0000000000000000000000000000000000000001. It tries the fetch three times and stops on the fetch's error, with no checkout after it:A file download that drops once
Steps and output
The routing parity job checks out its base (582dc59)
Steps and output
ubuntu:22.04@sha256:076e7bf8...with its own git clones main commit c4b01b2 with the step, then runs 582dc59's "Check out base product code" step without its built-library check, once for a main base and once for a stable-line base. A script then compares the three product directories with the base commit and runs the head step:--no-filter, exits 0 in 210s for the main base and 896s for the stable-line base, because git downloads each missing file separately. On thecimg/python:3.12image's git 2.53 it made 532 separate downloads in 311s for the main baseType
🚄 Infrastructure
✅ Test
Caveats (if any)
High
cimg/python:3.12images and awindows-2022runner stand in for the three executors, and the unit tests' Windows case runs Linux bashMedium
.circleci/AGENTS.mdrecordsLow
revision:input, and CircleCI's compile API shows each one passing todaytests/unit, like sibling script tests on mainuv.lockhas tooFinal Attestation
Bugbot summary