Skip to content
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

ci: exclude branches from the testing matrix for ok-to-test comments #4068

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

nixpanic
Copy link
Member

It seems that matrix.* parameters can not be used in the if-statement for a job. Now using the exclude: parameter with a more dynamically constructed value for the branch. If the value for the branch is not part of the initial branch list, the value will not be excluded, so the jobs are expected to run.


Show available bot commands

These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated
    failure (please report the failure too!)

It seems that `matrix.*` parameters can not be used in the if-statement
for a job. Now using the `exclude:` parameter with a more dynamically
constructed value for the branch. If the value for the branch is not
part of the initial branch list, the value will not be excluded, so the
jobs are expected to run.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
@mergify mergify bot added the component/testing Additional test cases or CI work label Aug 22, 2023
@nixpanic nixpanic added ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures labels Aug 22, 2023
@nixpanic
Copy link
Member Author

/test ci/centos/k8s-e2e-external-storage

@nixpanic
Copy link
Member Author

/test ci/centos/mini-e2e-helm

@nixpanic
Copy link
Member Author

/test ci/centos/mini-e2e

@nixpanic
Copy link
Member Author

/test ci/centos/upgrade-tests

branch: devel
branch: >
${{ "devel" == github.base_ref
&& github.base_ref || "no-exclude" }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nixpanic can you point me to the reference to no-exclude? i tried to find one but didn't get any, how about below version

   strategy:
      matrix:
        k8s: ["1.25", "1.26", "1.27", "1.28"]
        branch:
          - github.base_ref
        exclude:
          # the next Ceph-CSI version will not be tested with old Kubernetes
          - k8s: "1.25"
            branch: devel
          # Ceph-CSI <= 3.9 was released before Kubernetes 1.28
          - k8s: "1.28"
            branch: release-v3.8
          - k8s: "1.28"
            branch: release-v3.9

    if: >
      (github.event.label.name == 'ok-to-test' &&
      github.event.pull_request.merged != true )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-exclude is just a placeholder. The branch: value is expanded to the name of the branch, or the non-existing branch no-exclude. If the branch: argument is a non-existing branch, the Kubernetes version will not be excluded (hence included and tested).

@Madhu-1 Madhu-1 requested a review from a team August 22, 2023 10:20
@mergify mergify bot merged commit 2d120f2 into ceph:devel Aug 22, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/skip/e2e skip running e2e CI jobs ci/skip/multi-arch-build skip building on multiple architectures component/testing Additional test cases or CI work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants