From e9f19a74cfa0ba4ce0ab5ad3c173a82ba921da1c Mon Sep 17 00:00:00 2001 From: Max Cao Date: Thu, 5 Sep 2024 14:15:06 -0700 Subject: [PATCH] Add regex to skip certain jobs based on changed files --- ...t-vertical-pod-autoscaler-operator-master.yaml | 6 ++++++ ...pod-autoscaler-operator-master-presubmits.yaml | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ci-operator/config/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master.yaml b/ci-operator/config/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master.yaml index a8448d66c574..576a131729c1 100644 --- a/ci-operator/config/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master.yaml +++ b/ci-operator/config/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master.yaml @@ -91,18 +91,22 @@ tests: commands: make test container: from: src + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: manifest-diff commands: make manifest-diff container: from: src + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: gofmt commands: make fmt container: from: src + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: govet commands: make vet container: from: src + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: lint commands: | export GOCACHE=/tmp/ @@ -112,11 +116,13 @@ tests: container: clone: true from: golangci-lint + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: yamllint commands: IS_CONTAINER=true make yamllint container: clone: true from: vpa-yamllint + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ - as: security optional: true steps: diff --git a/ci-operator/jobs/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master-presubmits.yaml b/ci-operator/jobs/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master-presubmits.yaml index 0b4d3a540198..1913ccbbb2c1 100644 --- a/ci-operator/jobs/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master-presubmits.yaml +++ b/ci-operator/jobs/openshift/vertical-pod-autoscaler-operator/openshift-vertical-pod-autoscaler-operator-master-presubmits.yaml @@ -288,7 +288,7 @@ presubmits: secretName: result-aggregator trigger: (?m)^/test( | .* )e2e-aws-upgrade,?($|\s.*) - agent: kubernetes - always_run: true + always_run: false branches: - ^master$ - ^master- @@ -300,6 +300,7 @@ presubmits: pj-rehearse.openshift.io/can-be-rehearsed: "true" name: pull-ci-openshift-vertical-pod-autoscaler-operator-master-gofmt rerun_command: /test gofmt + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ spec: containers: - args: @@ -341,7 +342,7 @@ presubmits: secretName: result-aggregator trigger: (?m)^/test( | .* )gofmt,?($|\s.*) - agent: kubernetes - always_run: true + always_run: false branches: - ^master$ - ^master- @@ -353,6 +354,7 @@ presubmits: pj-rehearse.openshift.io/can-be-rehearsed: "true" name: pull-ci-openshift-vertical-pod-autoscaler-operator-master-govet rerun_command: /test govet + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ spec: containers: - args: @@ -449,7 +451,7 @@ presubmits: secretName: result-aggregator trigger: (?m)^/test( | .* )images,?($|\s.*) - agent: kubernetes - always_run: true + always_run: false branches: - ^master$ - ^master- @@ -461,6 +463,7 @@ presubmits: pj-rehearse.openshift.io/can-be-rehearsed: "true" name: pull-ci-openshift-vertical-pod-autoscaler-operator-master-lint rerun_command: /test lint + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ spec: containers: - args: @@ -502,7 +505,7 @@ presubmits: secretName: result-aggregator trigger: (?m)^/test( | .* )lint,?($|\s.*) - agent: kubernetes - always_run: true + always_run: false branches: - ^master$ - ^master- @@ -514,6 +517,7 @@ presubmits: pj-rehearse.openshift.io/can-be-rehearsed: "true" name: pull-ci-openshift-vertical-pod-autoscaler-operator-master-manifest-diff rerun_command: /test manifest-diff + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ spec: containers: - args: @@ -694,7 +698,7 @@ presubmits: secretName: result-aggregator trigger: (?m)^/test( | .* )security,?($|\s.*) - agent: kubernetes - always_run: true + always_run: false branches: - ^master$ - ^master- @@ -706,6 +710,7 @@ presubmits: pj-rehearse.openshift.io/can-be-rehearsed: "true" name: pull-ci-openshift-vertical-pod-autoscaler-operator-master-unit rerun_command: /test unit + skip_if_only_changed: \.md$|^(?:\.gitignore|OWNERS|PROJECT|LICENSE)$ spec: containers: - args: