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

Refactor publication validation helpers to single class #800

Merged
merged 66 commits into from
Jan 2, 2023

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Jan 2, 2023

There are quite a few paths and locations for validation rules and helpers making it a bit hard to get an overview on what's going on. This refactors all of that responsibility into a single class.

@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Merging #800 (bd3f57a) into publications-feature (3b68dd8) will increase coverage by 0.63%.
The diff coverage is n/a.

@@                     Coverage Diff                     @@
##             publications-feature      #800      +/-   ##
===========================================================
+ Coverage                   99.36%   100.00%   +0.63%     
+ Complexity                   2860      1428    -1432     
===========================================================
  Files                         332       166     -166     
  Lines                        7204      3599    -3605     
===========================================================
- Hits                         7158      3599    -3559     
+ Misses                         46         0      -46     
Impacted Files Coverage Δ
...c/Console/Commands/ValidatePublicationsCommand.php 100.00% <0.00%> (ø)
...k/Features/Publications/Models/PublicationType.php 100.00% <0.00%> (ø)
...Publications/Models/PublicationFieldDefinition.php 100.00% <0.00%> (ø)
...rk/src/Console/Commands/MakePublicationCommand.php
...c/Console/Commands/ValidatePublicationsCommand.php
...Publications/Models/PublicationFieldDefinition.php
...k/Features/Publications/Models/PublicationType.php
...mework/src/Framework/Services/BuildTaskService.php
...ramework/src/Console/Commands/BuildSiteCommand.php
packages/framework/src/Pages/Concerns/HydePage.php
... and 160 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva caendesilva force-pushed the refactor-publication-validation branch from 5c36d31 to db6e0ff Compare January 2, 2023 18:04
StyleCIBot and others added 20 commits January 2, 2023 18:04
…null for the type

In production, we only validate fields that actually exist (and thus have a publication type).  The only reason it allowed null was to make it easier to test, but that's not a reason to add complexity. Instead we can just mock the publication type in the tests.
I don't see where this is needed (anymore) as the custom and dynamic rules are merged in with the defaults.
…develop into refactor-publication-validation
@caendesilva caendesilva marked this pull request as ready for review January 2, 2023 21:18
@caendesilva caendesilva merged commit a58f258 into publications-feature Jan 2, 2023
@caendesilva caendesilva deleted the refactor-publication-validation branch January 2, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants