Skip to content

Dataset Versioning

NEMAR uses semantic versioning (X.Y.Z) and pull requests for all dataset changes. Every change to a dataset goes through a PR, which triggers CI checks (BIDS validation, version verification). On merge, GitHub Actions automatically tags the release and mints a DOI if configured.

  • Patch (1.0.0 -> 1.0.1): Bug fixes, metadata corrections, small additions
  • Minor (1.0.0 -> 1.1.0): New subjects, new modalities, significant additions
  • Major (1.0.0 -> 2.0.0): Breaking changes, restructured data, format changes. On an OpenNeuro mirror, a major version means an upstream re-pull instead, and the command-line interface (CLI) refuses to release one by hand; see OpenNeuro Mirrors.

Use nemar dataset release when you want to tag a new version without changing data. This is common when the dataset content is already correct and you simply need to cut a release.

Terminal window
# Interactive: prompts for patch/minor/major
nemar dataset release nm000104
# Non-interactive: specify bump type directly
nemar dataset release nm000104 --type patch -y
# Explicit version
nemar dataset release nm000104 --version 2.0.0 -y

What happens:

  1. CLI clones the repo to a temp directory
  2. Creates branch release/v1.0.1
  3. Updates dataset_description.json with new version
  4. Pushes and creates a PR
  5. CI runs BIDS validation and version checks
  6. On merge: tag, GitHub Release, and version DOI (if concept DOI exists)

Use nemar dataset update when you have local changes to push. This handles both metadata-only changes (JSON, TSV, README) and data file changes (EDF, BDF, etc.).

Terminal window
# First, clone and make changes locally
nemar dataset clone nm000104
cd nm000104
nemar dataset get .
# Make your changes...
# Edit participants.tsv, add new files, etc.
# Push changes via PR
nemar dataset update -m "Add subjects 10-15"

What happens:

  1. CLI detects dataset ID from git remote
  2. Categorizes changes (metadata vs data files)
  3. Creates branch update/nm000104-<timestamp>
  4. Bumps version (patch by default)
  5. Commits all changes
  6. For data files: uploads to S3 via git annex copy --to nemar-s3
  7. Pushes and creates a PR

A dataset is an OpenNeuro mirror when its identifier starts with on, or when its catalog entry records OpenNeuro as its source. On a mirror, a major version means an upstream re-pull: NEMAR pulled a newer OpenNeuro snapshot. A re-pull is made with NEMAR’s own tooling (nemar admin repull, an administrator command), so the CLI refuses to make a major version of a mirror by hand. NEMAR’s own changes to a mirror take a minor or patch version. Versions of an OpenNeuro mirror explains the numbering, and the rule is recorded in Architecture Decision Record (ADR) 0006 and ADR 0111.

The CLI refuses every spelling that reaches a higher major version:

  • nemar dataset release <id> --type major
  • nemar dataset release <id> --version <version>, when the major number of <version> is higher than the current one
  • the interactive prompt of nemar dataset release <id>: its major choice cannot be selected, and a custom version with a higher major number is refused after you type it
  • nemar dataset update --bump major

The check runs once the new version is settled, before the confirmation and before anything is cloned, changed or pushed. The command prints the reason and exits with status 1:

Error: A major version of a mirror means an upstream re-pull (ADR 0006, ADR 0111): on005506 1.0.0 -> 2.0.0 is not released by hand. Plan one with: nemar admin repull plan on005506
Nothing was changed. NEMAR's own changes to a mirror take minor and patch.

Release a change of your own as a minor or patch version instead. On a mirror, the check also refuses when it cannot read a version as X.Y.Z (three numbers, with no prerelease), because it cannot then tell whether the change is a major. That message names the form a version must have.

The rule is the CLI’s. The dataset repositories’ version-check workflow does not read it, so a pull request opened another way, on GitHub for example, with a Version edited by hand in dataset_description.json, is not stopped by it. The workflows are shared by every dataset repository, and a change to them reaches all of them at once (ADR 0020: dataset automation runs from central shared workflows). The rule still applies to such a change: a major version of a mirror is reserved for an upstream re-pull.

Both commands support --monitor to watch CI checks and offer to merge. For a published dataset, only a NEMAR administrator should accept that prompt, after verifying the current-head checks and review under the required workflow. The command prompt does not replace that review:

Terminal window
# Release with monitoring
nemar dataset release nm000104 --type patch --monitor -y
# Output:
# Dataset: My EEG Study
# Current version: 1.0.0
# Version bump: 1.0.0 -> 1.0.1
# ... cloning, branching, committing ...
# PR: https://github.com/nemarDatasets/nm000104/pull/5
# Monitoring CI checks...
# ......
# All checks passed!
# ? Merge the PR? (y/N) y
# PR merged successfully!

If you already have the dataset cloned, avoid a redundant clone:

Terminal window
# Use --dir with release
nemar dataset release nm000104 --dir ./nm000104
# Or just cd into the clone for update
cd nm000104
nemar dataset update

Every pull request that changes a dataset is expected to add an entry to the change log. The change log is the CHANGES file (or CHANGELOG, optionally ending in .md, .txt or .rst) at the root of the dataset. The entry must be headed by the new version number, for example 1.0.1, and must describe the edits the pull request makes.

A log kept only in the README does not count. A heading with a date and no version does not count either, and neither does a version that is only mentioned in a sentence. The CHANGES file is the one place a reader looks for what each version changed, so it has to stay complete.

