OpenDataServices / cove

CoVE is an web application to Convert, Validate and Explore data following certain open data standards - including 360Giving, Open Contracting Data Standard, IATI and the Beneficial Ownership Data Standard
http://cove.opendataservices.coop
Other
43 stars 11 forks source link

OCDS: Try out 1.1.4 schema with CoVE, make updates we can forsee #1177

Closed odscjames closed 5 years ago

odscjames commented 5 years ago

I started a branch to test this: ocds-v-1-1-4

Found one issue: upload cove_ocds/fixtures/tenders_releases_2_releases.xlsx and it says "We think you tried to supply a spreadsheet, but we failed to convert it. Error message: <JsonRefError: 'JSONDecodeError: Expecting value: line 1 column 1 (char 0)'>"

odscjames commented 5 years ago

There are actually several issues: https://travis-ci.org/OpenDataServices/cove/builds/541277043

odscjames commented 5 years ago

Problem found:

https://raw.githubusercontent.com/open-contracting/standard/1.1.4-dev/standard/schema/release-package-schema.json

Has a ref to

http://standard.open-contracting.org/schema/1__1__4/release-schema.json

Which does not exist yet (fair enough). This causes the crash.

I'm not sure what the best way to tackle this is.

Did you have this problem before, and if so how did you solve it?

odscjames commented 5 years ago

One solution is to copy the latest schema files to http://standard.open-contracting.org/schema/1__1__4/ now.

This would allow all kind of testing before the official release. I'm not sure if there are downsides tho? @jpmckinney

jpmckinney commented 5 years ago

I think that's fine. In standard-maintenance-scripts, if use_development_version is True, then we replace URLs in the schema, e.g. https://github.com/open-contracting/standard-maintenance-scripts/blob/master/tests/test_json.py#L181 (there's some unrelated logic in there about forcing a specific version of OCDS when testing profiles pinned to given versions…).

odscjames commented 5 years ago

This is now down to 3 errors: to replicate

DJANGO_SETTINGS_MODULE=cove_ocds.settings py.test cove_ocds/tests.py -k "test_cove_ocds_cli_validation_errors"
DJANGO_SETTINGS_MODULE=cove_ocds.settings py.test cove_ocds/tests_functional.py -k "test_validation_error_messages" 
DJANGO_SETTINGS_MODULE=cove_ocds.settings py.test cove_ocds/tests_functional.py -k "test_url_input" 
odscjames commented 5 years ago

The second error is because http://standard.open-contracting.org/schema/1__1__4/release-schema.json has

For more information see the [Open Contracting Identifier guidance](http://standard.open-contracting.org/{{version}}/{{lang}}/schema/identifiers/)

in the OCID field. Out of time to look into this detail today.

jpmckinney commented 5 years ago

Hmm, without seeing the errors, I think you might need to copy the built files after running make locally, or from http://ocds-standard.dev.docs.opencontracting.uk0.bigv.io/1.1.4-dev/en/, like http://ocds-standard.dev.docs.opencontracting.uk0.bigv.io/1.1.4-dev/en/release-schema.json (if you copied from the GitHub repo, then {{version}}, etc. haven't been replaced).

Update: And, even then, 1.1.4-dev will be the value for {{version}}, so we'll still have to re-copy these files into place, as in the standard deployment docs. Note that http://standard.open-contracting.org/1.1.4-dev/en/schema/identifiers/ 404s, because the (old) production server doesn't proxy to the (new) dev server.

odscjames commented 5 years ago

Thanks.

I have done some more work on this; a change I had to make was to remove two expected lines from the test_url_input test, badfile_all_validation_errors.json:

'The currency for each amount should always be specified using the uppercase 3-letter currency code from ISO4217.',
 'One or more values from the releaseTag codelist. Tags may be used to filter release and to understand the kind of information that a release might contain.',

I need to check the changes in 1.1.4 from 1.1.3 and see if this is expected or not.

Apart from this, all tests now pass!

jpmckinney commented 5 years ago

The first line is now: The currency of the amount, from the closed [currency](http://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#currency) codelist. (Note: version and lang would be replaced in deployed version).

Second is now: One or more values from the closed [releaseTag](http://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#release-tag) codelist. Tags can be used to filter releases and to understand the kind of information that releases might contain. (Note: as above).

odscjames commented 5 years ago

Thank you. All the tests now pass https://travis-ci.org/OpenDataServices/cove/builds/547659854

robredpath commented 5 years ago

CoVE is now using 1.1.4 in production