Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pulling with env append to local files #13227

Merged
merged 8 commits into from
Sep 27, 2023

Conversation

rtpascual
Copy link
Contributor

@rtpascual rtpascual commented Sep 15, 2023

Description of changes

Current behavior when running amplify pull --appId <appId> --envName <env> for an existing project is to move contents to a backup folder then create new local amplify files with the envName passed in as a pull parameter. This makes it seem like existing environments in the existing project are being overwritten by the new env pulled in.

To address this, some updates were made to copy the amplify directory to the backup directory instead of moving the contents which will eventually be deleted in the cleanup process when the backup folder is removed. This will allow the newly pulled env to be added to the existing envs in local-aws-info.json.

Issue #, if available

Description of how you validated changes

  1. Added e2e test and ran full e2e test suite
  2. Manual checks
    i. Observed amplify pull --appId <appId> --envName <envName> "overwrites" local-aws-info.json contents without fix
    ii. Observed doing the same as above with fix appends envName to local-aws-info.json contents

Before Change

  1. After initial amplify pull with appId and envName dev
Screenshot 2023-09-19 at 6 45 23 PM
  1. After second amplify pull with appId and envName devtwo
Screenshot 2023-09-19 at 6 47 03 PM

After Change

  1. After initial amplify-dev pull with appId and envName dev
Screenshot 2023-09-19 at 6 20 19 PM
  1. After second amplify-dev pull with appId and envName devtwo
Screenshot 2023-09-19 at 6 33 59 PM

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.

@rtpascual rtpascual marked this pull request as ready for review September 20, 2023 20:46
@rtpascual rtpascual requested a review from a team as a code owner September 20, 2023 20:46
@rtpascual rtpascual merged commit ef1c43f into aws-amplify:dev Sep 27, 2023
6 checks passed
@rtpascual rtpascual deleted the append-env branch September 27, 2023 16:49
Jshhhh pushed a commit to Jshhhh/amplify-cli that referenced this pull request Sep 27, 2023
* fix: pulling with env append to local files

* test: add e2e test

* chore: remove unneeded condition

* fix: revert prepareContext change

* test: update expected changed files

* test: change which dir to look for expected envs

* test: update method to add second env to projRoot
letsbelopez pushed a commit to letsbelopez/amplify-cli that referenced this pull request Sep 28, 2023
* fix: pulling with env append to local files

* test: add e2e test

* chore: remove unneeded condition

* fix: revert prepareContext change

* test: update expected changed files

* test: change which dir to look for expected envs

* test: update method to add second env to projRoot
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.

None yet

3 participants