feat(repo-cache): handle empty repositories - #27
Merged
AlexanderLanin merged 3 commits intoSep 4, 2026
Merged
Conversation
AlexanderLanin
requested review from
MaximilianSoerenPollak,
dcalavrezo-qorix and
nradakovic
as code owners
September 3, 2026 22:45
There was a problem hiding this comment.
🟡 Changes recommended
Policy reports mislabel empty repositories, and cached-checkout detection lacks regression coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds explicit handling for repositories without Git references across cache synchronization and policy evaluation.
Changes:
- Detects and reports empty repositories separately from failures.
- Skips empty repositories during policy evaluation.
- Adds CLI, documentation, and regression coverage.
File summaries
| File | Description |
|---|---|
repo_policy_sync/tests/test_runner.py |
Tests empty-repository skipping. |
repo_policy_sync/src/runner.py |
Excludes empty repositories from evaluation. |
repo_cache/tests/test_sync.py |
Tests empty synchronization outcomes. |
repo_cache/tests/test_cli.py |
Tests CLI empty-repository reporting. |
repo_cache/tests/test_checkout.py |
Tests initial empty-repository detection. |
repo_cache/src/sync.py |
Models and aggregates empty outcomes. |
repo_cache/src/errors.py |
Defines the empty-repository exception. |
repo_cache/src/cli.py |
Reports empty repositories and adjusted totals. |
repo_cache/src/checkout.py |
Detects missing Git references. |
repo_cache/README.md |
Documents empty-repository behavior. |
repo_cache/__init__.py |
Exports the new exception. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 3, 2026
MaximilianSoerenPollak
approved these changes
Sep 4, 2026
MaximilianSoerenPollak
left a comment
Contributor
There was a problem hiding this comment.
Seems alright.
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.
What this achieves
Repository synchronization now handles repositories with no Git references as an expected, reportable state. Organization-wide policy runs skip those repositories instead of attempting to use a checkout that does not exist.
Why this is necessary
Newly created or otherwise empty repositories can appear in the organization listing without a usable Git ref. Treating the resulting clone or fetch failure as an operational error either makes cache synchronization fail or causes the policy-sync consumer to evaluate a missing checkout.
Changes