aws-amplify / aws-amplify/amplify-cli

Transfer from JS Discussions - I have been using multiple environments with amplify for a while now and there's one thing that bugs me. I'll illustrate this point with an example:

Open
#3,982 1 comment 0 reactions 0 assignees View on GitHub
feature-request ops-multienv p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

_Originally posted by @karrettgelley in https://github.com/aws-amplify/amplify-js/discussions/5425_

I have been using multiple environments with amplify for a while now and there's one thing that bugs me. I'll illustrate this point with an example:
Suppose you have a master and dev environment with amplify and a dev and master branch on git. The environments have both been initialized properly and do not have any resources associated with them. Now suppose I want to add an Auth resource on the dev branch/env with `amplify add auth, amplify push`. I test it out locally and then I want to merge these changes to master. So I `git checkout master, git merge dev, amplify env checkout master, amplify push`. Great, now the master environment has an auth resource. However, now my master branch on git has new changes! More specifically, the team-provider-info.json file has added a few lines indicating that the master environment has an auth resource now. If I simply amend these changes to the merge `git commit --amend`, my master branch will be updated properly, but now my dev branch is 1 commit behind master. I can fix this (probably by merging master into dev `git checkout dev, git merge master, git push`), but my git history is very odd now. And what if someone else pushed to dev before I can make this hotfix? This is a situation I face every time I want to add Storage, API, Auth, etc. to my app. It's wastes build minutes, introduces synchronization errors, and it's very annoying. Has anyone else noticed this, and if so, how did you fix it?

tldr How do you iteratively add aws resources without messing up team-provider-info.json?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.