aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Merge conflicts with multi-env with "amplify checkout env xxx" #13618

Open OperationalFallacy opened 6 months ago

OperationalFallacy commented 6 months ago

Amplify CLI Version

12.10.1

Question

There is a file cli-input.json that contains oAuthMetadata, with CallbackURLs and LogoutURLs props

Those properties are different for each environment. Which is causing conflict when switching "env" branches and merging changes between them.

Is there a way to avoid constant merge conflicts?

The workaround I'm using is to keep separate config files, cli-inputs-dev.json and copy them over when applying changes. Not very convenient.

Thanks!

edwardfoyle commented 6 months ago

Hi @OperationalFallacy, unfortunately there isn't currently a mechanism for parameterizing those values between environments. What you are currently doing is probably the best workaround (although I agree it's clunky). Marking this as a feature request.

OperationalFallacy commented 6 months ago

Wanted to add to the list of checkout griefs The checkouts of front-end is even more complicated with dedicated environments in separated accounts

  1. the amplify env checkout doesn't work because standalone front-end dir (not backend edits there)
  2. I have to do "amplify pull --appId xxx --envName prod", because its different aws accounts for environments
  3. that pull tries to overwrite Amplify Studio UI settings, which I had to keep in one env, because they can't be synced
  4. and finally, similarly to the problem with cli-inputs, it overwrites amplifyconfiguration.json which is again env specific