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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/workflows/pull-request-commentor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,30 @@ jobs:
branch: [release-v3.8, release-v3.9, devel]
k8s: ["1.25", "1.26", "1.27", "1.28"]
exclude:
# The exclude items below are dynamically constructed. If the
# base_ref matches the given branch, it will be excluded from the
# test matrix.

# the next Ceph-CSI version will not be tested with old Kubernetes
- k8s: "1.25"
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).


# Ceph-CSI <= 3.9 was released before Kubernetes 1.28
- k8s: "1.28"
branch: release-v3.8
branch: >
${{ "release-v3.8" == github.base_ref
&& github.base_ref || "no-exclude" }}
- k8s: "1.28"
branch: release-v3.9
branch: >
${{ "release-v3.9" == github.base_ref
&& github.base_ref || "no-exclude" }}

# watch out, matrix.branch can not be used in this if-statement :-/
if: >
(github.event.label.name == 'ok-to-test' &&
github.event.pull_request.merged != true &&
github.base_ref == matrix.branch)
github.event.pull_request.merged != true)

steps:
- name: >
Expand Down