You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ tracking using a Git workflow.
35
35
36
36
<--->
37
37
38
-
- Pull-request "*GitOps*" actions through comments with `/retest`, `/test <pipeline-name>` and so on.
38
+
- Pull-request "*GitOps*" actions through comments with `/retest` (reruns failed pipelines), `/test <pipeline-name>` (force rerun specific pipeline) and so on.
39
39
40
40
- Automatic Task resolution in Pipelines (local Tasks, Artifact Hub, and remote URLs)
Copy file name to clipboardExpand all lines: docs/content/docs/guide/gitops_commands.md
+36-19Lines changed: 36 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The advantage of using a `GitOps command` is that it provides a journal of all t
10
10
11
11
## GitOps Commands on Pull Requests
12
12
13
-
For example, when you are on a Pull Request, you may want to restart all your PipelineRuns. To do so, you can add a comment on your Pull Request starting with `/retest`, and all PipelineRuns attached to that Pull Request will be restarted.
13
+
For example, when you are on a Pull Request, you may want to restart failed PipelineRuns. To do so, you can add a comment on your Pull Request starting with `/retest`, and all **failed**PipelineRuns attached to that Pull Request will be restarted. If all previous PipelineRuns for the same commit were successful, no new PipelineRuns will be created to avoid unnecessary duplication.
14
14
15
15
Example:
16
16
@@ -21,6 +21,23 @@ failure is not with your PR but seems to be an infrastructure issue.
21
21
/retest
22
22
```
23
23
24
+
The `/retest` command will only create new PipelineRuns if:
25
+
26
+
- Previous PipelineRuns for the same commit **failed**, OR
27
+
- No PipelineRuns exist for the same commit
28
+
29
+
If a successful PipelineRun already exists for the same commit, `/retest` will **skip** creating a new PipelineRun to avoid unnecessary duplication.
30
+
31
+
**To force a rerun regardless of previous status**, use:
32
+
33
+
```text
34
+
/retest <pipelinerun-name>
35
+
```
36
+
37
+
This will always create a new PipelineRun, even if previous runs were successful.
38
+
39
+
Similar to `/retest`, the `/ok-to-test` command will only create new PipelineRuns if no successful PipelineRun already exists for the same commit. This prevents duplicate runs when repository owners repeatedly approve the same commit.
40
+
24
41
If you have multiple `PipelineRun` and you want to target a specific `PipelineRun`, you can use the `/test` command followed by the specific PipelineRun name to restart it. Example:
25
42
26
43
```text
@@ -241,10 +258,10 @@ You can pass those `key=value` pairs anywhere in your comment, and they will be
241
258
242
259
There are different formats that can be accepted, allowing you to pass values with spaces or newlines:
243
260
244
-
* key=value
245
-
* key="a value"
246
-
* key="another \"value\" defined"
247
-
* key="another
261
+
-key=value
262
+
-key="a value"
263
+
-key="another \"value\" defined"
264
+
-key="another
248
265
value with newline"
249
266
250
267
## Event Type Annotation and Dynamic Variables
@@ -253,14 +270,14 @@ The `pipeline.tekton.dev/event-type` annotation indicates the type of GitOps com
253
270
254
271
Here are the possible event types:
255
272
256
-
* `test-all-comment`: The event is a single `/test` that would test every matched PipelineRun.
257
-
* `test-comment`: The event is a `/test <PipelineRun>` comment that would test a specific PipelineRun.
258
-
* `retest-all-comment`: The event is a single `/retest` that would retest every matched PipelineRun.
259
-
* `retest-comment`: The event is a `/retest <PipelineRun>` that would retest a specific PipelineRun.
260
-
* `on-comment`: The event is coming from a custom comment that would trigger a PipelineRun.
261
-
* `cancel-all-comment`: The event is a single `/cancel` that would cancel every matched PipelineRun.
262
-
* `cancel-comment`: The event is a `/cancel <PipelineRun>` that would cancel a specific PipelineRun.
263
-
* `ok-to-test-comment`: The event is a `/ok-to-test` that would allow running the CI for an unauthorized user.
273
+
-`test-all-comment`: The event is a single `/test` that would test every matched PipelineRun.
274
+
-`test-comment`: The event is a `/test <PipelineRun>` comment that would test a specific PipelineRun.
275
+
-`retest-all-comment`: The event is a single `/retest` that would retest every matched **failed** PipelineRun. If a successful PipelineRun already exists for the same commit, no new PipelineRun will be created.
276
+
-`retest-comment`: The event is a `/retest <PipelineRun>` that would retest a specific PipelineRun.
277
+
-`on-comment`: The event is coming from a custom comment that would trigger a PipelineRun.
278
+
-`cancel-all-comment`: The event is a single `/cancel` that would cancel every matched PipelineRun.
279
+
-`cancel-comment`: The event is a `/cancel <PipelineRun>` that would cancel a specific PipelineRun.
280
+
-`ok-to-test-comment`: The event is a `/ok-to-test` that would allow running the CI for an unauthorized user. If a successful PipelineRun already exists for the same commit, no new PipelineRun will be created.
264
281
265
282
If a repository owner comments `/ok-to-test` on a pull request from an external contributor but no PipelineRun **matches** the `pull_request` event (or the repository has no `.tekton` directory), Pipelines-as-Code sets a **neutral** commit status. This indicates that no PipelineRun was matched, allowing other workflows—such as auto-merge—to proceed without being blocked.
266
283
@@ -272,12 +289,12 @@ Note: This neutral check-run status functionality is only supported on GitHub.
272
289
273
290
When using the `{{ event_type }}` [dynamic variable]({{< relref "/docs/guide/authoringprs.md#dynamic-variables" >}}) for the following event types:
274
291
275
-
* `test-all-comment`
276
-
* `test-comment`
277
-
* `retest-all-comment`
278
-
* `retest-comment`
279
-
* `cancel-all-comment`
280
-
* `ok-to-test-comment`
292
+
-`test-all-comment`
293
+
-`test-comment`
294
+
-`retest-all-comment`
295
+
-`retest-comment`
296
+
-`cancel-all-comment`
297
+
-`ok-to-test-comment`
281
298
282
299
The dynamic variable will return `pull_request` as the event type instead of the specific categorized GitOps command type. This is to handle backward compatibility with previous releases for users relying on this dynamic variable.
0 commit comments