Skip to content

Commit a4c5573

Browse files
committed
feat(dogfood): use cancel-in-progress/path-change
Added `cancel-in-progress` annotation to multiple Tekton YAML files to ensure that in-progress pipeline runs are canceled when new runs are triggered. Use `on-path-change` and `on-target-event` annotations to as well for path change. Signed-off-by: Chmouel Boudjnah <[email protected]>
1 parent d7b0d9c commit a4c5573

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.tekton/doc.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ kind: PipelineRun
44
metadata:
55
name: doc-generation
66
annotations:
7-
pipelinesascode.tekton.dev/task: "[git-clone]"
87
pipelinesascode.tekton.dev/max-keep-runs: "2"
9-
pipelinesascode.tekton.dev/on-cel-expression: |
10-
event == "pull_request" && "docs/***".pathChanged()
8+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
9+
pipelinesascode.tekton.dev/on-event: "pull_request"
10+
pipelinesascode.tekton.dev/on-path-change: "[docs/***]"
11+
pipelinesascode.tekton.dev/on-target-branch: "main"
1112
spec:
1213
params:
1314
- name: repo_url

.tekton/generate-coverage-release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
annotations:
77
pipelinesascode.tekton.dev/task: "[git-clone]"
88
pipelinesascode.tekton.dev/max-keep-runs: "2"
9+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
910
pipelinesascode.tekton.dev/on-cel-expression: |
1011
event == "push" && target_branch == "main" && ("***/*.go".pathChanged() || "config/***".pathChanged() || ".tekton/generate-coverage-release.yaml".pathChanged())
1112
spec:

.tekton/go.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ metadata:
66
annotations:
77
pipelinesascode.tekton.dev/task: "[git-clone]"
88
pipelinesascode.tekton.dev/max-keep-runs: "2"
9-
pipelinesascode.tekton.dev/on-cel-expression: |
10-
event == "pull_request" && "***/*.go".pathChanged()
9+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
10+
pipelinesascode.tekton.dev/on-event: "pull_request"
11+
pipelinesascode.tekton.dev/on-target-branch: "main"
12+
pipelinesascode.tekton.dev/on-path-change: "[***/*.go]"
1113
spec:
1214
params:
1315
- name: repo_url

.tekton/linter.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
pipelinesascode.tekton.dev/on-event: "[push, pull_request]"
88
pipelinesascode.tekton.dev/on-target-branch: "[*]"
99
pipelinesascode.tekton.dev/max-keep-runs: "2"
10+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
1011
pipelinesascode.tekton.dev/task: "[git-clone]"
1112
spec:
1213
params:

.tekton/release-pipeline.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ metadata:
88
pipelinesascode.tekton.dev/on-target-branch: "[refs/tags/*]"
99
pipelinesascode.tekton.dev/task: "[.tekton/tasks/goreleaser.yaml]"
1010
pipelinesascode.tekton.dev/task-1: "[git-clone]"
11+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
1112
pipelinesascode.tekton.dev/max-keep-runs: "2"
1213
spec:
1314
params:

0 commit comments

Comments
 (0)