Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno validator doesn't detect absent required files #1908

Open
bleonar5 opened this issue Mar 6, 2024 · 0 comments
Open

Deno validator doesn't detect absent required files #1908

bleonar5 opened this issue Mar 6, 2024 · 0 comments
Labels
bug impact: high Estimated high impact task schema

Comments

@bleonar5
Copy link

bleonar5 commented Mar 6, 2024

TL;DR: The deno validator app does not output an error when a required file, such as dataset_description.json, is not present in the dataset.

Since the Deno validator is currently in development, it's very possible that the dev team is aware of this bug and has a plan to address it, so feel free to ignore if this issue is superfluous. I became aware of it because I am developing a similar open source validator tool and used this deno app as a model.

Basically, your validator crawls through the file tree and, whenever it encounters a file, gathers up the relevant rules for that type of file, and checks the rules against it. The issue is that, if a file like dataset_description.json isn't present in the file system, then no file is ever encountered, and no rules are ever checked against it. At first I thought this was intentional, but going back to test the older BIDS validator, I can see that they have a DATASET_DESCRIPTION_MISSING error that is produced when the file is missing.

For what it's worth, my solution to this issue was to maintain a dictionary called rulesRecord with schema locations of rules as keys and booleans as values, and I used this dict to keep track of which rules were ever added to context.filenameRules. Any rules that were detected under rules.files but were never added to context.filenameRules at some point during validation were an indication of an absent element, and depending on that file's requirement level, an issue was produced. the codes and reasons for these issues I stored directly in the rule object for the file itself (for instance, rules.files.common.core.dataset_description has property "code" with value "MISSING_DATASET_DESCRIPTION").

our validator app

@effigies effigies added bug impact: high Estimated high impact task schema labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug impact: high Estimated high impact task schema
Projects
None yet
Development

No branches or pull requests

2 participants