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.
Version Types
Section titled “Version Types”- 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.
Two Workflows
Section titled “Two Workflows”1. Version Bump Only (release)
Section titled “1. Version Bump Only (release)”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.
# Interactive: prompts for patch/minor/majornemar dataset release nm000104
# Non-interactive: specify bump type directlynemar dataset release nm000104 --type patch -y
# Explicit versionnemar dataset release nm000104 --version 2.0.0 -yWhat happens:
- CLI clones the repo to a temp directory
- Creates branch
release/v1.0.1 - Updates
dataset_description.jsonwith new version - Pushes and creates a PR
- CI runs BIDS validation and version checks
- On merge: tag, GitHub Release, and version DOI (if concept DOI exists)
2. Data or Metadata Changes (update)
Section titled “2. Data or Metadata Changes (update)”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.).
# First, clone and make changes locallynemar dataset clone nm000104cd nm000104nemar dataset get .
# Make your changes...# Edit participants.tsv, add new files, etc.
# Push changes via PRnemar dataset update -m "Add subjects 10-15"What happens:
- CLI detects dataset ID from git remote
- Categorizes changes (metadata vs data files)
- Creates branch
update/nm000104-<timestamp> - Bumps version (patch by default)
- Commits all changes
- For data files: uploads to S3 via
git annex copy --to nemar-s3 - Pushes and creates a PR
OpenNeuro Mirrors
Section titled “OpenNeuro Mirrors”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 majornemar 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>: itsmajorchoice cannot be selected, and acustom versionwith 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.
What the Check Does Not Cover
Section titled “What the Check Does Not Cover”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.
Monitoring CI and Auto-merge
Section titled “Monitoring CI and Auto-merge”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:
# Release with monitoringnemar 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!Using an Existing Clone
Section titled “Using an Existing Clone”If you already have the dataset cloned, avoid a redundant clone:
# Use --dir with releasenemar dataset release nm000104 --dir ./nm000104
# Or just cd into the clone for updatecd nm000104nemar dataset updateEvery Revision Needs a Change Log Entry
Section titled “Every Revision Needs a Change Log Entry”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
Versionindataset_description.jsongoes up. A version insideGeneratedByis 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
READMEor ofCHANGESthat was already there, an author field ofdataset_description.jsonand the values a participant already has are not altered, moved or removed. See The automated review of your pull request.
Pull Request Titles and Descriptions
Section titled “Pull Request Titles and Descriptions”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 asFirstAuthorSurname,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
Lee2019orLee-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.
What CI Checks Run on PRs
Section titled “What CI Checks Run on PRs”When a PR is created against main, GitHub Actions runs two workflows:
- 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. - Version Check (
version-check.yml) - Ensuresdataset_description.jsonhas 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.
What Happens on PR Merge
Section titled “What Happens on PR Merge”When a PR is merged to main, the pr-merge.yml workflow fires and performs:
- Tag and Release - Reads the version from
dataset_description.json, creates avX.Y.Zgit tag and GitHub Release - Webhook - Calls the backend’s
/webhooks/publish-version-doiendpoint with the dataset ID, version, and release URL - Version DOI - If a concept DOI exists, the backend mints a version DOI through EZID.
The DOI pattern is
<concept_doi>.v<version>, for example10.82901/nemar.on005506.v1.0.0. DOIs are not case sensitive; this is the lowercase form that DataCite registers and the landing page shows. - 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.
- 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.
The .nemar/ Directory
Section titled “The .nemar/ Directory”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.
Prerequisites
Section titled “Prerequisites”- 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)
Examples
Section titled “Examples”Quick patch release
Section titled “Quick patch release”nemar dataset release nm000104 --type patch -yMinor release with monitoring
Section titled “Minor release with monitoring”nemar dataset release nm000104 --type minor --monitorUpdate metadata files
Section titled “Update metadata files”cd nm000104# Edit participants.tsv, dataset_description.json, etc.nemar dataset update -m "Fix participant demographics"Update with new data files
Section titled “Update with new data files”cd nm000104# Add new EDF files to sub-XX/eeg/nemar dataset update --bump minor -m "Add subjects 20-25"Update from a different directory
Section titled “Update from a different directory”nemar dataset update /path/to/nm000104 --bump patch -m "Fix events.tsv"Full lifecycle example
Section titled “Full lifecycle example”# 1. Upload a new datasetnemar 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 versionnemar dataset clone nm000108cd nm000108nemar 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