jenkins-x / lighthouse

Apache License 2.0
184 stars 115 forks source link

Support matrix style job definitions #1136

Open garethjevans opened 4 years ago

garethjevans commented 4 years ago

GitHub Actions has a really clean syntax for supporting matrix job definitions e.g.

    strategy:
      matrix:
        os: [windows-2016, windows-2019, ubuntu-20.04]
        version: [8, 11, 14, 15]
        vm: [hotspot, openj9]
        package: [jdk, jre]
        runtype: [test]

It would be great if we could do something similar inside JX, ideally having each permutation appear as a separate check/build. With the ability to retrigger/override each one.

jstrachan commented 4 years ago

this would be awesome.

it might be nice to support a matrix_presubmit entry in the .lighthouse/myfolder/triggers.yaml file so that you could generate the matrix of presubmits which each have their own name / context, appear separately as separate checks on github and can have their own chatops trigger/rerun commands etc.

e.g.

# .lighthouse/jenkins-x/triggers.yaml

# lets use a matrix to generate lots of presubmit contexts...
-  presubmit_matrix:
      matrix:
        os: [windows-2016, windows-2019, ubuntu-20.04]
        version: [8, 11, 14, 15]
        vm: [hotspot, openj9]
        package: [jdk, jre]
        runtype: [test]

which then effectively generates...

- presubmits:
  - name: windows-2016-8-hotspot-jdk-test 
    ...
  - name: windows-2019-8-hotspot-jdk-test

the main thing to figure out would be how to generate nice trigger/rerun expressions for each matrix combination.

e.g. if you wanted to trigger /test os:* version:8 for example. It might be nice to generate some canonical matrix trigger/rerun expressions.

Also it'd be nice to be able to specify which permutations are always run (or not). You may only want to always run a smaller subset of the matrix.

e.g. maybe something like...

# .lighthouse/jenkins-x/triggers.yaml

-  presubmit_matrix:
      matrix:
        os: [windows-2016, windows-2019, ubuntu-20.04]
        version: [8, 11, 14, 15]
        vm: [hotspot, openj9]
        package: [jdk, jre]
        runtype: [test]
    always_run:
      os: [ubuntu-20.04]
      version: [15]
jenkins-x-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

hervelemeur commented 3 years ago

/remove-lifecycle stale