Skip to content

fix: make git cleanliness check look at parent repos to avoid errors when mlops not run from repo root#186

Open
samdporter wants to merge 1 commit into
mainfrom
fix_git_check_ignores_parent_dirs
Open

fix: make git cleanliness check look at parent repos to avoid errors when mlops not run from repo root#186
samdporter wants to merge 1 commit into
mainfrom
fix_git_check_ignores_parent_dirs

Conversation

@samdporter

Copy link
Copy Markdown

Fix git check failing when using mlops run from a subdirectory.

Issue:
Repo(self.project_path) only inspected exact path, so launching from a daughter directory raised InvalidGitRepositoryError even with a clean tree.

Proposed fix:
Adding search_parent_directories=True argument checks whole repo for .git, regardless of the launch directory.

Copilot AI review requested due to automatic review settings June 8, 2026 15:59
@samdporter samdporter requested review from Copilot and mikewoodward94 and removed request for Copilot June 8, 2026 15:59

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.

Pull request overview

This PR fixes the Git cleanliness check in Experiment.check_dirty() so it works when mlops run is executed from a subdirectory within a Git repository, by allowing GitPython to locate the repository root in parent directories.

Changes:

  • Update GitPython Repo(...) initialization to search parent directories for .git, preventing InvalidGitRepositoryError when invoked from a daughter directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
mlops
   Experiment.py1754177%24, 54–59, 83, 88–89, 110, 112, 117, 173–184, 207–221, 240, 242–243, 291–292, 296–300, 304–305, 312–313
   ProjectFile.py23196%41
   cli.py551769%19–22, 36, 59–66, 86–88, 96–99, 107–108, 113
mlops/release
   Release.py33779%24, 28, 33–38
mlops/release/destinations
   ReleaseDestination.py9189%18
   SharepointDestination.py6267%12–13
   ZenodoDestination.py331942%21–25, 29–35, 43–60
mlops/release/sources
   MLFlowSource.py13654%13–14, 21–27
   ReleaseSource.py14286%14, 23
mlops/utils
   Config.py17170%1–24
TOTAL41511373% 

Tests Skipped Failures Errors Time
17 0 💤 0 ❌ 0 🔥 6m 46s ⏱️

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.

2 participants