Skip to content

Add feature migration prompt when renaming git branches #735

@JasonBroderick

Description

@JasonBroderick

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

  1. User has features on "master" branch
  2. User renames branch to "main" (via git branch -m master main)
  3. All features still have "branchName": "master" in their .automaker/features/*/feature.json files
  4. Features disappear from Kanban board because branchName filter doesn't match
  5. 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.json for matching branchName
  • 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

  1. Automatic migration without prompt: Too aggressive, user might not want all features migrated
  2. Manual per-feature migration: Too tedious when there are many features
  3. 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:

Environment

  • Automaker v0.14.0rc (also affects v0.13.0)
  • Affects all platforms (Docker, Electron, Web)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions