Skip to content

agents: remove worktree last and handle read-only output base files - #4497

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:cleanup_script_worktree_order
Nov 13, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:cleanup_script_worktree_order

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Read-only directories in Bazel output bases caused cleanup removal to
fail, while removing the Git worktree before branch deletion left the
workspace directory gone even when cleanup failed partway through.

Grant owner read/write/execute permissions across output base trees
without following symlinks before recursive removal, and reorder
cleanup to remove the Bazel output base, remote branch, and local
branch (detaching HEAD first) before deleting the Git worktree only
when all prior steps succeed.

Read-only directories in Bazel output bases caused cleanup removal to
fail, while removing the Git worktree before branch deletion left the
workspace directory gone even when cleanup failed partway through.

Grant owner read/write/execute permissions across output base trees
without following symlinks before recursive removal, and reorder
cleanup to remove the Bazel output base, remote branch, and local
branch (detaching HEAD first) before deleting the Git worktree only
when all prior steps succeed.
@rickeylev
rickeylev requested a review from aignas as a code owner November 13, 2026 17:16
@rickeylev

Copy link
Copy Markdown
Collaborator Author

This PR was authored with AI assistance. @rickeylev reviews and approves any
agent-assisted responses before they are posted or handles review comments
directly.

This is an automatically generated agent comment.

@rickeylev
rickeylev enabled auto-merge November 13, 2026 17:20
@rickeylev
rickeylev merged commit 8afd2b6 into bazel-contrib:main Nov 13, 2026
15 checks passed
@rickeylev
rickeylev deleted the cleanup_script_worktree_order branch November 13, 2026 19:05
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