Skip to content

feat(core): allow validation plugins to create new files in cloud assembly#38007

Open
kaizencc wants to merge 3 commits into
mainfrom
feat/core-validation-allow-plugin-new-files
Open

feat(core): allow validation plugins to create new files in cloud assembly#38007
kaizencc wants to merge 3 commits into
mainfrom
feat/core-validation-allow-plugin-new-files

Conversation

@kaizencc
Copy link
Copy Markdown
Contributor

@kaizencc kaizencc commented May 26, 2026

Summary

  • Changes the validation plugin integrity check from fingerprinting the entire outdir to snapshotting only pre-existing file hashes before plugins run.
  • Plugins may now create new files in the cloud assembly directory (e.g. SARIF reports, custom output files) without triggering the "modified the cloud assembly" error.
  • Modifications or deletions of pre-existing files are still caught and throw.
  • Replaces FileSystem.fingerprint with per-file SHA-256 hashes because fingerprint computes a single hash over the entire directory tree, making it impossible to distinguish new files from modifications to existing ones.

The plugin contract is updated from "plugins cannot modify the cloud assembly" to "plugins cannot modify or delete files that existed in the cloud assembly prior to plugin execution."

Test plan

  • Existing test: plugin tries to modify a template — still throws (modification of pre-existing file)
  • New test: plugin that writes new files to assembly is allowed — creates a file, no error, file contents verified
  • New test: plugin that deletes pre-existing file is caught — deletion detected and throws
  • Full validation test suite passes (50/50)

…embly

Previously, the integrity check fingerprinted the entire outdir and
rejected any change at all. This prevented plugins from writing output
files (e.g. validation reports, SARIF files) to the assembly directory.

The check now snapshots only pre-existing file hashes before plugins run.
Modifications or deletions of pre-existing files are still caught, but
new files created by plugins are permitted.
@kaizencc kaizencc requested a review from a team as a code owner May 26, 2026 17:55
@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 17:55 Inactive
@github-actions github-actions Bot added the p2 label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

⚠️ 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.

Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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)

@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 27, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review May 27, 2026 15:19

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

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-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