Skip to content

Commit b45febf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dev
2 parents 9a394f0 + 88037c9 commit b45febf

25 files changed

+565
-299
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
tags: ['*']
7+
pull_request:
8+
branches: [main, dev]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Check out the repo
24+
uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 200
27+
filter: blob:none
28+
# fetch-tags: true breaks on tags
29+
fetch-tags: ${{ !startsWith(github.ref, 'refs/tags/') }}
30+
31+
- name: Log in to Docker Hub
32+
if: github.event_name == 'push'
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ secrets.DOCKER_USERNAME }}
36+
password: ${{ secrets.DOCKER_PASSWORD }}
37+
38+
- name: Extract metadata (tags, labels) for Docker
39+
id: meta
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: bids/validator
43+
44+
- name: Build ${{ startsWith(github.ref, 'refs/tags/') && 'and push' || '' }} ${{ steps.meta.outputs.tags }}
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: .
48+
push: ${{ startsWith(github.ref, 'refs/tags/') }}
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
52+
- name: Verify Docker image
53+
run: docker run --rm ${{ fromJSON(steps.meta.outputs.json).tags[0] }} --version

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,54 @@
11

2+
<a id='changelog-2.0.11'></a>
3+
# 2.0.11 — 2025-08-29
4+
5+
## Fixed
6+
7+
- Docker build workflow should now run correctly on releases.
8+
9+
<a id='changelog-2.0.10'></a>
10+
# 2.0.10 — 2025-08-29
11+
12+
## Added
13+
14+
- Added a [FAQ] to the user guide. ([#215])
15+
16+
[FAQ]: https://bids-validator.readthedocs.io/en/latest/user_guide/faq.html
17+
[#215]: https://github.com/bids-standard/bids-validator/issues/215
18+
19+
## Changed
20+
21+
- Improved handling of TSV columns with sidecar definitions.
22+
`"Format"`, `"Minimum"` and `"Maximum"` keys are now supported.
23+
24+
- `--datasetTypes` and `--blacklistModalities` options now accept a string array (`--datasetTypes raw,derivative`) and can be combined.
25+
26+
## Fixed
27+
28+
- A crash in the web validator prevented validation from taking place.
29+
30+
## Infrastructure
31+
32+
- Docker images will once again be pushed to [bids/validator][].
33+
34+
[bids/validator]: https://hub.docker.com/r/bids/validator/
35+
36+
<a id='changelog-"2.0.9"'></a>
37+
# "2.0.9" — 2025-08-26
38+
39+
## Added
40+
41+
- Display version in web app
42+
43+
- The `--datasetTypes` flag accepts a list of `DatasetType`s,
44+
allowing applications to restrict the datasets they accept.
45+
46+
## Changed
47+
48+
- Upgraded to BIDS schema version 1.0.13.
49+
50+
- Raise error when JSON files are parsed and their root value is anything other than an object
51+
252
<a id='changelog-"2.0.8"'></a>
353
# "2.0.8" — 2025-08-07
454

Dockerfile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
ARG BASE_IMAGE=denoland/deno:2.0.1
1+
ARG BASE_IMAGE=denoland/deno:alpine-2.4.5
22
FROM ${BASE_IMAGE} AS build
33
WORKDIR /src
44

5-
RUN apt-get update && \
6-
apt-get install -y git jq && \
7-
apt-get clean && \
8-
rm -rf /var/lib/apt/lists/*
5+
RUN apk add --no-cache git jq
96

107
ADD . .
118
RUN export VERSION=`git -C . -c safe.directory=* describe --tags --always` && \
12-
jq -r ".version|=\"$VERSION\"" bids-validator/deno.json > ._deno.json
9+
jq -r ".version|=\"$VERSION\"" deno.json > ._deno.json && \
10+
mv ._deno.json deno.json
1311

14-
WORKDIR /src/bids-validator
15-
RUN deno cache ./bids-validator-deno
16-
RUN ./build.ts
17-
18-
FROM ${BASE_IMAGE} AS base
19-
WORKDIR /src
20-
COPY . .
21-
COPY --from=build /src/._deno.json /src/bids-validator/deno.json
22-
WORKDIR /src/bids-validator
23-
RUN deno cache ./bids-validator-deno
24-
ENTRYPOINT ["./bids-validator-deno"]
12+
RUN deno run -A ./build.ts
2513

2614
FROM ${BASE_IMAGE} AS min
2715
WORKDIR /src
28-
COPY --from=build /src/bids-validator/dist/validator/* .
16+
COPY --from=build /src/dist/validator/bids-validator.js .
2917

3018
ENTRYPOINT ["deno", "-A", "./bids-validator.js"]

changelog.d/20250807_170325_markiewicz_update_schema.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

changelog.d/20250808_135941_rosswilsonblair_raise_error_on_non_object_json.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

changelog.d/20250819_113044_markiewicz_display_version.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ deno run -A jsr:@bids/validator
3333
user_guide/web.md
3434
user_guide/command-line.md
3535
user_guide/issues.md
36+
user_guide/faq.md
3637
```
3738

3839
```{toctree}

docs/user_guide/faq.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Frequently Asked Questions
2+
3+
This page is for questions about the Javascript validator that may not be
4+
well addressed elsewhere in the documentation.
5+
6+
If you have a question, please [open an issue][new-issue].
7+
The answer may end up on this page!
8+
9+
## Q: What does the validator actually check?
10+
11+
The BIDS Validator aspires to check that a dataset meets the requirements of the BIDS Standard.
12+
The primary way it does this is by interpreting the [BIDS Schema][schema-description].
13+
14+
The general categories of rules include:
15+
16+
- Filename rules: These rules indicate valid combinations of [entities][], [suffixes][definitions]
17+
[datatypes][definitions] and [extensions][definitions].
18+
Every file in a dataset must match a filename rule.
19+
- Sidecar and JSON rules: These rules indicate whether fields are REQUIRED, RECOMMENDED
20+
or OPTIONAL in a JSON file.
21+
REQUIRED fields produce errors on absence, while RECOMMENDED fields produce warnings on absence.
22+
If the field is defined, then it also has a type (for example, numeric or textual);
23+
type mismatches produce errors.
24+
- Tabular data rules: These rules indicate what columns are REQUIRED, RECOMMENDED or OPTIONAL
25+
in a TSV file, and behave similarly to sidecar rules.
26+
Additionally, tabular file rules may indicate that columns must appear in a certain order or
27+
have unique values, and that additional columns are permitted or forbidden.
28+
If JSON sidecar files provide definitions for columns,
29+
the values in those columns are validated against those definitions.
30+
- Checks: These rules are conditional assertions, with the form of selectors and checks.
31+
Selectors are expressions that determine whether the rule applies to the file or dataset,
32+
and checks are expressions about the file or dataset that must evaluate to `true`.
33+
34+
## Q: Why doesn't the validator warn/error about inconsistencies in some TSV columns?
35+
36+
A specific question we've received is why the validator does not ensure that a
37+
column like `sex` in `participants.tsv` will permit both `f` and `F`,
38+
rather than enforce consistency.
39+
40+
The reason for this is that `sex` (like `age`) is not rigorously defined by the BIDS Standard,
41+
but is provided as an example with a default definition.
42+
Default definitions are loose and often accept a wide range of values that would be
43+
understandable by humans while still allowing some amount of machine validation.
44+
As of BIDS 1.10.0, the definition of `sex` in the schema is:
45+
46+
```json
47+
{
48+
"sex": {
49+
"LongName": "sex",
50+
"Description": "String value indicating phenotypical sex.",
51+
"Levels": {
52+
"F": "Female",
53+
"FEMALE": "Female",
54+
"Female": "Female",
55+
"f": "Female",
56+
"female": "Female",
57+
"M": "Male",
58+
"MALE": "Male",
59+
"Male": "Male",
60+
"m": "Male",
61+
"male": "Male",
62+
"O": "Other",
63+
"OTHER": "Other",
64+
"Other": "Other",
65+
"o": "Other",
66+
"other": "Other"
67+
}
68+
}
69+
}
70+
```
71+
72+
Data curators are encouraged to refine this definition in their `participants.json` sidecar file,
73+
for example, if you use the SNOMEDCT ontology:
74+
75+
```json
76+
{
77+
"sex": {
78+
"LongName": "sex",
79+
"Description": "Finding related to biological sex",
80+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/429019009",
81+
"Levels": {
82+
"F": {
83+
"Description": "Female",
84+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/248152002",
85+
},
86+
"M": {
87+
"Description": "Male",
88+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/248153007",
89+
},
90+
"I": {
91+
"Description": "Intersex",
92+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/32570691000036108",
93+
},
94+
"X": {
95+
"Description": "Indeterminate sex",
96+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/32570681000036106",
97+
}
98+
}
99+
}
100+
}
101+
```
102+
103+
If provided, the validator will check that all values in the column are `F`, `M`, `I`, `X`,
104+
or `n/a` (which is permitted in all columns, according to the BIDS Standard).
105+
106+
107+
[new-issue]: https://github.com/bids-standard/bids-validator/issues/new
108+
[schema-description]: https://bidsschematools.readthedocs.io/en/latest/description.html
109+
[entities]: https://bids-specification.readthedocs.io/en/stable/common-principles.html#entities
110+
[definitions]: https://bids-specification.readthedocs.io/en/stable/common-principles.html#definitions

0 commit comments

Comments
 (0)