Skip to content

Template Validator

Purpose

The template validator checks that dataset repositories stay aligned with the bids-basic project template. It runs automatically on every merge request and every push, flagging files that are missing, structurally inconsistent with the template, or still contain unfilled placeholder content.

Source code: ci-components/template-validator

The component is added to all dataset repositories via .gitlab-ci.yml:

- component: $CI_SERVER_FQDN/ci-components/template-validator/template-validator@main

What it checks

The validator compares each dataset against the current bids-basic template and reports issues for the following files:

File What is checked
CITATION.cff Missing required keys; template placeholder values not replaced
dataset_description.json BIDSVersion, DatasetType, HEDVersion present and correct; Name not a placeholder
.gitlab-ci.yml Required stages and include entries present
.gitattributes Required LFS entries present
.bids-validator-config.json Required ignore/warning/error codes present
.bidsignore Required ignore entries present
participants.json participant_id, age, sex keys with correct annotation structure
README.md README has been edited (not identical to the template)
All files Whether the file matches an outdated version of the template (VersionValidator)

Exit code 1 (pipeline fails) on any ERROR or CRITICAL finding. Warnings and notices are reported but do not fail the pipeline.

Update workflow

When there are major changes to the bids-basic template, the template validator must be updated to reflect the new expectations:

  1. Make the changes in a merge request in the template validator repository
  2. Test on the ANC test dataset by pinning the component to your branch or commit:
    - component: $CI_SERVER_FQDN/ci-components/template-validator/template-validator@your-branch-name
    
  3. Verify the expected behaviour, then merge
  4. A new container image is built and pushed automatically via the CI pipeline

After merging, all dataset pipelines pick up the updated validator automatically on their next run. Review any new warnings or errors that appear across datasets and work with data owners to resolve them.