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
60
@@ -47,26 +74,19 @@ To maintain consistency, a GitHub workflow named **`banner-validate`** automatic
47
74
- Review the error message in the PR checks.
48
75
- 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
80
54
-
###**Schema**
81
+
#### 2.2.1. <aname='Schema'></a>**Schema**
55
82
56
83
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
84
58
85
The file must contain a **YAML list** where each item represents a banner configuration.
59
86
60
87
---
61
88
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**
89
+
#### 2.2.2. <aname='RequiredandOptionalFieldsforEachBanner'></a>**Required and Optional Fields for Each Banner**
70
90
71
91
📎 For the full schema used in CI validation, see banner-schema.json. This table is a human-friendly reference for banner authors.
72
92
@@ -86,9 +106,9 @@ The file must contain a **YAML list** where each item represents a banner config
@@ -177,7 +197,7 @@ When there are no events to announce:
177
197
178
198
---
179
199
180
-
##📝 How to submit a PR for Banner
200
+
### 2.4. <aname='HowtosubmitaPRforBanner'></a>📝 How to submit a PR for Banner
181
201
182
202
1. Locate the target cluster directory:
183
203
@@ -225,7 +245,18 @@ When there are no events to announce:
225
245
Purpose: Release announcement for Konflux 1.2
226
246
```
227
247
228
-
## ❓ Frequently Asked Questions
248
+
### 2.5. <a name='UIBehavior'></a>✅ UI Behavior
249
+
250
+
- 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.
251
+
- If multiple banners are configured, <strong style="color: red;">order matters</strong>.
252
+
- <strong style="color: red;">Time-related fields like `startTime` and `endTime` are not displayed in the UI</strong>; they only control when the banner is active.
253
+
254
+
<strong>To convey duration or timing details, please include them within the `summary`.</strong>
255
+
256
+
- <strong style="color: red;">The `type` and `summary` fields are displayed directly in the UI</strong>.
257
+
- 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
262
@@ -245,41 +276,125 @@ When there are no events to announce:
245
276
246
277
<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
278
248
-
## 📢 Auto Alerts(WIP)
279
+
## 3. <a name='SystemNotifications'></a>📢 System Notifications
280
+
281
+
The infrastructure team uses System Notifications to automatically surface important operational notifications in the Konflux UI.
282
+
283
+
These notifications are generated from monitoring systems or automation scripts as Kubernetes ConfigMaps.
284
+
285
+
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.
290
+
291
+
Each ConfigMap contains notification data in the `notification-content.json` field as JSON.
292
+
293
+
<strong>Key points:</strong>
294
+
295
+
- The JSON payload supports these fields for each notification object:
296
+
297
+
- <strong>title (optional)</strong>: A short heading.
298
+
- <strong>summary (required)</strong>: A brief, user-facing message displayed as the notification content.
299
+
- <strong>type (required)</strong>: It sets the bell icon. Allowed values: `info`, `warning`, or `danger`.
300
+
- <strong>activeTimestamp (optional)</strong>: The time when the notification should be shown, specified as an ISO 8601 timestamp (e.g., `"2025-08-11T11:08:17Z"`).
301
+
- If set to a future time, the UI will delay displaying the notification until that time is reached.
302
+
- If not set, the system falls back to using the resource’s raw `creationTimestamp` to decide when to show the notification.
249
303
250
-
We enables the infrastructure team to automatically surface specific operational issues or warnings in the Konflux UI.
304
+
- Payload structure:
251
305
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.
306
+
We recommend using <strong>a single JSON object representing one notification</strong> in `notification-content.json`.
253
307
254
-
### ✅ Alert YAML Format
308
+
However, <strong>a JSON list (array) of notification objects is also allowed</strong> if multiple notifications need to be included in one ConfigMap.
255
309
256
-
Each file under auto-alerts/ must be a valid Kubernetes ConfigMap, including at minimum:
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).
335
+
336
+
**When does it run?**
337
+
338
+
- On any pull request that changes:
339
+
- `notification-schema.json`(schema definition)
340
+
- Any `yaml` file defined under `system-notifications`
341
+
342
+
**What does it check?**
343
+
344
+
- Ensures the JSON structure matches the schema (e.g., required fields, allowed values).
345
+
- Ensure the configmaps are labelled well.
346
+
- Prevents invalid or misconfigured notifications from being merged.
347
+
348
+
**How to fix validation errors?**
349
+
350
+
- Review the error message in the PR checks.
351
+
- Compare your changes with the [schema](./notification-schema.json) and your labels.
Notifications are organized under the `system-notifications/` directory:
276
356
277
357
```bash
278
358
279
-
auto-alerts/ # Alert ConfigMaps (one file = one alert)
359
+
system-notifications/
280
360
.
281
-
├── alert-1.yaml # Fully valid ConfigMap YAML
282
-
├── alert-2.yaml
283
-
└── kustomization.yaml # Auto-generated, includes all alert YAMLs
361
+
├── notification-1.yaml # A ConfigMap representing one notification
362
+
├── notification-2.yaml
363
+
└── kustomization.yaml # Auto-generated, includes all notifications YAMLs
284
364
285
365
```
366
+
367
+
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
372
+
`konflux.system.notification: "true".`
373
+
- When a valid notification ConfigMap exists, its notification will be shown in the UI only if the active time has been reached.
374
+
- The UI respects the `activeTimestamp` field to control when notifications are displayed:
375
+
- If `activeTimestamp` is set to a future time, the notification remains hidden until that time arrives.
376
+
- If `activeTimestamp` is not set, the notification uses the resource's `creationTimestamp` to determine when to show.
377
+
- To remove a notification from the UI, the corresponding ConfigMap must be deleted or renamed so it no longer matches the label.
378
+
- When multiple notifications exist, the UI lists them ordered by their active time, <strong>showing the most recent first</strong>.
379
+
- The `type` field control the notification icon shown before the title in the Notification Drawer.
380
+
- If the `title` field is omitted in the JSON, it falls back to using component.metadata.name as the default in the UI.
381
+
- 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.
382
+
- All notifications are always shown as unread. There is no backend tracking for notification state, so <strong>`read/unread` functionality is not supported</strong>.
383
+
384
+
### 3.6. <a name='WhentoAddorRemoveNotifications'></a>✅ **When to Add or Remove Notifications**
385
+
386
+
<strong>These notification ConfigMaps are automatically generated or removed</strong> by monitoring or scripting systems based on current system status.
387
+
388
+
- Add a notification:
389
+
390
+
1. Generate a new ConfigMap YAML file under `system-notifications/`.
391
+
2. Refresh the `kustomization.yaml` in that folder to include the new file.
392
+
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.
393
+
394
+
- Remove a notification:
395
+
396
+
1. Delete the corresponding ConfigMap YAML file from `system-notifications/`.
397
+
2. Refresh `kustomization.yaml` to remove the reference.
398
+
3. If no notifications remain, delete the `system-notifications/` directory and remove its reference from the parent kustomization.
399
+
400
+
⚠️ <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