-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filterSuppressions model transform
This commit adds support for filtering suppressions by removing unused suppressions, removing the reason from suppressions, removing suppressions based on an event ID allow/deny list, and removing suppressions based on a namespace allow/deny list. This model transform is useful for projecting models with internal information for external customers so that suppressions can be retained in the model without exposing internal information. To support this change, a Suppression abstraction had to be exposed in smithy-model that was previously never exposed. However, for now, the abstraction is as bare-bones as possible, and the concrete suppression types are package-private. ModelValidator was also significantly refactored to adapt to these Suppression changes, but remains package-private until we have a compelling reason to expose it outside of just using ModelAssembler for validation. smithy-build required a significant refactor to support passing in the encountered validation events of a projection to ModelTransformers via the TransformContext object. This gave the FilterSuppressions transform that ability to access ValidationEvents without needing to do another expensive round of validation. Only the validation events encountered for the model at the start of each projection, including loaded imports, are passed to transforms (that is, intermediate transforms of the model are not re-validated). However, FilterSuppressions performs a diff of the validators defined in the original model and validators defined in the projected model up to that point to determine if suppressions for any removed validators should also be removed. The implementation of the apply transform in smithy-build was also technically changed in a backward-incompatible way, though this change will likely not impact any code other than that in the smithy-build package itself. The transform still works in the same way, it was just refactored to be implemented just like any other transform.
- Loading branch information
Showing
39 changed files
with
1,664 additions
and
265 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.