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: content/en/docs/how-tos/notification.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,4 +60,44 @@ It is possible to add slack reporting for the `images` postsubmit job by adding
60
60
{{< /alert >}}
61
61
62
62
Once the configuration is added, simply use the `make jobs` target to generate the new job definitions containing the `reporter_config`.
63
+
64
+
### Slack Reporter Configuration
65
+
66
+
The `slack_reporter` configuration supports flexible job matching with multiple approaches:
67
+
68
+
1. **Exact matching** with `job_names`: Matches job names exactly
69
+
2. **Pattern matching** with `job_name_patterns`: Matches job names using regular expressions
70
+
3. **Exclusion** with `excluded_job_patterns`: Excludes jobs matching regex patterns (similar to `excluded_variants`)
71
+
72
+
**Matching Priority:**
73
+
- Exclusions are checked first - if a job matches any `excluded_job_patterns`, it's excluded regardless of other rules
74
+
- Exact matches in `job_names` take precedence over pattern matches in `job_name_patterns`
75
+
- This allows for more flexible job matching while maintaining compatibility with existing configurations
76
+
77
+
**Examples:**
78
+
79
+
```yaml
80
+
slack_reporter:
81
+
# Example 1: Mixed exact and pattern matching
82
+
- channel: "#my-team"
83
+
job_names: ["unit", "images"] # Exact matches
84
+
job_name_patterns: ["^e2e-.*"] # Regex patterns
85
+
86
+
# Example 2: Broad matching with exclusions (similar to excluded_variants)
87
+
- channel: "#ops-team"
88
+
job_name_patterns: [".*"] # Match all jobs
89
+
excluded_job_patterns: # But exclude these patterns
90
+
- ".*-skip$" # Jobs ending with "-skip"
91
+
- "^nightly-.*" # Jobs starting with "nightly-"
92
+
- ".*-flaky-.*" # Jobs containing "-flaky-"
93
+
94
+
# Example 3: Combining all approaches
95
+
- channel: "#dev-team"
96
+
job_names: ["critical-test"] # Always include this specific job
97
+
job_name_patterns: ["^unit-.*"] # Include all unit tests
98
+
excluded_job_patterns: [".*-slow$"] # But exclude slow tests
99
+
```
100
+
101
+
The `excluded_job_patterns` approach is often simpler than complex inclusion patterns, especially when you want to match most jobs in a repository but exclude specific types.
102
+
63
103
The `SlackReporterConfig` is provided for [reference](https://github.com/openshift/ci-tools/blob/6810ce942bbe25a06c092af8098fd2d071604a04/pkg/config/load.go#L49-L57).
0 commit comments