Fix secondary runs cleanup issue on windows - #758
Merged
Sun Haoran (haoranpb) merged 3 commits intoJul 29, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes read-only directory cleanup to support repeated Windows runs.
Changes:
- Adds a reusable
remove_treeoperation. - Uses it for repository cloning and NL2AL cleanup.
- Extends clone cleanup testing with a read-only file.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_git_operations.py |
Adds read-only clone cleanup coverage. |
src/bcbench/operations/git_operations.py |
Uses centralized cleanup before cloning. |
src/bcbench/operations/filesystem_operations.py |
Implements read-only tree removal. |
src/bcbench/operations/__init__.py |
Exports the new operation. |
src/bcbench/evaluate/nl2al.py |
Reuses centralized cleanup logic. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/test_git_operations.py:240
- This does not exercise the Windows-specific recovery path in CI. On Ubuntu, a read-only file can still be unlinked from a writable parent, so this test also passes with the previous plain
shutil.rmtree; the repository's pytest job runs only onubuntu-latest(.github/workflows/CI.yml:18). Add a Windows test job or a platform-independent test that forcesrmtreeto invoke theonexccallback, otherwise the regression fix remains unverified.
stale_file.chmod(0o444)
Sun Haoran (haoranpb)
enabled auto-merge (squash)
July 29, 2026 06:14
Magnus Hartvig Grønbech (Groenbech96)
approved these changes
Jul 29, 2026
Sun Haoran (haoranpb)
deleted the
fix/secondary-run-fails-during-dir-cleanup
branch
July 29, 2026 06:22
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.
We clone plugin repos during runtime, the secondary run will have to delete the previously cloned git repo.
On windows this fails due to permission issues: https://stackoverflow.com/questions/1213706/what-user-do-python-scripts-run-as-in-windows.
We had similar problems before in nl2al, move the cleanup logic into operations utilities.
In order to catch similar issues in tests,
lint and testjob now run on both ubuntu and windows