Skip to content
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

As a dev performing validation, if the validation manifest is invalid then I want to see an appropriate error #33

Closed
craigfowler opened this issue Apr 26, 2017 · 4 comments · Fixed by #77
Labels
enhancement A new feature or capability

Comments

@craigfowler
Copy link
Member

craigfowler commented Apr 26, 2017

Generally-speaking the object model exposed by the validation manifest makes it quite difficult to create an invalid validator, but it is still possible.

In this case, if a developer tries to use that manifest to perform validation then they should be presented with a ValidationException. The message to that exception should make it clear what about their manifest is invalid.

Implementation plan

I'd like to implement this via validation! I can use built-in validation rules to validate the validation manifest before it is used. If it is invalid, throw an exception with a message that includes the results.

What is an invalid manifest?

I need to perform some investigation to determine exactly what makes a manifest invalid. One thought about this is duplicate validation rules. That is two or more rules upon the same validated object which have identical rule-types and names.

Duplicate rules (multiple validation rules which validate the same validated value, of the same rule type and name) are not permitted. Currently this scenario is not detected and so the validator will attempt to perform the validation regardless.

There are almost certainly further invalid scenarios though.

@craigfowler craigfowler added this to the v0.1 milestone Apr 26, 2017
@craigfowler craigfowler added the enhancement A new feature or capability label Apr 26, 2017
@craigfowler craigfowler removed this from the v0.1 milestone Apr 27, 2017
@craigfowler craigfowler changed the title Alter validation run builder to exclude duplicate runnable rules When creating a validator from a validation manifest, if the manifest contains duplicate rules then it should throw an exception Nov 4, 2021
@craigfowler

This comment was marked as outdated.

@craigfowler craigfowler changed the title When creating a validator from a validation manifest, if the manifest contains duplicate rules then it should throw an exception As a dev performing validation, if the validation manifest is invalid then I want to see an appropriate error Apr 22, 2022
@craigfowler
Copy link
Member Author

Blocked by #52 because a validation manifest is a recursive object model.

@craigfowler craigfowler added the blocked This can't be worked on yet label Apr 22, 2022
@craigfowler
Copy link
Member Author

I'd like to make this a "testing" method exposed by the validator factory. I think that it would be onerous to "validate the validator" every time validation occurs. Instead, by putting that functionality upon the validator factory, the consumer can choose whether to do it or not.

@craigfowler

This comment was marked as outdated.

craigfowler added a commit that referenced this issue Feb 2, 2023
This is a prerequisite to writing a validator-validator.
craigfowler added a commit that referenced this issue Feb 2, 2023
Also add a couple of extra standard rules (enum constants).
craigfowler added a commit that referenced this issue Feb 2, 2023
This allows a validator builder to import rules
for validating its base type.  Also fix issue with manifest.
craigfowler added a commit that referenced this issue Feb 4, 2023
craigfowler added a commit that referenced this issue Feb 4, 2023
craigfowler added a commit that referenced this issue Feb 4, 2023
craigfowler added a commit that referenced this issue Feb 4, 2023
This is just the first test, to prove that in a "happy path"
scenario, the validator-validator can validate itself.
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
Note that Validation has its own Parallelizable attribute,
easy to mudle them up!
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 5, 2023
craigfowler added a commit that referenced this issue Feb 11, 2023
This removes all of the class inheritance from the Validation
Manifest object model (I will do the Manifest Model later).
This is done to make it easier to deal with recursive manifest
items.  It will now be easier to create:

* Recursive collection items
* Recursive polymorphic types
craigfowler added a commit that referenced this issue Feb 11, 2023
This moves the assembling of manifest items into
a context class, rather than trying to do it inside the builders.
craigfowler added a commit that referenced this issue Feb 11, 2023
craigfowler added a commit that referenced this issue Feb 11, 2023
The validation-manifest validator needs review, because the
object model has changed somewhat since it was first designed.
Also, I am unaware of my current test coverage %.

This commit should successfully build though.
craigfowler added a commit that referenced this issue Feb 12, 2023
This marks up some non-implemented functions, so
SonarCloud reminds me about them, as well as fixing
a minor tech issue.
craigfowler added a commit that referenced this issue Feb 12, 2023
craigfowler added a commit that referenced this issue Feb 12, 2023
craigfowler added a commit that referenced this issue Feb 12, 2023
craigfowler added a commit that referenced this issue Feb 12, 2023
craigfowler added a commit that referenced this issue Feb 12, 2023
This removes some of the class hierarchy related to
the manifest model, and replaces it with something simpler.
craigfowler added a commit that referenced this issue Feb 14, 2023
This is a result of publishing the docs site manually.
Bizzarely it stopped working somewhere between:

  6f89da3
and
  d81bcce

...whilst I was working on #33.

I've removed the build step to auto-publish them and
I'm going to have to create an issue to investigate what's
happened there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or capability
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant