Skip to content

feat(core): include suppressed violations in validation-report.json#38009

Open
kaizencc wants to merge 3 commits into
mainfrom
feat/core-validation-suppressed-violations-in-report
Open

feat(core): include suppressed violations in validation-report.json#38009
kaizencc wants to merge 3 commits into
mainfrom
feat/core-validation-suppressed-violations-in-report

Conversation

@kaizencc
Copy link
Copy Markdown
Contributor

Summary

  • Suppressed violations are now included in validation-report.json under a suppressedViolations array per plugin report, providing an audit trail.
  • Each suppressed violation entry includes the full violation details plus acknowledgedId, reason, and acknowledgedAt (the construct path where acknowledge() was called).
  • Suppressed violations remain excluded from the active violations list, the pretty-printed output, and the success/failure determination.
  • collectAcknowledgedRuleIds now returns a Map<string, AcknowledgedRule> (with reason + construct path) instead of a bare Set<string>.

Schema: aws/aws-cdk-cli#1556

Test plan

  • New test: suppressed violations appear in validation-report.json — verifies the JSON report contains the suppressed violation with all metadata
  • Existing suppression tests continue to pass (active violations removed, fatal violations retained)
  • Full validation test suite passes (49/49)

Suppressed violations are now retained in the JSON validation report
under a `suppressedViolations` array per plugin report. Each entry
includes the original violation details plus `acknowledgedId`, `reason`,
and `acknowledgedAt` (the construct path where acknowledge was called).

This provides an audit trail for suppressed rules while keeping them
excluded from the active violations list and pretty-printed output.
@kaizencc kaizencc requested a review from a team as a code owner May 26, 2026 18:26
@github-actions github-actions Bot added the p2 label May 26, 2026
@kaizencc kaizencc added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels May 26, 2026
@mergify mergify Bot added the contribution/core This is a PR that came from AWS. label May 26, 2026
@mergify mergify Bot temporarily deployed to automation May 26, 2026 18:27 Inactive
@mergify mergify Bot temporarily deployed to automation May 26, 2026 18:27 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ This pull request description does not follow the correct template structure.

PRs without a linked issue will receive lower priority for review and merging. Please update the description to follow the PR template and include a line like Closes #123 in the Issue section. If no existing issue matches your change, create one first.

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label May 27, 2026
Copy link
Copy Markdown
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Conditionally approved

export interface SuppressedViolation extends report.PolicyViolation {
readonly acknowledgedId: string;
readonly reason?: string;
readonly acknowledgedAt?: string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth a stack trace as well? (In debug mode) ?

Add assertion confirming that suppressed violations in the JSON report
include stack traces on their violating constructs. This was already
working (formatSuppressedViolationJson delegates to formatViolationJson
which resolves stack traces) but now has explicit test coverage.
Capture stack traces when acknowledge() is called and include them in
the validation report as `acknowledgedStackTrace` (a \n-delimited string
of frames). This matches the schema from aws-cdk-cli#1556.

Each acknowledgement now writes a separate metadata entry with
stackTrace: true, so individual stack traces are preserved per rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time. pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants