ENH: add ability to test examples PR against PR in bids-specification
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-pr run against that arbitrary PR if entered in a line with bids-specification-pr:.
TODOs
- test with proposed line in the template
- Needs testing against a bids-specification-pr: https://github.com/bids-standard/bids-specification/pulls/2140
- [x] should not run/fail if not a match
- [x] should run correctly if number
- ~~should run correctly if
#number(TODO)~~ decided not to bother since would lead on github to local PR etc - [x] should run correctly if URL
- [x] see what happens if schema is bad (according to https://github.com/bids-standard/bids-schema/tree/main/PRs 2140 is no good ATM): well -- it is kinda different point since there is a .json already, and #2140 was failing to build for us...
- [x] should rerun when description edited
- it is kinda needed to react when people edit/enter URL but annoying since even checkmarks would trigger it. May be not to do?
Please see #480 and #514 for examples of testing BEPs against schema and validator branches.
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.
If you want the run name to be clearly different from
dev, then I would replacedevwith the other name in the matrix, but have the new name use identical steps todev.
recommendations? could be master or main I guess to reflect that it is a branch
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
@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
- #497 which require
- https://github.com/bids-standard/bids-validator/pull/305 ?