Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI feature flags are ignored in the console build #3950

Open
2 tasks done
DeezNutz2 opened this issue Jul 3, 2024 · 4 comments
Open
2 tasks done

CLI feature flags are ignored in the console build #3950

DeezNutz2 opened this issue Jul 3, 2024 · 4 comments

Comments

@DeezNutz2
Copy link

How did you install the Amplify CLI?

No response

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

No response

Amplify CLI Version

12.12.4

What operating system are you using?

Amazon Linux 2 (via console)

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

No

Describe the bug

The solution provided here aws-amplify/amplify-category-api#2636
is to add features.graphqltransformer.subscriptionsInheritPrimaryAuth = true to cli.json.

Adding this (along with a schema whitespace change and adding some useless fields to be extra-sure) with amplify version 12.12.4 does not work if you just check it in and let console do a push.

You have to run "amplify push" from a computer.

Is there a way to pass this variable that un-bricks my app to the "amplifyPush --simple" command in my amplify.yml?

Also, since this undocumented breaking change seems to be breaking customer prod apps, will the COE be public?

Expected behavior

The solution provided should work in Amplify console

Reproduction steps

Redundant

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@AnilMaktala
Copy link
Member

Hey @DeezNutz2, Thanks for raising this. We are investigating this issue and will keep you posted on updates.

@AnilMaktala AnilMaktala changed the title Solution provided for 2636 does not work in console CLI feature flags are ignored in the console build Jul 22, 2024
@AnilMaktala AnilMaktala transferred this issue from aws-amplify/amplify-category-api Jul 22, 2024
@palpatim
Copy link
Member

Hi @DeezNutz2,

Do you have an Amplify app ID so we can troubleshoot exactly what commands are being executed during the build? What appears to be happening is that the cli.json is being overwritten during the build system's init/pull phase.

As you identified, the workaround for now is to do an amplify push for each branch and environment that you are building in CI/CD. That will sync the cli.json to the Amplify deployment bucket in S3. From then on, the cli.json file that the Hosting build system pulls from the Amplify deployment bucket will correctly have the feature flag enabled.

--T

@DeezNutz2
Copy link
Author

DeezNutz2 commented Aug 1, 2024

app id is d5i79jkckfr0q
we currently use a version of cli that is prior to this breaking change in ticket 2636.

we install jq to work around the cli's buggy handling of team-provider-info.json when it has more than like three or four backends.

        preBuild:
          commands:
            - echo "THIS IS THE GIT VERSION OF amplify.yml"
            - npm install -g typescript
            - yum install jq -y
            - which jq
            - pwd
            - ls
            - cat ../backend/amplify/team-provider-info.json
            - jq {"${USER_BRANCH}"} ../backend/amplify/team-provider-info.json
            - jq {"${USER_BRANCH}"} ../backend/amplify/team-provider-info.json > temp.json
            - cat temp.json
            - cat temp.json > amplify/team-provider-info.json
            - cat amplify/team-provider-info.json
            - echo "env"
            - env
        build:
          commands:
            - '# Execute Amplify CLI with the helper script'
            - amplifyPush --simple

As you identified, the workaround for now is to [ manually update every environment ]

Is this supposed to work without manually updating every environment or should this work from console?

Will the COE for 2636 be made public, as it broke builds for a lot of customers in prod?

@DeezNutz2
Copy link
Author

DeezNutz2 commented Sep 18, 2024

Guys, was that enough information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants