seL4 / ci-actions

CI GitHub actions for the seL4 repositories
https://sel4.systems
3 stars 13 forks source link

Make "Test with:" support branches also #198

Open axel-h opened 2 years ago

axel-h commented 2 years ago

When working on forks and feature-branches, having "Test with:" support branches also besides just PRs would be nice. That avoids having to create PRs for every affected repo during the development cycle, but still allows using the github CI. The short syntax could be <org>/<repo>@<branch>, the long syntax is https://github.com/<org>/<repo>/tree/<branch>.

lsf37 commented 2 years ago

That is probably easy to add, and would be useful, yes.

Does this add any new security considerations? So far, a PR must have been raised for the target to be included. Pretty much anyone can do that (apart from blocked users). So the new scope is someone pointing to some branch in a different org they control, but if they are a first-time contributor the tests have to be manually approved first anyway, so I think this is fine.

axel-h commented 2 years ago

Looking at https://github.com/seL4/ci-actions/pull/217/files, this could also support hashes. This feature might come for free if this is implemented with the standard git tools. Otherwise is should implement the same behavior, that matching a branch name take preference over matching a commit id.

lsf37 commented 2 years ago

It'll not be entirely free, because constructing the ref for a PR is a bit special, but it could be done relatively easily. The relevant lines in scripts/fetch-extra-prs.sh are these:

https://github.com/seL4/ci-actions/blob/2416319713351de1f210366fdbb70c0dbfb52673/scripts/fetch-extra-prs.sh#L29-L34

We'd need to do something similar as in fetch-branch.sh to distinguish pulling a sha from pulling a ref:

https://github.com/seL4/ci-actions/blob/2416319713351de1f210366fdbb70c0dbfb52673/scripts/fetch-branch.sh#L33-L45