The automated review also looks for these, so it helps to get them right the first time:

  • The Version in dataset_description.json goes up. A version inside GeneratedBy is a tool version and does not count.
  • HED annotations are additive. Adding or correcting tags is an improvement. Removing an annotation or a HED entry counts as removing metadata, even when it silences a validator message, unless the pull request replaces it with a corrected one.
  • A root-level sidecar applies to every matching file below it, by BIDS inheritance. Moving identical values from many per-file sidecars into one root sidecar loses nothing, as long as the values are kept.
  • The pull request description matches what the files show, such as the version change and the files changed.
  • Text the original authors published is left as it is: a line of the README or of CHANGES that was already there, an author field of dataset_description.json and the values a participant already has are not altered, moved or removed. See The automated review of your pull request.

The pull requests merged into a dataset are its change history on GitHub. People scan the titles in that history to find out what each revision did. Nonsense titles do not help them, so write the title and the description for a person.

The title says what changed, in plain words.

  • Good: Fix channel locations for subjects 10 to 15
  • Bad: Update, which does not say what changed

With nemar dataset update, pass the title with -m; the CLI adds the new version at the end. With nemar dataset push --pr, pass the title with -t and the description with -b. If you open the pull request yourself, on GitHub or with gh pr create, you type both there. You can edit either one on GitHub at any time.

Two mistakes to avoid:

  • A naming template as the title. Never use a dataset naming template, such as FirstAuthorSurname-year-keyword-paperDOI, as a pull request title. Never copy a template token into a title either, such as FirstAuthorSurname, paperDOI, {{x}}, or [describe the change]. A token left in a title means nobody replaced the placeholder with the real words.
  • An author and a year at the start. Never start a title with an author surname followed by a year, such as Lee2019 or Lee-2019-EEG. An author and a year name the paper behind a dataset, not what this pull request changes.

The description says what changed and why, in sentences a person can read. Raw hashes, JSON, and file listings are not a description.

The rule for naming a dataset is separate. The Name field of dataset_description.json follows the dataset naming rule in the Dataset Submission Standards. The pull request title does not. The name describes the dataset, and the title describes one change to it.

When a PR is created against main, GitHub Actions runs two workflows:

  1. BIDS Validation (bids-validation.yml) - Runs the BIDS validator (Deno-based) on the dataset. Output is written to .nemar/validation.json. Warnings are tolerated; only errors cause failure.
  2. Version Check (version-check.yml) - Ensures dataset_description.json has a version that is higher than the latest git tag. Prevents merging without a version bump.

Both must pass before the PR can be merged. These workflows are automatically deployed by the publish orchestrator and by nemar dataset release.

When a PR is merged to main, the pr-merge.yml workflow fires and performs:

  1. Tag and Release - Reads the version from dataset_description.json, creates a vX.Y.Z git tag and GitHub Release
  2. Webhook - Calls the backend’s /webhooks/publish-version-doi endpoint with the dataset ID, version, and release URL
  3. Version DOI - If a concept DOI exists, the backend mints a version DOI through EZID. The DOI pattern is <concept_doi>.v<version>, for example 10.82901/nemar.on005506.v1.0.0. DOIs are not case sensitive; this is the lowercase form that DataCite registers and the landing page shows.
  4. Zenodo Backup - The version workflow may create or update a non-public Zenodo draft as a best-effort archive backup; this is not NEMAR’s canonical DOI.
  5. Version Manifest - Generates a manifest (file listing with checksums) and uploads to s3://nemar/<dataset_id>/version/v<version>.json

The webhook token (NEMAR_WEBHOOK_TOKEN) is configured as an organization-level secret on nemarDatasets; no per-repo setup is needed.

All NEMAR-generated files are stored under .nemar/ in the dataset repository. This directory is excluded from BIDS validation via .bidsignore. Current contents:

  • .nemar/validation.json - BIDS validation output from CI

The .bidsignore file automatically includes .nemar/ and nemar_metadata.json entries. These are added during dataset upload.

  • git - For cloning and branching
  • gh (GitHub CLI) - For creating PRs (brew install gh)
  • git-annex - Only needed if updating data files
  • NEMAR account - Must be logged in (nemar auth login)
Terminal window
nemar dataset release nm000104 --type patch -y
Terminal window
nemar dataset release nm000104 --type minor --monitor
Terminal window
cd nm000104
# Edit participants.tsv, dataset_description.json, etc.
nemar dataset update -m "Fix participant demographics"
Terminal window
cd nm000104
# Add new EDF files to sub-XX/eeg/
nemar dataset update --bump minor -m "Add subjects 20-25"
Terminal window
nemar dataset update /path/to/nm000104 --bump patch -m "Fix events.tsv"
Terminal window
# 1. Upload a new dataset
nemar dataset upload ./my-eeg-study
# 2. Request publication (admin approves, concept DOI is created)
nemar dataset publish request nm000108
# ... admin approves ...
# 3. Make corrections and release a new version
nemar dataset clone nm000108
cd nm000108
nemar dataset get .
# fix some metadata...
nemar dataset update -m "Fix channel locations" --monitor -y
# 4. Cut a minor release for new subjects
# add new subject folders...
nemar dataset update --bump minor -m "Add 10 new subjects" --monitor -y
# 5. Pure version bump (no data changes)
nemar dataset release nm000108 --type major --monitor