-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(core): allow validation report multi-write based on context keys #34927
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
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.
(This review is outdated)
|
Exemption request for integration test / snapshot requirement This change adds functionality inside the core package’s synthesis class. There does not seem to be an integration test file that specifically targets this. A new test just to hit Given that the validation report output does not affect synthesized templates directly, I believe an integration test is unnecessary in this case. |
iliapolo
left a comment
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.
Nice! Thanks for this.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Reason for this change
It would be helpful to have more options around how the validation report is output. Currently the pretty print and JSON formatted file options are mutually exclusive. This pull request allows both to be used.
The primary driver is to allow users to see their report results in a human-readable format while also having an output artifact that can be consumed by other CI/CD tools.
Description of changes
It is now possible to print multiple validation report formats. I added a new context key
@aws-cdk/core:validationReportPrettyPrintboolean that prints the validation report to the console whentrue. I have made this valuetrueby default so that users today maintain the same behavior they expect. Setting the existing@aws-cdk/core:validationReportJsonkey still results in only JSON formatted output. Users may now select both options by enabling both keys.Rather than a pretty print context key, I considered implementing a
@aws-cdk/core:validationReportBothkey but this seemed to assume there would not be another format option added. It would allow the JSON format key to also keep its current behavior but the tradeoff of both report types appearing for those who only provide the JSON key seemed like a reasonable trade for keeping the report formats open for additional options in the future.Describe any new or updated permissions being added
N/A
Description of how you validated changes
I have added unit tests that validate my changes.
Checklist
EDIT
Following review suggestions the logic has been updated such that:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license