Skip to content

feat(git): gate readiness on prewarming the most-cloned repos#299

Draft
worstell wants to merge 2 commits intomainfrom
feat/git-warm-cache-readiness
Draft

feat(git): gate readiness on prewarming the most-cloned repos#299
worstell wants to merge 2 commits intomainfrom
feat/git-warm-cache-readiness

Conversation

@worstell
Copy link
Copy Markdown
Contributor

@worstell worstell commented May 7, 2026

Adds prewarm-most-cloned-repos to the git strategy. When > 0, /_readiness stays false until that many of the most-cloned repos (per the per-repo histogram, summed over the last 14 days) are cloned or freshened locally. 0 (default) disables.

Empty histogram, nil metadata store, or per-repo failures are logged and treated as complete so a misconfig or one bad upstream cannot brick a deploy. Missing SetMetadataStore wiring keeps readiness closed (loud failure).

Includes a metadatadb fix: MemoryBackend.Query lazy-created the namespace under a read lock, racing with concurrent Apply on other namespaces. Surfaced by -race once the prewarm pass and the histogram reaper ran concurrently.

Query held RLock while m.ns() wrote to m.state on first access for a namespace, racing with concurrent Apply on other namespaces. Read the map directly; queryState handles a nil namespace map.
@worstell worstell force-pushed the feat/git-warm-cache-readiness branch from 9839a22 to b0b0fb3 Compare May 7, 2026 23:32
@worstell worstell changed the title feat(git): gate readiness on warming top-N most-cloned repos feat(git): gate readiness on prewarming the most-cloned repos May 7, 2026
Add prewarm-most-cloned-repos to the git strategy. When > 0, /_readiness stays false until that many of the most-cloned repos (per the per-repo histogram, summed over the last 14 days) are cloned or freshened locally.

Empty histogram, nil metadata store, or per-repo failures are logged and treated as complete so a misconfig or one bad upstream cannot brick a deploy. Missing SetMetadataStore wiring keeps readiness closed.
@worstell worstell force-pushed the feat/git-warm-cache-readiness branch from b0b0fb3 to 84b4d69 Compare May 7, 2026 23:34
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.

1 participant