-
Notifications
You must be signed in to change notification settings - Fork 525
Open
Description
Problem Statement
When users rename a git branch (e.g., from "master" to "main"), all existing features remain associated with the old branch name in their feature.json files. This causes features to disappear from the Kanban board UI because they are filtered by branchName field, which no longer matches the current branch.
Current Behavior
- User has features on "master" branch
- User renames branch to "main" (via
git branch -m master main) - All features still have
"branchName": "master"in their.automaker/features/*/feature.jsonfiles - Features disappear from Kanban board because branchName filter doesn't match
- User must manually update all feature.json files
Proposed Solution
When Automaker detects a branch rename operation (or when the user manually renames a branch), display a prompt:
🔄 Branch Rename Detected
Old branch: master
New branch: main
You have 26 features associated with the old branch.
Would you like to migrate these features to the new branch?
[Migrate All Features] [Keep on Old Branch] [Cancel]
Implementation Details:
- Detect branch renames through git hooks or UI workflow
- Scan
.automaker/features/*/feature.jsonfor matchingbranchName - Offer bulk migration with preview of affected features
- Update all matching features in a single transaction
- Log the migration for undo capability
User Stories
- As a developer, when I rename a git branch, I want my features to automatically move to the new branch name so I don't lose work
- As a developer, I want to be prompted before batch updates so I can review what will change
- As a developer, I want to see which features will be affected before confirming the migration
Acceptance Criteria
- Detect when user renames a branch (via git command or UI)
- Display dialog showing old branch, new branch, and count of affected features
- Allow user to preview list of features that will be migrated
- Provide "Migrate All", "Skip", and "Cancel" options
- Update all feature.json files transactionally (all or nothing)
- Show success/failure message with count of migrated features
- Handle edge cases (features on multiple branches, pending changes)
Alternative Approaches Considered
- Automatic migration without prompt: Too aggressive, user might not want all features migrated
- Manual per-feature migration: Too tedious when there are many features
- Background sync on startup: Could cause confusion if user has intentionally kept features on old branch
Implementation Notes
This could be implemented as:
- A git post-checkout hook that detects branch renames
- A UI flow in the branch management settings
- A CLI command:
automaker migrate-features --from=master --to=main
Related Issue: This enhancement pairs with issue #734, which prevents the root cause by defaulting new projects to "main" branch. However, this migration tool would still be valuable for users who:
- Rename branches for other reasons (feature branches, etc.)
- Have existing projects created before Git initialization defaults to 'master' branch instead of 'main' #734 is fixed
- Work with legacy codebases
Environment
- Automaker v0.14.0rc (also affects v0.13.0)
- Affects all platforms (Docker, Electron, Web)
Metadata
Metadata
Assignees
Labels
No labels