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

Update nwbinspector validation workflow #122

Merged
merged 4 commits into from
Jan 8, 2025
Merged

Update nwbinspector validation workflow #122

merged 4 commits into from
Jan 8, 2025

Conversation

stephprince
Copy link
Collaborator

Fix #96.

The validation job will now fail if NWBInspector finds issues at or above the BEST_PRACTICE_VIOLATION importance level in the NWB files generated by the tests.

@stephprince stephprince marked this pull request as ready for review January 7, 2025 20:16
@stephprince stephprince requested a review from oruebel January 7, 2025 20:16
nwbinspector nwb_files --threshold BEST_PRACTICE_VIOLATION
nwbinspector nwb_files --threshold BEST_PRACTICE_VIOLATION --json-file-path out.txt
if ! grep -q '"messages": \[\]' out.txt; then
echo "NWBInspector found issues in the NWB files"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to also print the contents of the out.txt file to the command-line to make it easy to see the issues found in the GitHub Action directly. I would also rename out.txt to out.json

Copy link
Collaborator Author

@stephprince stephprince Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to also print the contents of the out.txt file to the command-line to make it easy to see the issues found in the GitHub Action directly.

The report summary should be printed out and formatted automatically by running nwbinspector (see the Install pynwb and run validation step here), in this action there are 0 issues found but otherwise it will print the issues in the GitHub Action.

I would also rename out.txt to out.json

Will do!

Comment on lines 144 to 146
nwbinspector nwb_files --threshold BEST_PRACTICE_VIOLATION --json-file-path out.txt
if ! grep -q '"messages": \[\]' out.txt; then
echo "NWBInspector found issues in the NWB files"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
nwbinspector nwb_files --threshold BEST_PRACTICE_VIOLATION --json-file-path out.txt
if ! grep -q '"messages": \[\]' out.txt; then
echo "NWBInspector found issues in the NWB files"
nwbinspector nwb_files --threshold BEST_PRACTICE_VIOLATION --json-file-path out.json
if ! grep -q '"messages": \[\]' out.json; then
echo "NWBInspector found issues in the NWB files"
cat out.json

@stephprince stephprince merged commit 4d15cdc into main Jan 8, 2025
9 checks passed
@stephprince stephprince deleted the fix-validation branch January 8, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix validation workflow to throw errors on invalid files
2 participants