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,18 @@ 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 displayed in the UI</strong>; they only control when the banner is active.
251
+
252
+
<strong>To convey duration or timing details, please include them within the `summary`.</strong>
253
+
254
+
- <strong style="color: red;">The `type` and `summary` fields are displayed directly in the UI</strong>.
255
+
- 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
260
@@ -245,41 +274,125 @@ When there are no events to announce:
245
274
246
275
<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
276
248
-
## 📢 Auto Alerts(WIP)
277
+
## 3. <a name='SystemNotifications'></a>📢 System Notifications
278
+
279
+
The infrastructure team uses System Notifications to automatically surface important operational notifications in the Konflux UI.
280
+
281
+
These notifications are generated from monitoring systems or automation scripts as Kubernetes ConfigMaps.
282
+
283
+
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.
288
+
289
+
Each ConfigMap contains notification data in the `notification-content.json` field as JSON.
290
+
291
+
<strong>Key points:</strong>
292
+
293
+
- The JSON payload supports these fields for each notification object:
294
+
295
+
- <strong>title (optional)</strong>: A short heading.
296
+
- <strong>summary (required)</strong>: A brief, user-facing message displayed as the notification content.
297
+
- <strong>type (required)</strong>: It sets the bell icon. Allowed values: `info`, `warning`, or `danger`.
298
+
- <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"`).
299
+
- If set to a future time, the UI will delay displaying the notification until that time is reached.
300
+
- If not set, the system falls back to using the resource’s raw `creationTimestamp` to decide when to show the notification.
249
301
250
-
We enables the infrastructure team to automatically surface specific operational issues or warnings in the Konflux UI.
302
+
- Payload structure:
251
303
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.
304
+
We recommend using <strong>a single JSON object representing one notification</strong> in `notification-content.json`.
253
305
254
-
### ✅ Alert YAML Format
306
+
However, <strong>a JSON list (array) of notification objects is also allowed</strong> if multiple notifications need to be included in one ConfigMap.
255
307
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).
333
+
334
+
**When does it run?**
335
+
336
+
- On any pull request that changes:
337
+
- `notification-schema.json`(schema definition)
338
+
- Any `yaml` file defined under `system-notifications`
339
+
340
+
**What does it check?**
341
+
342
+
- Ensures the JSON structure matches the schema (e.g., required fields, allowed values).
343
+
- Ensure the configmaps are labelled well.
344
+
- Prevents invalid or misconfigured notifications from being merged.
345
+
346
+
**How to fix validation errors?**
347
+
348
+
- Review the error message in the PR checks.
349
+
- Compare your changes with the [schema](./notification-schema.json) and your labels.
Notifications are organized under the `system-notifications/` directory:
276
354
277
355
```bash
278
356
279
-
auto-alerts/ # Alert ConfigMaps (one file = one alert)
357
+
system-notifications/
280
358
.
281
-
├── alert-1.yaml # Fully valid ConfigMap YAML
282
-
├── alert-2.yaml
283
-
└── kustomization.yaml # Auto-generated, includes all alert YAMLs
359
+
├── notification-1.yaml # A ConfigMap representing one notification
360
+
├── notification-2.yaml
361
+
└── kustomization.yaml # Auto-generated, includes all notifications YAMLs
284
362
285
363
```
364
+
365
+
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
370
+
`konflux.system.notification: "true".`
371
+
- When a valid notification ConfigMap exists, its notification will be shown in the UI only if the active time has been reached.
372
+
- The UI respects the `activeTimestamp` field to control when notifications are displayed:
373
+
- If `activeTimestamp` is set to a future time, the notification remains hidden until that time arrives.
374
+
- If `activeTimestamp` is not set, the notification uses the resource's `creationTimestamp` to determine when to show.
375
+
- To remove a notification from the UI, the corresponding ConfigMap must be deleted or renamed so it no longer matches the label.
376
+
- When multiple notifications exist, the UI lists them ordered by their active time, <strong>showing the most recent first</strong>.
377
+
- The `type` field control the notification icon shown before the title in the Notification Drawer.
378
+
- If the `title` field is omitted in the JSON, it falls back to using component.metadata.name as the default in the UI.
379
+
- 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.
380
+
- All notifications are always shown as unread. There is no backend tracking for notification state, so <strong>`read/unread` functionality is not supported</strong>.
381
+
382
+
### 3.6. <a name='WhentoAddorRemoveNotifications'></a>✅ **When to Add or Remove Notifications**
383
+
384
+
<strong>These notification ConfigMaps are automatically generated or removed</strong> by monitoring or scripting systems based on current system status.
385
+
386
+
- Add a notification:
387
+
388
+
1. Generate a new ConfigMap YAML file under `system-notifications/`.
389
+
2. Refresh the `kustomization.yaml` in that folder to include the new file.
390
+
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.
391
+
392
+
- Remove a notification:
393
+
394
+
1. Delete the corresponding ConfigMap YAML file from `system-notifications/`.
395
+
2. Refresh `kustomization.yaml` to remove the reference.
396
+
3. If no notifications remain, delete the `system-notifications/` directory and remove its reference from the parent kustomization.
397
+
398
+
⚠️ <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