Skip to content

feat(repo-cache): handle empty repositories - #27

Merged
AlexanderLanin merged 3 commits into
eclipse-score:mainfrom
etas-contrib:repo-cache-empty-repositories
Sep 4, 2026
Merged

feat(repo-cache): handle empty repositories#27
AlexanderLanin merged 3 commits into
eclipse-score:mainfrom
etas-contrib:repo-cache-empty-repositories

Conversation

@AlexanderLanin

Copy link
Copy Markdown
Member

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

  • Detect empty repositories during initial clone and cached-checkout refresh.
  • Expose empty outcomes separately from synchronization failures.
  • Report empty repositories in the cache CLI and library documentation.
  • Skip empty outcomes in policy synchronization and keep summary counts accurate.
  • Add regression coverage for detection, reporting, and downstream policy handling.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread repo_cache/tests/test_checkout.py
Comment thread repo_policy_sync/src/runner.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Empty outcomes are consistently detected, propagated, reported, skipped, and covered by regression tests.

Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems alright.

@AlexanderLanin
AlexanderLanin merged commit ef77d8d into eclipse-score:main Sep 4, 2026
3 checks passed
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.

3 participants