-
Notifications
You must be signed in to change notification settings - Fork 148
ENH: add ability to test examples PR against PR in bids-specification #515
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
base: master
Are you sure you want to change the base?
Conversation
|
Yep, there temporarily changes the workflow. This is what this tries to avoid and make it more explicit and so it could just be all handled via explicit metadata in description and then merge |
|
Sounds good. |
effigies
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current process is to prevent non-dev runs from testing new examples, and use validator and schema from releated PRs in dev. Instead of adding a new bids-pr run, I think it would be helpful just to automate the changes to dev.
If you want the run name to be clearly different from dev, then I would replace dev with the other name in the matrix, but have the new name use identical steps to dev.
As to triggers, I don't really like the false positive rate of these triggers. I wonder if we could use a label trigger. Maybe the job could remove the trigger, but we could at least remove and re-add the label to re-trigger.
WDYT?
| if [ -n "${{ steps.find-pr.outputs.pr_number }}" ]; then | ||
| EXTRA_ITEM=', "bids-pr"' | ||
| fi | ||
| echo "matrix=[\"stable\", \"main\", \"dev\", \"legacy\"${EXTRA_ITEM}]" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would either deactivate dev or just update dev steps to use your environment variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why to collide the two making it to change meaning of a CI run? "explicit better than implicit", so I would have just added one dedicated run so if dev passes somehow -- should alert people if they expect non-released bids-specification to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I called it dev-prs now to reflect the fact that we still use dev version of validator even if no PR is given for it.
| - name: Install BIDS validator (main) | ||
| if: matrix.bids-validator == 'main' | ||
| if: matrix.bids-validator == 'main' || matrix.bids-validator == 'bids-pr' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, dev tracks unreleased changes to the schema, while main tracks the latest released version of BIDS. PRs against the spec will mostly aim for dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it is useful to know if it fails against released version since if it doesn't but expects to (e.g. new file type was introduced like atlas-<label>_description.json but released validator+schema is ok with that means that either they miss something or something else is not stringent enough. The same about dev as -- have we made development validator and/or schema less stringent, as we would expect then only the dev-pr to pass in such cases. That is why I preferred to keep it separate and additional matrix run.
Allow validate_datasets workflow to re-run when PR description is edited, enabling dynamic detection of bids-specification-pr references added after PR creation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fix missing closing bracket in matrix JSON output - Fix variable name mismatch (PR_BODY_NUM vs PR_NUM) - Fix regex pattern for PR detection (escape sequences) - Fix bash conditional syntax (use || instead of 'or') 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Use heredoc to safely handle PR body content that may contain: - Quotes (single and double) - Newlines and multiline text - Special bash characters 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
6f613fc to
539efa1
Compare
Co-authored-by: Chris Markiewicz <[email protected]>
recommendations? could be |
ae0834e to
156674b
Compare
…to use SPEC_PR instead of BIDS_PR var Also renamed into `dev-prs` to ensure reflecting the fact that we are installing a development version of the validator even if PR for it not given.
156674b to
de7e985
Compare
eh, OSX keeps giving grief -- even Windows works! # Fetch PR info (fork URL and branch) - avoid mapfile for macOS compatibility
pr_json=$(curl -s https://api.github.com/repos/bids-standard/bids-validator/pulls/305)
fork_url=$(echo "$pr_json" | jq -r '.head.repo.html_url')
branch=$(echo "$pr_json" | jq -r '.head.ref')
echo "I: Received fork_url=$fork_url branch=$branch"
# Perform the same installation as in "dev"
git clone -b "$branch" "$fork_url" ../bids-validator
cd ../bids-validator
deno compile -A -o $HOME/.deno/bin/bids-validator src/bids-validator.ts
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
SPEC_PR: 2231
VAL_PR: 305
TZ: Europe/Berlin
FORCE_COLOR: 1
I: Received fork_url=null branch=null
fatal: repository 'null' does not exist |
Switch from curl to gh api for fetching PR info. The gh cli handles authentication automatically and avoids GitHub API rate limits that were causing failures on macOS runners (60 req/hr unauthenticated vs 1000 req/hr authenticated). Also add error checking for failed API responses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
@effigies I think it works now!!! Please re-review and try on some PRs of interest to you. Would be great to see it in action for PRs like |
Many PRs are developed to accompany WiP BEP PRs. It is beneficial to establish testing against likely a modified BIDS schema in those PRs. In this solution we should expand matrix of runs with
bids-prrun against that arbitrary PR if entered in a line withbids-specification-pr:.TODOs
should run correctly ifdecided not to bother since would lead on github to local PR etc#number(TODO)