question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the correct way to update another environment from Feature Branch?

See original GitHub issue

Which 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.
  • However after doing a git checkout <feature-branch> followed by an amplify status, it showed no new API to push
    • Therefore amplify push did nothing and didn’t deploy the new API to their backend.

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:closed
  • Created 3 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
armenrcommented, Apr 10, 2021

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? 😃

0reactions
github-actions[bot]commented, May 24, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git Feature Branch Workflow | Atlassian Git Tutorial
Start with the main branch · Create a new-branch · Update, add, commit, and push changes · Push feature branch to remote ·...
Read more >
From “Feature branches” to “Feature environments ... - Env0
Running an environment for every feature branch, or every pull request, is firstly a matter of how you perceive your CD pipeline.
Read more >
PhpStorm - Apply changes from one Git branch to another
In the Commit details pane on the right, select the files containing the changes you want to apply to the target branch and...
Read more >
Re-thinking feature branch deployments
What I found works best, is to analyze the change being made, and if it is a new property, write the code assuming...
Read more >
Deploy your Application to Different Environments from ...
The workflow diagram in this case is completely different. All developers will work on the same Branch and they will include and enable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found