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

fix: suppress CDK deprecation warnings #931

Merged
merged 5 commits into from
Oct 26, 2022
Merged

fix: suppress CDK deprecation warnings #931

merged 5 commits into from
Oct 26, 2022

Conversation

AaronZyLee
Copy link
Contributor

@AaronZyLee AaronZyLee commented Oct 26, 2022

Description of changes

Disable the CDK deprecation warning msg. This will be removed once the migration to CDK V2 is complete. The msg can still be seen on the CI/debug environment.

Refer https://github.com/aws/aws-cdk-rfcs/blob/master/text/287-cli-deprecation-warnings.md#cdk-cli-deprecation-warnings

Issue #, if available

Description of how you validated changes

amplify-dev api gql-compile

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AaronZyLee AaronZyLee requested a review from a team as a code owner October 26, 2022 18:54
Copy link
Contributor

@phani-srikar phani-srikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one suggestion is to add a comment to say how to re-enable the warnings. This one works export JSII_DEPRECATED=warn.

@AaronZyLee
Copy link
Contributor Author

AaronZyLee commented Oct 26, 2022

LGTM! Just one suggestion is to add a comment to say how to re-enable the warnings. This one works export JSII_DEPRECATED=warn.

I just add the debug mode as well. It can be achieved by running either of the following commands:

amplify api gql-compile --debug
AMPLIFY_ENABLE_DEBUG_OUTPUT=true amplify api gql-compile

packages/amplify-category-api/src/index.ts Outdated Show resolved Hide resolved
* Disable the CDK deprecation warning in production but not in CI/debug mode
*/
const disableCDKDeprecationWarning = () => {
const isCI = process.env.CI && process.env.CIRCLECI;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a chance that customer is running CLI in headless mode in circle ci.
Is there any way to distinguish between our circle ci and other circle ci ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm it will be possible that the customer CI will have these outputs. I notice that the debug model also has a env param AMPLIFY_ENABLE_DEBUG_OUTPUT. I think the better way is to remove the CI env check in this line. And also in our CI pipeline, we can add this param in the environment to enable the output.

@codecov-commenter
Copy link

Codecov Report

Merging #931 (e60fe52) into main (fa513b5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #931   +/-   ##
=======================================
  Coverage   63.30%   63.30%           
=======================================
  Files         282      282           
  Lines       18377    18377           
  Branches     4461     4461           
=======================================
  Hits        11634    11634           
  Misses       6132     6132           
  Partials      611      611           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

phani-srikar
phani-srikar previously approved these changes Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants