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

Schema v1.1.0 - bug fixes and cli #32

Merged
merged 39 commits into from
Sep 23, 2021
Merged

Schema v1.1.0 - bug fixes and cli #32

merged 39 commits into from
Sep 23, 2021

Conversation

alisonrclarke
Copy link
Contributor

@alisonrclarke alisonrclarke commented Jul 14, 2021

@alisonrclarke
Copy link
Contributor Author

Note that currently the CLI and FullSubmissionValidator do not accept/resolve remote schemas. Is this something that should be part of this PR or should I add a bug (and mention it in the docs)?

@alisonrclarke alisonrclarke requested a review from GraemeWatt July 14, 2021 15:09
@alisonrclarke
Copy link
Contributor Author

Just realised @GraemeWatt said this should be v1.1.0 given the added additional_resources schema. I'll update that.

Additional resources is a minor change rather than bug fix.
@alisonrclarke alisonrclarke changed the title Schema v1.0.2 - bug fixes and cli Schema v1.1.0 - bug fixes and cli Jul 14, 2021
@coveralls
Copy link

coveralls commented Jul 14, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 0d67d29 on schema-v1.0.2 into 94fecde on master.

@alisonrclarke
Copy link
Contributor Author

Note that currently the CLI and FullSubmissionValidator do not accept/resolve remote schemas. Is this something that should be part of this PR or should I add a bug (and mention it in the docs)?

I've now updated the PR so that FullSubmissionValidator works on remote schemas.

@alisonrclarke alisonrclarke marked this pull request as ready for review July 27, 2021 07:45
This aligns things with the hepdata code.
For use by main hepdata app, so it can preload the allowed remote schemas.

Also made custom_data_schemas in DataFileValidator an instance variable
so it's clear which schemas have been loaded for which validator.
@alisonrclarke
Copy link
Contributor Author

@GraemeWatt I think this is ready for review now following the changes for integration with the main HEPData site.

Tests add checks for previous schema change as well as checking for multiple errors
Follows pattern previously used for our own data schema but now works
for submissions and remote schemas.
Also do all further checks even if there's been a previous error, to ensure
all errors are returned.
Also added some valid expressions with - to tests to ensure they are
allowed
Copy link
Member

@GraemeWatt GraemeWatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I've tried both the CLI and the interface to the web app. Couple more requests:

  1. The web interface supports .yaml.gz as an upload file type, i.e. a single YAML file compressed using gzip. Could this also be supported from the -f option, i.e. uncompress in a temporary directory then validate the single YAML file? It might be better to rename the -z, --zipfile option as -a, --archive (and similar changes throughout the code) to avoid confusion.
  2. In the validation error messages, is it possible to print just the file name and not the full path? Particularly for archive files extracted to a temporary directory, we don't need to show the full path. Ideally this should be done also for YAML parsing errors where the string representation of the exception contains the full path and not just the file name.

 * Rename zipfile to archive in parameters/docs
 * Allow .yaml.gz files as single file archive
@GraemeWatt GraemeWatt merged commit de48d30 into master Sep 23, 2021
@GraemeWatt GraemeWatt deleted the schema-v1.0.2 branch September 24, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment