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
Convert ErrNoFailedPipelineToRetest from a sentinel error variable
to a custom error type that accepts the gitops command prefix. This
ensures the error message displays the correct command syntax
(e.g. /pac retest) based on the repository's configured prefix.
Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
Assisted-by: Claude Opus 4.6 (via Claude Code)
Copy file name to clipboardExpand all lines: docs/content/docs/guides/gitops-commands/advanced.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,8 @@ Example:
87
87
/pac test
88
88
```
89
89
90
+
You can also configure GitOps command prefix in [Global Repository CR]({{< relref "/docs/operations/global-repository-settings" >}}) so that it will be applied to all Repository CRs those are not defining their own prefix.
91
+
90
92
## Cancelling a PipelineRun
91
93
92
94
**What it does:** The `/cancel` command stops running PipelineRuns by commenting on the pull request.
Copy file name to clipboardExpand all lines: pkg/matcher/annotation_matcher.go
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@ package matcher
2
2
3
3
import (
4
4
"context"
5
-
"errors"
6
5
"fmt"
7
6
"regexp"
8
7
"strings"
@@ -37,9 +36,20 @@ const (
37
36
maxCommentLogLength=160
38
37
)
39
38
40
-
// ErrNoFailedPipelineToRetest is returned when /retest or /ok-to-test is used
41
-
// but all matching pipelines have already succeeded for this commit.
42
-
varErrNoFailedPipelineToRetest=errors.New("All PipelineRuns for this commit have already succeeded. Use `/retest <pipeline-name>` to re-run a specific pipeline or `/test` to re-run all pipelines.") // nolint:revive,staticcheck
39
+
// NoFailedPipelineToRetestError is an error type returned when /retest or
40
+
// /ok-to-test is used but all matching pipelines have already succeeded for
41
+
// this commit. The underlying string value is the gitops comment prefix used
42
+
// to construct the user-facing error message with the correct command syntax.
returnfmt.Sprintf("All PipelineRuns for this commit have already succeeded. Use `%sretest <pipeline-name>` to re-run a specific pipeline or `%stest` to re-run all pipelines.", string(e), string(e))
0 commit comments