buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

testing: try to build every commit in a PR

Open tonistiigi opened this issue 3 years ago • 6 comments

When multi-commit PR is submitted, every commit should build successfully(just build is fine, no need to run tests for every commit). We should verify this in the CI to make sure this is actually the case. Otherwise, it is hard to be sure about that in big PRs like #3075 .

tonistiigi avatar Sep 02 '22 01:09 tonistiigi

For PR's like https://github.com/moby/buildkit/pull/3075, it should probably also do a vendor-check for each commit. Ideally we'd also have a way to re-trigger CI and it doing a merge of the target branch into the PR branch before running.

thaJeztah avatar Sep 02 '22 08:09 thaJeztah

I think it's possible by iterating github.base_ref to github.head_ref and create a matrix of each commit from there.

crazy-max avatar Sep 02 '22 09:09 crazy-max

it should probably also do a vendor-check for each commit

If it easy to detect the commits that change the vendor then maybe. But the main reason for doing this is to make sure the git bisect works correctly(in addition to checking that commits are correctly separated) so the validations don't matter much for that case.

tonistiigi avatar Sep 02 '22 18:09 tonistiigi

Yep you can do this in GHA - have a job (e.g. the base one) generate some JSON and use the fromJson() function in your matrix def on the later job

ciaranmcnulty avatar Sep 05 '22 15:09 ciaranmcnulty

If we do, we should probably add a sensible limit to that list; if a PR has a bad rebase, pulling in 1000 commits (yes, it happened), we don't want to start a queue of 1000 runs 😁

thaJeztah avatar Sep 05 '22 16:09 thaJeztah

What would the limit be?

oxr463 avatar Sep 23 '22 10:09 oxr463

Wonder if in complement of #3624 we could also enable the Merge Queue feature https://github.blog/changelog/2023-02-08-pull-request-merge-queue-public-beta/

crazy-max avatar Feb 14 '23 08:02 crazy-max