Skip to content

Conversation

@sai-ray
Copy link

@sai-ray sai-ray commented Oct 31, 2025

Description of changes

This PR implements working directory validation to ensure the git repository is in a clean state before proceeding with Gen 1 to Gen 2 migrations. The implementation adds a validateWorkingDirectory() method that uses execa to execute git commands, checking for uncommitted changes via git status --porcelain and unpushed commits via git log @{u}.. --oneline. When validation fails, it throws MigrationError with clear messaging to guide users on resolution steps. The implementation gracefully handles cases where no upstream branch is configured, allowing migrations to proceed in such scenarios.

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sai-ray sai-ray changed the title chore: implement validateWorkingDirectory for gen2 migration feat(gen2-migration): implement clean working directory validation for gen2 migration Oct 31, 2025
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