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
To maintain consistency, a GitHub workflow named **`banner-validate`** automatically validates all `banner-content.yaml` files against the schema defined in [`banner-schema.json`](./banner-schema.json).
33
58
@@ -47,26 +72,19 @@ To maintain consistency, a GitHub workflow named **`banner-validate`** automatic
47
72
- Review the error message in the PR checks.
48
73
- Compare your changes with the [schema](./banner-schema.json) and [examples in README](#usage-scenarios--examples).
The `banner-content.yaml` file defines one or more banners displayed in the Konflux UI. Each cluster has its own `banner-content.yaml` under its directory (e.g., `staging/stone-stage-p01/banner-content.yaml`).
53
78
54
-
###**Schema**
79
+
#### 2.2.1. <aname='Schema'></a>**Schema**
55
80
56
81
The schema for banner content is defined in [`banner-schema.json`](./banner-schema.json) and validated automatically by the `banner-validate` GitHub workflow on every PR.
57
82
58
83
The file must contain a **YAML list** where each item represents a banner configuration.
59
84
60
85
---
61
86
62
-
### **Important Behavior**
63
-
64
-
- The <strongstyle="color: red;">UI displays only the first valid active banner</strong> from the list, based on current date, time, and optional recurrence settings.
65
-
- If multiple banners are configured, <strongstyle="color: red;">order matters</strong>.
66
-
67
-
---
68
-
69
-
### **Required and Optional Fields for Each Banner**
87
+
#### 2.2.2. <aname='RequiredandOptionalFieldsforEachBanner'></a>**Required and Optional Fields for Each Banner**
70
88
71
89
📎 For the full schema used in CI validation, see banner-schema.json. This table is a human-friendly reference for banner authors.
72
90
@@ -86,9 +104,9 @@ The file must contain a **YAML list** where each item represents a banner config
@@ -177,7 +195,7 @@ When there are no events to announce:
177
195
178
196
---
179
197
180
-
##📝 How to submit a PR for Banner
198
+
### 2.4. <aname='HowtosubmitaPRforBanner'></a>📝 How to submit a PR for Banner
181
199
182
200
1. Locate the target cluster directory:
183
201
@@ -225,7 +243,15 @@ When there are no events to announce:
225
243
Purpose: Release announcement for Konflux 1.2
226
244
```
227
245
228
-
## ❓ Frequently Asked Questions
246
+
### 2.5. <a name='UIBehavior'></a>✅ UI Behavior
247
+
248
+
- The <strong style="color: red;">UI displays only the first valid active banner</strong> from the list, based on current date, time, and optional recurrence settings.
249
+
- If multiple banners are configured, <strong style="color: red;">order matters</strong>.
250
+
- <strong style="color: red;">Time-related fields like `startTime` and `endTime` are not shown in the UI</strong>; they only control when the banner is active.
251
+
- <strong style="color: red;">The type and summary fields are displayed directly in the UI</strong>. If you want to communicate duration or timing details, please include them within the summary.
252
+
- We enjoyed leveraging the [PatternFly Banner component (v5)](https://v5-archive.patternfly.org/components/banner/) to implement the UI, following its design principles for clarity and consistency.
- Why is only one banner shown even when multiple are configured?
231
257
@@ -245,41 +271,116 @@ When there are no events to announce:
245
271
246
272
<strong style="color: red;">📝 If multiple messages need to be shared at the same time, consider combining them into a well-written summary inside a single banner.</strong>
247
273
248
-
## 📢 Auto Alerts(WIP)
274
+
## 3. <a name='SystemNotifications'></a>📢 System Notifications
275
+
276
+
The infrastructure team uses System Notifications to automatically surface important operational notifications in the Konflux UI.
277
+
278
+
These notifications are generated from monitoring systems or automation scripts as Kubernetes ConfigMaps.
279
+
280
+
The Konflux UI detects and displays these notifications to inform users about system-wide conditions.
System notifications are stored as Kubernetes ConfigMaps in the `system-notifications/` directory.
249
285
250
-
We enables the infrastructure team to automatically surface specific operational issues or warnings in the Konflux UI.
286
+
Each ConfigMap contains notification data in the `notification-content.json` field as JSON.
251
287
252
-
These alerts would be auto-generated from monitoring systems or automation scripts, written as Kubernetes ConfigMaps, and automatically picked up by the Konflux UI to inform users of system-wide conditions.
288
+
<strong>Key points:</strong>
253
289
254
-
### ✅ Alert YAML Format
290
+
- The JSON payload supports these fields for each notification object:
255
291
256
-
Each file under auto-alerts/ must be a valid Kubernetes ConfigMap, including at minimum:
292
+
- <strong>title (optional)</strong>: A short heading.
293
+
- <strong>summary (required)</strong>: A brief, user-facing message displayed as the notification content.
294
+
- <strong>type (required)</strong>: It sets the bell icon. Allowed values: `info`, `warning`, or `danger`.
295
+
296
+
- Payload structure:
297
+
298
+
We recommend using <strong>a single JSON object representing one notification</strong> in `notification-content.json`.
299
+
300
+
However, <strong>a JSON list (array) of notification objects is also allowed</strong> if multiple notifications need to be included in one ConfigMap.
To ensure consistency, a GitHub workflow named `notification-validate` automatically checks that all ConfigMaps in the `system-notifications` folder include the required labels and validates all `notification-content.json` objects against the schema defined in [notification-schema.json](./notification-schema.json).
324
+
325
+
**When does it run?**
326
+
327
+
- On any pull request that changes:
328
+
- `notification-schema.json`(schema definition)
329
+
- Any `yaml` file defined under `system-notifications`
330
+
331
+
**What does it check?**
332
+
333
+
- Ensures the JSON structure matches the schema (e.g., required fields, allowed values).
334
+
- Ensure the configmaps are labelled well.
335
+
- Prevents invalid or misconfigured notifications from being merged.
336
+
337
+
**How to fix validation errors?**
338
+
339
+
- Review the error message in the PR checks.
340
+
- Compare your changes with the [schema](./notification-schema.json) and your labels.
Notifications are organized under the `system-notifications/` directory:
276
345
277
346
```bash
278
347
279
-
auto-alerts/ # Alert ConfigMaps (one file = one alert)
348
+
system-notifications/
280
349
.
281
-
├── alert-1.yaml # Fully valid ConfigMap YAML
282
-
├── alert-2.yaml
283
-
└── kustomization.yaml # Auto-generated, includes all alert YAMLs
350
+
├── notification-1.yaml # A ConfigMap representing one notification
351
+
├── notification-2.yaml
352
+
└── kustomization.yaml # Auto-generated, includes all notifications YAMLs
284
353
285
354
```
355
+
356
+
When there are no active notifications, both the `system-notifications/` folder and its reference in the parent `kustomization.yaml` should be removed automatically to avoid kustomize errors.
- The UI discovers and filters notifications by detecting ConfigMaps labeled with
361
+
`konflux.system.notification: "true".`
362
+
- When a valid notification ConfigMap exists, its notification will be shown in the UI.
363
+
- To remove a notification from the UI, the corresponding ConfigMap must be deleted or renamed so it no longer matches the label.
364
+
- When multiple notifications exist, the UI lists them ordered by their creation time (`creationTimestamp`), <strong>showing the most recent first</strong>.
365
+
- The `type` field control the notification icon shown before the title in the Notification Drawer.
366
+
- If the `title` field is omitted in the JSON, it falls back to using component.metadata.name as the default in the UI.
367
+
- We leveraged [PatternFly Notification Drawer (v5)](https://v5-archive.patternfly.org/components/notification-drawer/html/#ws-core-c-notification-drawer-basic) and [Notification Badge (v5)](https://v5-archive.patternfly.org/components/notification-badge) components to implement the UI, following their design principles for consistency and usability.
368
+
- All notifications are always shown as unread. There is no backend tracking for notification state, so <strong>`read/unread` functionality is not supported</strong>.
369
+
370
+
### 3.6. <a name='WhentoAddorRemoveNotifications'></a>✅ **When to Add or Remove Notifications**
371
+
372
+
<strong>These notification ConfigMaps are automatically generated or removed</strong> by monitoring or scripting systems based on current system status.
373
+
374
+
- Add a notification:
375
+
376
+
1. Generate a new ConfigMap YAML file under `system-notifications/`.
377
+
2. Refresh the `kustomization.yaml` in that folder to include the new file.
378
+
3. If the folder does not exist (e.g., no prior notifications), create it and its `kustomization.yaml`, and ensure the parent kustomization includes it.
379
+
380
+
- Remove a notification:
381
+
382
+
1. Delete the corresponding ConfigMap YAML file from `system-notifications/`.
383
+
2. Refresh `kustomization.yaml` to remove the reference.
384
+
3. If no notifications remain, delete the `system-notifications/` directory and remove its reference from the parent kustomization.
385
+
386
+
⚙️ Note: <strong>These add/remove operations are expected to be automated</strong>. Manual edits should only be done in emergencies or for debugging.
0 commit comments