feat(cloud-assembly-schema): add policy validation report schema types#1515
Open
kaizencc wants to merge 1 commit into
Open
feat(cloud-assembly-schema): add policy validation report schema types#1515kaizencc wants to merge 1 commit into
kaizencc wants to merge 1 commit into
Conversation
Define the JSON schema types for `policy-validation-report.json` in the shared cloud-assembly-schema package. This file is written by aws-cdk-lib during synthesis and consumed by toolkit-lib's validate command. Having the types in the shared contract prevents drift between producer and consumer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1515 +/- ##
=======================================
Coverage 88.09% 88.09%
=======================================
Files 75 75
Lines 10721 10721
Branches 1465 1465
=======================================
Hits 9445 9445
Misses 1248 1248
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kaizencc
added a commit
that referenced
this pull request
May 14, 2026
…lidate Instead of redefining the policy validation report types locally, import them from @aws-cdk/cloud-assembly-schema (added in PR #1515). This removes ~130 lines of duplicate type definitions and simplifies the validate method to a typed cast instead of manual field mapping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Define the JSON schema types for
policy-validation-report.jsonin the shared cloud-assembly-schema package. This file is written by aws-cdk-lib during synthesis and consumed by toolkit-lib's validate command. Having the types in the shared contract prevents drift between producer and consumer.Corresponding types in aws-cdk-lib
These schema types mirror the structures defined in aws-cdk-lib:
packages/aws-cdk-lib/core/lib/validation/validation.ts—IPolicyValidationPluginBeta1,PolicyViolationBeta1,PolicyViolatingResourceBeta1packages/aws-cdk-lib/core/lib/validation/private/report.ts— report formatting and JSON serializationSchema sufficiency for RFC 899
We evaluated whether schema changes are needed to support CDK Comprehensive Validation (RFC 899) and its proposed output format. The existing schema is sufficient — all data required by the RFC is either already present or derivable at display time:
PolicyViolationJson.severityis already present. CLI groups violations by severity at display time. Defaults to Warning if absent.PluginReportJson.summary.pluginName${pluginName}::${ruleName}(both fields present). Spaces replaced with dashes per aws-cdk#37808.Acknowledge '${pluginName}::${ruleName}'. Omitted for Fatal violations.ViolatingConstructJson.constructStack.locationViolatingConstructJson.constructPathFor Construct Annotations specifically, aws-cdk-lib (via #37808) converts annotations into
PolicyViolationobjects before writing the report — extracting the[ack: id]tag asruleNameand mapping the level to severity. By the time the CLI reads the report, it's already structured.No additional schema fields are needed. The RFC output is purely a CLI display concern.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license