-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add "critical" validation phase to validation #2098
Merged
Merged
Conversation
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
mtdowling
force-pushed
the
more-blocking-validation
branch
from
January 13, 2024 22:52
13be365
to
841f302
Compare
mtdowling
changed the title
Add a "critical" validation phase to validation
Add "critical" validation phase to validation
Jan 14, 2024
mtdowling
force-pushed
the
more-blocking-validation
branch
from
January 14, 2024 21:16
841f302
to
9dc4d30
Compare
mtdowling
commented
Jan 14, 2024
smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java
Show resolved
Hide resolved
mtdowling
commented
Jan 14, 2024
smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java
Show resolved
Hide resolved
mtdowling
commented
Jan 14, 2024
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationUtils.java
Show resolved
Hide resolved
kstich
requested changes
Jan 17, 2024
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationUtils.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationUtils.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationUtils.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java
Outdated
Show resolved
Hide resolved
smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidationUtils.java
Show resolved
Hide resolved
mtdowling
force-pushed
the
more-blocking-validation
branch
from
January 18, 2024 20:52
9dc4d30
to
d679d87
Compare
mtdowling
force-pushed
the
more-blocking-validation
branch
from
January 18, 2024 21:07
d679d87
to
4640bcb
Compare
kstich
approved these changes
Jan 18, 2024
sugmanue
approved these changes
Jan 18, 2024
Runs "critical" validators before other validators so that they can be written without needing to account for things like whether traits are applied in valid places or not or if a trait's value matches its definition and constraints. This can help to simplify validators as they can now call methods like .expectShape on a Model to throw if a shape is missing rather than having to defensively code around potentially incorrect models. To ensure this works backward compatibly with existing errorfile based test runners, we will now detect whether to use a "legacy" validation mode that continues to validate after a critical validator emitted an event because an errorfiles mixes critical and non-critical events. This ensures backward compatibility and that any new addition of critical validators in the future will not break existing test cases.
mtdowling
force-pushed
the
more-blocking-validation
branch
from
January 18, 2024 22:15
4640bcb
to
2431108
Compare
hpmellema
approved these changes
Jan 18, 2024
7 tasks
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.
Runs "critical" validators before other validators so that they can be written without needing to account for things like whether traits are applied in valid places or not or if a trait's value matches its definition and constraints.
This can help to simplify validators as they can now call methods like .expectShape on a Model to throw if a shape is missing rather than having to defensively code around potentially incorrect models.
To ensure this works backward compatibly with existing errorfile based test runners, we will now detect whether to use a "legacy" validation mode that continues to validate after a critical validator emitted an event because an errorfiles mixes critical and non-critical events. This ensures backward compatibility and that any new addition of critical validators in the future will not break existing test cases.