feat: add worktree:scan CLI command and dashboard button#200
Draft
ropi-bc wants to merge 1 commit intogeodro:mainfrom
Draft
feat: add worktree:scan CLI command and dashboard button#200ropi-bc wants to merge 1 commit intogeodro:mainfrom
ropi-bc wants to merge 1 commit intogeodro:mainfrom
Conversation
… worktree rescan The file watcher detects new git worktrees automatically, but there was no way to manually trigger a full rescan — useful when worktrees were created while the watcher was down, or when vhosts need to be refreshed after config changes. - Extract shared `cli.ScanWorktrees()` from the private `scanWorktrees()` in the watch daemon so it can be reused by the new CLI command and UI handler - Add `lerd worktree:scan` CLI command that scans all registered sites, ensures worktree dependencies (vendor/, node_modules/, .env), mounts paths in podman, generates nginx vhosts, and reloads nginx - Add `POST /api/worktrees/scan` API endpoint with site event publishing - Add "Scan Worktrees" button to the Watcher panel in the dashboard UI - Refactor worktree vhost generation to accept `config.Site` instead of individual strings, enabling proxy and public dir detection for worktrees - Add `worktreeVhostData()` helper to reduce duplication between HTTP and SSL vhost generators Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
sorry, I was too eager to open the PR, and I see some issues with it. converted to draft and will reopen soon |
Owner
|
Hey, thanks for taking your time! Can you update your commit message and PR and remove "Generated with Claude Code" ? |
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.
Summary
lerd worktree:scanCLI command that manually triggers a full worktree rescan across all registered sites — detects worktrees, ensures dependencies (vendor/, node_modules/, .env), mounts paths in podman, generates nginx vhosts, and reloads nginxPOST /api/worktrees/scanAPI endpoint in the UI servercli.ScanWorktrees()function from the privatescanWorktrees()in the watch daemon, eliminating duplicationconfig.Siteinstead of individual strings, enabling proper proxy and public dir detection for worktrees via a newworktreeVhostData()helperWhy
The file watcher detects new git worktrees automatically via fsnotify + 30s polling, but there was no way to manually trigger a full rescan. This is needed when:
CLI usage
Test plan
lerd worktree:scanwith existing worktrees — verify vhosts are generated and nginx reloadslerd worktree:scanwith no worktrees — verify "No worktree vhosts to generate." messagescanWorktrees()path)🤖 Generated with Claude Code