github-actions[bot] opened a new pull request, #75093:
URL: https://github.com/apache/airflow/pull/75093

   * Clean up deleted worktrees' Breeze resources automatically
   
   Worktrees created by coding agents are often deleted without anyone running
   `breeze down`, so their containers kept using CPU and memory until some later
   Breeze command happened to run the stale-worktree sweep in another checkout.
   A small detached watcher, started by the first Docker-backed command in a
   worktree, now removes the resources shortly after the directory disappears.
   
   The sweep decided staleness by checking the path on the local filesystem,
   which removes another machine's resources when a Docker daemon is shared.
   Resources now record the host that created them, and only that host treats
   them as stale.
   
   Worktrees with the same directory name in different locations or clones
   shared one Compose project, so the default project name now includes a short
   hash of the worktree path.
   
   Isolation can be switched off for all worktrees of a checkout with
   `breeze setup config --no-worktree-isolation` or BREEZE_WORKTREE_ISOLATION,
   and `breeze down` lists other worktrees that still hold resources. ADR 0019
   records the reasoning behind per-worktree isolation as a whole.
   
   Generated-by: Claude Opus 5
   
   * Detect deleted worktrees by their git link and use a stable host id
   
   Address review feedback on the worktree watcher and the stale-worktree sweep:
   
   - Judge a worktree deleted by its .git link to the main repository, not by 
its
     path, so leftover bind-mount directories (Docker Desktop on macOS) and a
     failed git worktree remove are detected.
   - Share that check between the watcher and the sweep.
   - Label resources with a random host id stored in ~/.config/breeze/host-id
     instead of the host name, which macOS can change.
   - Regenerate the setup config image after rebasing.
   
   Generated-by: Claude Opus 5
   
   * Keep worktree cleanup working across isolation and host id changes
   
   - Start the worktree watcher on a best-effort basis: an unwritable lock file
     or a failed process start warns instead of aborting the command.
   - Make breeze down select this worktree's resources even after worktree
     isolation was disabled.
   - Treat resources labelled with the current host name as local, so those
     created before the host id was stored, or with the host-name fallback, are
     still swept.
   
   Generated-by: Claude Opus 5
   
   * Keep worktree resources when the main checkout is moved
   
   Moving or renaming the main checkout takes every worktree's gitdir with it, 
so each worktree looked deleted and the watcher and the stale-worktree sweep 
would remove all their containers and volumes. A missing gitdir now only means 
a deleted worktree while the main repository's .git is still there.
   (cherry picked from commit e0c54d330d08410926a986d50aea4af9ebd3aa1e)
   
   Co-authored-by: Jarek Potiuk <[email protected]>
   Generated-by: Claude Opus 5


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to