bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

Options to treat presence of modalities as an error

Open effigies opened this issue 3 years ago • 8 comments

Databases may use the validator to determine whether to accept a dataset, a practice notably employed by OpenNeuro to keep a low-overhead submission process. With the expansion into new modalities, it may be useful for a database to accept/reject entire modalities to ensure that the data being uploaded fits the intended scope and capabilities of the database.

Critically, the rejection mechanism must not be bypassable via .bidsignore.

effigies avatar Jan 06 '22 18:01 effigies

Related: #844.

effigies avatar Jan 06 '22 18:01 effigies

From meeting today, can at least issue error after this step in validation if an unacceptable modality is found: https://github.com/bids-standard/bids-validator/blob/c1c961599b086fdacf61cbc2327b35e8002f9bc3/bids-validator/validators/bids/fullTest.js#L46

rwblair avatar Jan 12 '22 21:01 rwblair

added in #1418 but I realize now is still bypassable by bidsignore, ignored files are filtered out before the collectModality call is made inside of collectSummary.

rwblair avatar Feb 11 '22 21:02 rwblair

Files in .bidsignore are getting culled even earlier that fullTest it looks like, printing length of Object.keys(fileList) does not change before or after collectSummary call, or even after a further down loop in fullTest where files with an ignore property are being removed from fileList.

rwblair avatar Feb 11 '22 21:02 rwblair

Forgot about this, ignored files are treated differently in node and in the browser. In node ignored files are never pushed to the fileList where as browser files get an ignore key set to tree added to their file object. This happens in utils/files/readDir.

rwblair avatar Feb 11 '22 21:02 rwblair

Forgot about this, ignored files are treated differently in node and in the browser. In node ignored files are never pushed to the fileList where as browser files get an ignore key set to tree added to their file object. This happens in utils/files/readDir.

They also get removed again here. Node should probably just also set ignore, then let this step clean them up after anything that needs to consider the ignored files has been tested.

https://github.com/bids-standard/bids-validator/blob/a755f65740fab23648415701c8f07d9633fca525/bids-validator/validators/bids/fullTest.js#L72-L77

nellh avatar Feb 11 '22 21:02 nellh

Is that redundant with this being run before it?: https://github.com/bids-standard/bids-validator/blob/a755f65740fab23648415701c8f07d9633fca525/bids-validator/utils/summary/collectSummary.js#L24-L29

rwblair avatar Feb 11 '22 22:02 rwblair

I'll make a new PR to have node treat ignored files the same as browser, and fix the modality blacklist check.

rwblair avatar Feb 11 '22 22:02 rwblair