Repository navigation
Update FIVE_SAFES_PROFILE_VERSION to 0.8.0 - #210
Conversation
|
Thanks for the PR @manics ! The new error indicates that the RO-Crate metadata file you're testing isn't in UTF-8 encoding format - did the encoding get changed somehow when you downloaded the test files? (haven't tested the docker build locally but I know the original file is UTF-8 encoded) |
|
I'm pretty sure the encoding is correct, and it works fine if I run the validator directly |
|
Strange. I've just replicated this error on my side too:
Output: |
|
Hi @manics (and @elichad!), the UTF-8 error is a false positive from an upstream bug in The issue is that:
if context.settings.metadata_only:
logger.debug(...)
return True
|
|
The upstream bug has been fixed in 0.11.4 - think that we should be able to just update the package version in |
Fixes upstream bug in UTF-8 validation
|
I've updated roc-validator, this is now working locally for me: In [5]: with open("ro-crate-metadata-5s.json", encoding="utf-8") as f:
...: crate_json = f.read()
...: reqbody = {"crate_json": crate_json, "profile_name": "five-safes-crate"}
...: response = requests.post(
...: f"{BASE_URL}/v1/ro_crates/validate_metadata",
...: json=reqbody,
...: )
...:
...: assert response.status_code == 200
...: body = response.json()
...: display(body)
...: assert body["status"] == "valid"
...:
{'created_at': None,
'detail': {'issues': [],
'meta': {'version': '0.2'},
'passed': True,
'validation_settings': {'abort_on_first': False,
'enable_profile_inheritance': True,
'profile_identifier': 'five-safes-crate-0.4',
'requirement_severity': 'REQUIRED',
'rocrate_validator_version': '0.11.4'}},
'profile': 'five-safes-crate',
'status': 'valid'} |
elichad
left a comment
There was a problem hiding this comment.
I've just been testing locally as well and the fix seems to work
Testing https://github.com/eScienceLab/rocrate-validator/blob/develop/tests/data/crates/valid/five-safes-crate-result/ro-crate-metadata.json (https://github.com/eScienceLab/rocrate-validator/raw/ddf10285cb1df2effde1032be0939eb11870db5d/tests/data/crates/valid/five-safes-crate-result/ro-crate-metadata.json) as suggested in #102 (comment) with
ghcr.io/esciencelab/ro-crate-validation-service-fivesafes-profile:2.0results in these validation errors:
With this PR the above validation errors go away, but I see a strange UTF-8 error- but maybe there's something weird with my docker build?
podman build --build-arg FIVE_SAFES_PROFILE_ VERSION=five-safes-0.8.0 --build-arg PROFILES_ARCHIVE_URL=https://github.com/eScienceLab/rocrate-va lidator/archive/refs/tags/five-safes-0.8.0.tar.gz --build-arg EXTRA_PROFILES_PATH=/app/extra-profil es -t ro-crate-validation-service .