-
Notifications
You must be signed in to change notification settings - Fork 77
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 support for validation of XML submission files #2437
Add support for validation of XML submission files #2437
Conversation
6a60f38
to
c5431c2
Compare
c5431c2
to
d94a42b
Compare
d94a42b
to
4602d25
Compare
Moving this to the 3.7 release since it isn't quite finished. |
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.
After digging into the submission handler logic a bit more, I am no longer certain that this is the correct approach. Instead of validating the XML files when submissions are processed, I think it would be better to validate them at submission time. This approach was initially rejected due to the hypothesis that doing so would slow down submission acceptance. After gaining a better understanding of the code, I am reasonably confident that doing this validation at submission time will have a negligible performance impact.
The main benefit of doing this validation at submission time is that error messages will always be returned to the client, regardless of the queueing system used.
f02158b
to
309f06e
Compare
309f06e
to
24c388e
Compare
24c388e
to
1114898
Compare
1114898
to
9941aea
Compare
aedfeb1
to
77d00c6
Compare
@josephsnyder I just pushed an update which makes the code cleaner and hopefully gets rid of some of the complexity that might've been tripping you up. I also resolved all of the PHPStan errors. I didn't take a detailed look into why the submission validation test is failing, but I can dig into that a bit more if you'd like. |
ad4e155
to
4ba9d80
Compare
4ba9d80
to
035378a
Compare
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.
This seems to be on the right track overall. A few more changes, and then this should be good to merge.
43d10bd
to
aff80fe
Compare
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.
It looks like this also needs a rebase to meet the new style guidelines.
aff80fe
to
815ec93
Compare
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.
A couple quick changes, and then this should be good to go.
When attempting to validate an HTTP submission use the `storage_path` helper to turn the filename which starts at the inproess folder, `inprocess/<>.xml`, to a full path. This should not affect the path given directly to the submission:validate artisan command.
Switch the dependency property for the submissionValidation test to a later php_test. This should prevent the test from moving far up in test number and throwing off the expected bolus of submission values
Add a new test location for the submission validation test Update the paths and objects needed.
Add in further test cases for when the environment variable is in different states: not set, false, true
24b69b6
to
c17dcdd
Compare
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.
Good work on this!
This is a follow up to the submission XML schemas along with the validation artisan command (see #2335) that were recently introduced. The changes in this PR add the option to use this validation process on incoming submission files, although this option is disabled by default.
A test has been added to verify these changes, and the docs have been updated to reflect the new configuration option.