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 820 forks source link

unnecessary feature flag check on `amplify version`, `upgrade`, and `uninstall` #10514

Open josefaidt opened 2 years ago

josefaidt commented 2 years ago

Before opening, please confirm:

How did you install the Amplify CLI?

pnpm

If applicable, what version of Node.js are you using?

v16.14.2

Amplify CLI Version

8.2.0

What operating system are you using?

mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

Amplify Categories

Not applicable

Amplify Commands

Not applicable

Describe the bug

josef ~/D/p/a/r/my-project
> amplify upgrade
πŸ›‘ Invalid feature flag configuration

πŸ›‘ These feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:
- graphqltransformer.usefieldnameforprimarykeyconnectionfield

πŸ›‘ This issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.

πŸ›‘ Learn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags

josef ~/D/p/a/r/my-project
> amplify version
πŸ›‘ Invalid feature flag configuration

πŸ›‘ These feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:
- graphqltransformer.usefieldnameforprimarykeyconnectionfield

πŸ›‘ This issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.

πŸ›‘ Learn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags

josef ~/D/p/a/r/my-project
> amplify uninstall
πŸ›‘ Invalid feature flag configuration

πŸ›‘ These feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:
- graphqltransformer.usefieldnameforprimarykeyconnectionfield

πŸ›‘ This issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.

πŸ›‘ Learn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags

Expected behavior

no feature flags checks are made and command is able to proceed

Reproduction steps

  1. with the latest version of the CLI, create a new project with amplify init -y
  2. add an unknown feature flag to amplify/cli.json
  3. run amplify version, upgrade, or uninstall
  4. observe error

GraphQL schema(s)

```graphql # Put schemas below this line ```

Log output

``` # Put your logs below this line ```

Additional information

No response

InnovateWithEric commented 2 years ago

The Invalid feature flag (FF) configuration is happening because an older version of Amplify is seeing an unknown feature flag (which has come from a newer version of CLI) and bailing. There is separate work in flight now to change how CLI handles unknown FF. That change will look at the FF and only raise an error if it is not FALSE (all new FF will be worded to be compatible with previous versions when set to FALSE). With that change, the commands listed here would work fine as long as FF is FALSE.

Keeping this issue as a feature-request to not check for FF at all on those commands.

manu2504 commented 1 year ago

Hi @Straubulous , is there any update on this bug fix by any chance? By mistake I opened https://github.com/aws-amplify/docs/issues/4561 in another repo, related to the exact same issue.

This bug only has made me waste hours, and I'm just one in many developers happening to use Amplify with various environments. Cannot debug a software that does not allow me to know what version it is using...

manu2504 commented 1 year ago

I am blocked... in a vendor lock-in spiral, it seems. The next task on my team's backlog is "transition away from AWS Amplify", unless the Amplify team is happy to fix this nonsensical bug, that causes headaches to its paying customers.