What is the correct way to update another environment from Feature Branch?
See original GitHub issueWhich Category is your question related to? Deployments with Feature Branches.
I may be doing something wrong, but after reading the docs, I’m still not clear if I am doing anything wrong or have wrong expectations possibly because the docs aren’t clear enough?
So I’ve created this question to verify this.
Amplify CLI Version 4.18.0
What are you attempting to do?
- We have a multi-developer React Native Amplify Project setup.
- We have 2 backend environments initially deployed from
master
which just has Auth added. - Developer A created a new feature branch and added an AppSync API Category to the backend
- They pushed it to their own backend environment successfully.
- After testing they created a Pull Request for review
- Developer B attempted to checkout the feature branch containing the AppSync API and update their own backend environment to deploy the new API contained in the Feature Branch
- Developer B’s backend environment was last deployed from
master
and so didn’t previously have the API component.
- Developer B’s backend environment was last deployed from
- However after doing a
git checkout <feature-branch>
followed by anamplify status
, it showed no new API to push- Therefore
amplify push
did nothing and didn’t deploy the new API to their backend.
- Therefore
Current Resolution
The only way amplify status
would show the new API checked in under the Feature Branch after checking out the Feature Branch was to do an amplify init
from that Feature Branch even though amplify init
was previously run earlier whilst on the master
branch (which doesn’t contain the new API configuration).
Expected Behavior
From reading the docs, especially the Environments and Teams section of the docs, I expected to be able to simply checkout the feature branch and do an amplify status
and see the changes checked into the feature branch but not in the current environment.
See below for more detail:
Developer A
git clone ...
amplify init # Create new developerAEnvironment
amplify push # Push new developerAEnvironment to create new backend environment
# Currently backend just has an Auth category deployed
git checkout -b dev-a-branch
amplify add api ...
amplify push
# Now this backend environment also has an API category deployed
git add -A
git commit -m "Look at my new GraphQL API!"
git push -u ...
So far so good up to this point…
Developer B
git clone ...
amplify init # Create new developerBEnvironment
amplify push # Push new developerBEnvironment to create new backend environment
# Currently backend just has an Auth category deployed
git checkout dev-a-branch
amplify status
# Expect to see new API category to deploy from the API config checked into dev-a-branch
# Don't see any API category to deploy
amplify init # Again. Once again select the existing developerBEnvironment
amplify status
# Now see the new API category how up in 'Create' status, so can now push
amplify push
# New API category gets deployed to developerBEnvironment as expected
# Just didn't expect to have to do the 'amplify init' a second time above
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (4 by maintainers)
I’m still unclear on something -
Here’s what I’ve done:
1 - Check out new feature branch (from staging to --> staging/myfeatureBranch) in git 2 - Create new env once checked out 3 - Add auth, add storage, add functions 4 - push code + amplify push
Now, I am ready to merge my feature branch
I go merge my code after reviewing the PR.
Now I am checked back into “staging” branch in Git
How do I merge my BACKEND changes into the “staging” backend? 😃
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels for those types of questions.