-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
There was a problem hiding this 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
.
I just add the debug mode as well. It can be achieved by running either of the following commands:
|
* Disable the CDK deprecation warning in production but not in CI/debug mode | ||
*/ | ||
const disableCDKDeprecationWarning = () => { | ||
const isCI = process.env.CI && process.env.CIRCLECI; |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 Report
@@ 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 |
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
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.