-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial implementation of new validation approach #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few remarks questions, but overall looks good - Thanks man!
src/Promitor.Core.Scraping/Configuration/Serialization/ConfigurationSerializer.cs
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/IErrorReporter.cs
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Core/AzureMetadataDeserializer.cs
Outdated
Show resolved
Hide resolved
...itor.Core.Scraping/Configuration/Serialization/v1/Providers/ContainerRegistryDeserializer.cs
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Core/MetricAggregationDeserializer.cs
Show resolved
Hide resolved
src/Promitor.Core.Scraping/Configuration/Serialization/v1/Core/AggregationDeserializer.cs
Show resolved
Hide resolved
// TODO: Check for invalid formats (crontab expression, timespan, etc) | ||
// TODO: Add a test to make sure that the error is against the mapping node rather than its value for missing required fields | ||
|
||
private class TestConfigObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same about those, dedicated files for final PR
|
||
// TODO: Test for duplicate field registration | ||
|
||
private class RegistrationConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, dedicated files for final PR
I've altered the way that the deserializers work and are defined so that they are simpler to create, but also so that we can record validation failures during the deserialization process. This allows us to provide much better validation messages than we can if we take the approach of validating based on the deserialized objects. In this initial change I haven't gone ahead and updated all of the deserializers because I wanted the change to be kept small. I've also not actually hooked up the validation messages in any way - instead I've just provided a stub ErrorReporter object that doesn't actually do anything yet.
b2461bc
to
4b3f3f6
Compare
I've altered the way that the deserializers work and are defined so that they are simpler to create, but also so that we can record validation failures during the deserialization process. This allows us to provide much better validation messages than we can if we take the approach of validating based on the deserialized objects.
In this initial change I haven't gone ahead and updated all of the deserializers because I wanted the change to be kept small. I've also not actually hooked up the validation messages in any way - instead I've just provided a stub ErrorReporter object that doesn't actually do anything yet.
Fixes #