Repository navigation
Description
Problem Description
In the first 8 seconds after a Service start, the rounds of the private repositories fail at git fetch with remote: Repository not found. Later rounds of the same repositories pass. Each failed round loses one cycle of its rows.
Evidence
- Release 0.130.0. The new pod became ready at 2026-11-13 18:02:05Z.
- From 18:02:25Z to 18:02:33Z, Loki has 4 ERROR lines from
devops_cli.server.service: "Service job execution failed for : Roadmap jobs failed: : git fetch --prune origin failed: remote: Repository not found." They come from 2 private Service repositories and the rows refine, stage and implement. - The traceback shows
run.pyensure_checkoutcalling_default_branchcallinggit fetch --prune origin, exit 128. - Loki has 0 such lines in the 7 days before this start, and 0 between 18:02:40Z and 18:35Z. In that time, each of the two repositories passed 4 later rounds.
- The public repositories did not fail. A fetch of a public repository needs no credential.
Cause (to confirm)
The Service gets a github.com credential for git from gh auth git-credential (config/constants.py, the credential.https://github.com.helper values). Either the credential that the helper reads is not ready in the first seconds of the process, or it holds a token that is not valid for these repositories yet. GitHub answers a request with no valid credential on a private repository with "Repository not found".
Proposed Fix
- Find which credential the first rounds use, and when the Service makes it.
- Make the credential before the first round starts, or make the first round of each repository wait for it.
- Do not add a blind retry of
git fetch. - If an outside timing limit blocks the fix, classify this failure as infrastructure, so that it does not count against a job.
Acceptance Criteria
- A test starts the Service loop with a credential source that is not ready at first. The first round of a private repository waits for the credential, or reports an infrastructure class, and does not fail with
Repository not found(devops ci fail-to-pass). - After the next release, Loki shows 0
Repository not foundlines in the first 5 minutes of the new pod.
Alternatives check of 2026-12-01: none.
Tool: none found.
Reason: The searches found no library that gates a first git fetch on per-repository credential readiness. gh gives only a probe and tenacity only a wait; neither classes the failure as infrastructure, and the reply shows the same token worked minutes later.
Lacks:
- No library detects per-repository credential readiness
- No tool classes a credential failure as infrastructure
- No gate before the first git network operation
- No library caches a readiness result for the process
Proposed design
Problem statement
A new Service pod runs its first private-repository rounds before the GitHub git credential is ready. git fetch then fails with remote: Repository not found, and each failed round loses one row cycle. The fix adds a bounded, repository-scoped credential readiness gate before the first git network operation. If the credential stays unready, the round gets the infrastructure class and does not count as a job failure.
Acceptance criteria
Requirement: Credential gate before first fetch
The checkout SHALL wait for a repository-scoped git credential before the first git network operation of a repository.
Scenario: Late credential on a private repository
- WHEN a test starts the Service loop with a fake credential source that is not ready for the first two polls
- THEN the first private round records no
git cloneorgit fetchbefore readiness, records one fetch after it, and reports noRepository not founderror.
Requirement: Repository-scoped credential check
The default credential source MUST prove access to the named repository before the first fetch.
Scenario: Credential check calls the repository API
- WHEN a test runs the default source with a fake
ghrunner forowner/repo - THEN the fake runner receives
gh api repos/owner/repo --jq .idbefore the checkout runsgit cloneorgit fetch.
Requirement: Bounded wait then infrastructure class
The checkout SHALL classify a credential that stays unready after the wait limit as infrastructure, not as a job failure.
Scenario: Unready credential after the wait limit
- WHEN a test runs
ensure_checkoutwith a fake source that never becomes ready and a wait limit of two polls - THEN the checkout raises the infrastructure-class error, increments no job-failure count, and its text does not say
Repository not found.
Requirement: No blind fetch retry
The checkout MUST NOT repeat git fetch to recover from a missing credential.
Scenario: No retry after a credential error
- WHEN a test runs
ensure_checkoutwith a ready credential source, an existing clone, and a fake git runner that returns exit 128 withremote: Repository not found - THEN the fake runner records one fetch call, and the checkout raises the infrastructure-class error.
Requirement: Cached credential readiness
The checkout SHALL cache a successful repository credential check for the process lifetime.
Scenario: Second checkout skips the readiness probe
- WHEN a test runs two checkouts for the same repository with a fake credential source that becomes ready on the first poll
- THEN the fake source records one readiness check, and both checkouts run their
git fetch.
Existing Tool Considered
The alternatives check in the issue body (2026-11-17) records verdict none and no tool. The change builds a small internal readiness gate in the Service. Estimated written cost: about 6k-10k tokens to build, about 2k-4k tokens per year to keep and fix, and 1-2 elapsed days.
Key questions
- Which credential path does the failing private fetch use?:
ensure_checkoutcalls_default_branch, and_default_branchrunsgit fetch --prune origin. Git gets its github.com credential from thecredential.https://github.com.helpervalues insrc/devops_cli/config/constants.py, which delegate togh auth git-credential. [sources: src/devops_cli/roadmap/run.py:477, src/devops_cli/roadmap/run.py:494, src/devops_cli/config/constants.py] - Should the first round wait for credential readiness or retry
git fetch?: Wait for a repository-scoped credential readiness check before the first fetch. Do not retrygit fetch. (best practice) [sources: src/devops_cli/roadmap/run.py:477, src/devops_cli/roadmap/run.py:494]- Chosen: Readiness gate before the first fetch. It prevents the first failed fetch and matches the observed startup window.
- Rejected: Blind retry of
git fetch. It hides the cause, repeats the same failing call, and the issue rejects it. - Rejected: Fail the row on the first 128. It loses a row cycle and counts a credential race as a job failure.
- Where should the readiness gate live?: At the start of
ensure_checkout, before it clones or calls_default_branch, with an optionalCredentialSourceparameter. This covers each roadmap job that makes a checkout and gives the checkout test a seam. (best practice) [sources: src/devops_cli/roadmap/run.py:494, src/devops_cli/roadmap/run.py:477, tests/roadmap/test_roadmap_run_checkout.py, openspec/specs/roadmap-service-lanes/spec.md:46]- Chosen: Gate at the start of
ensure_checkout. It covers clone and fetch, and the checkout test already covers this path. - Rejected: Gate only in Service startup. It misses other callers and a later lane start.
- Rejected: Gate inside
_default_branch. It misses clone and has only the clone directory, not the repository name.
- Chosen: Gate at the start of
- How should the gate prove that the credential can reach the repository?: The default
GhCredentialSourcecallsgh api repos/<owner>/<repo> --jq .idwith the helper token. A success proves repository access. A 404 or auth error means not ready. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/run.py:494]- Chosen:
gh api repos/<owner>/<repo>. It checks repository access without anothergit fetch. - Rejected:
git credential fillonly. It shows a credential exists but not that it can reach the repository. - Rejected:
git ls-remote. It repeats the network path that the gate protects.
- Chosen:
- What is the wait limit, and what result follows when it expires?: Wait up to 60 seconds, polling every 1 second. If the source is still not ready, raise the infrastructure-class error and do not count the attempt as a job failure. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/run.py:494]
- Chosen: 60 s bounded wait, then infrastructure class. The issue records failures from 18:02:25Z to 18:02:33Z, so 60 seconds gives margin.
- Rejected: Wait forever. It can hold a lane with no end.
- Rejected: Fail the job at once. It counts a startup race as a job failure and loses a row cycle.
- How does the test simulate an unready credential source?: Add an optional
CredentialSourceparameter toensure_checkout. Tests pass a fake source that is not ready for the first two polls and a fake git runner that records each command. (best practice) [sources: tests/roadmap/test_roadmap_run_checkout.py, src/devops_cli/roadmap/run.py:494]- Chosen: Inject a fake credential source. It tests the wait and the infrastructure class with no network or live token.
- Rejected: Monkeypatch
ghin the test. It couples the test to the helper process and is less deterministic. - Rejected: Use a live private repository. It needs a secret and is not an offline test.
- Should the gate skip public repositories?: No. The gate runs once before the first git network operation of each repository and caches a success for the process lifetime. The checkout has no private flag, so a public repository also waits when the credential is not ready. (best practice) [sources: src/devops_cli/roadmap/run.py:494, openspec/specs/roadmap-service-lanes/spec.md:46]
- Chosen: Gate all repositories and cache success. The checkout has no private flag, and the first check is cheap after success.
- Rejected: Detect private first. The checkout has no private flag, and detection needs the same credential.
- Rejected: Gate only private repositories. The checkout cannot tell private from public before the fetch.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both involve a GitHub credential being unavailable at the moment git needs it, but #4940 is a timeout on a loaded host while this is a startup race on a new pod.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: Searches turned up no tool that gates a git credential on readiness; the returned pages were generic web docs. The fix is an internal startup ordering gate in the Service's own code, which no external library provides.
Tool: none found
Lacks:
Searches (10)
Searches run:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 86358b6 (see proposed design in issue body).
Moved to new items: #6276.
dan-petty commentedon Nov 21, 2026
The premise of the proposed cause does not hold. The evidence points to a delay on the GitHub side, and no code change of the kind the body proposes is justified by it.
Evidence (Loki, pod of v0.130.0, 2026-11-13; these are the only "Repository not found" lines in the 9 days that Loki holds):
git fetch --prune originfailures with "remote: Repository not found", for the two private repositories.Probe: a
git ls-remoteof the private repository with no credential fails with "could not read Username for 'https://github.com': terminal prompts disabled", not with "Repository not found". So the failed fetches sent a credential that GitHub accepted, but that had no access to the repositories in its first seconds. A failed first mint, or a fetch with no token, does not fit this text.Cost: one lost round of each private repository at one Service start, in 9 days. A check after each mint, or a wait, would be code that compensates for a GitHub delay that no document confirms. A person can reopen this item if the case comes back.
A separate defect from the same audit, the silent window with no token after a failed lookup, has its own item.