This directory contains useful scripts related to exploring the HCA metadata schemas.
This script tests whether each JSON schema in json_schema/
directory is a valid JSON schema. This script is automatically run as part of Travis CI testing.
Please note that until jsonschema v3 goes into proper release, you will need to run pip install jsonschema==3.0.0a5
for this script to work
This script goes through all the core, module and type schemas in the json_schema
directory and converts the properties into markdown tables for easier readability. The markdown documents are stored under docs/jsonBrowser
.
This script runs automatically at every commit.
This script prepares the metadata schema repo for a release by incrementing version numbers (via the version_update.py
script), updating the change log file and inserting the appropriate version numbers for any new migrations into the property_migrations.json
file.
This script should be run manually before every release.
This script inspects every schema in the metadata repo and checks all schemas and properties to ensure that they conform to a set of rules defined in the schema style guide. Check failures are reported as either warnings or errors, depending on the severity of the mistake.
This script can be run as a standalone (and it should be considered good practice to do so!) but it is also integrated into the automatic Travis build.
Instructions to run it:
pip install -r requirements.txt
cd src/
python schema_linter.py --environment <ENV>
Where environment represents the release stage you want to test the schemas against ({develop, integration, staging or master}). If not specified it tests against staging.
Human-friendly information about what the rules the linter tests against can be found in the schema_style_guide.md
document inside the docs
folder.
This script increments the version numbers of any schemas listed in the update_log.csv file by the increment type supplied with the schema. It also finds any schemas that reference the updated schemas and increments their version numbers appropriately.
This script can be run as a stand-alone but is normally run automatically as part of the release prep process.