Skip to content

Commit dbd1e39

Browse files
Merge pull request #693 from PeterYurkovich/ou-1131
OU-1131: Merge main into release-4.19
2 parents 4aa1250 + c3e58fb commit dbd1e39

316 files changed

Lines changed: 48988 additions & 13949 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: release
33
namespace: openshift
4-
tag: rhel-9-release-golang-1.23-openshift-4.19
4+
tag: rhel-9-release-golang-1.24-openshift-4.21

.claude/commands/run-perses-dev.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: run-perses-dev
3+
description: Setup a development environment for monitoring-console-plugin + perses
4+
parameters:
5+
- name: perses_path
6+
- description: The path on the local machine that points to a clone of https://github.com/perses/perses (e.g. /Users/bob/git_repos/perses)
7+
- required: true
8+
allowed-tools: Read, Grep, tmux, which, ls, lsof, oc
9+
---
10+
11+
0. perses_path
12+
- Go to the root and cd .claude/commands/configs/run-perses-dev-config.yaml
13+
- If not defined, create the file and fill out the perses path
14+
15+
1. Create a tmux session called 'monitoring-perses-dev' with 8 panes = 4 columns x 2 rows
16+
Split horitzontally, then split verically.
17+
Then go clockwise and split horitzontally.
18+
- Pane 0
19+
- Path: monitoring-plugin (root of this repo)
20+
- Label: monitoring-console-plugin-frontend
21+
- Run: make start-frontend
22+
- Pane 2
23+
- Path: monitoring-plugin (root of this repo)
24+
- Label: monitoring-console-plugin-console
25+
- Run: make start-feature-console
26+
- Pane 4
27+
- Path: monitoring-plugin (root of this repo)
28+
- Label: monitoring-console-plugin-backend
29+
- Run: make start-feature-backend
30+
- Pane 6
31+
- Path: monitoring-plugin (root of this repo)
32+
- Label: port-forward-promtheus-operator
33+
- Run: oc port-forward -n openshift-monitoring service/prometheus-operated 9090:9090
34+
- Pane 1
35+
- Path: `{perses_path}`
36+
- Label: perses-backend
37+
- Run: ./scripts/api_backend_dev.sh
38+
- Pane 3
39+
- Path: `{perses_path}/ui`
40+
- Label: perses-ui
41+
- Run: npm run start
42+
43+
2. Final checks
44+
- Check if all the processes in each pane is running without error. If there is a error diagnose and fix it.
45+
- In bold output, tell the user the name of the session and tmux session tips like how to attach to sessions, how to move around the panels using prefix + arrows, how to delete a session, how to list session
46+
- Navigate to `{perses_path}/dev/config.yaml`. The spec `security.enable_auth` should be `false`.
47+
- Tell user that openshift console platform is located at http://localhost:9000
48+
- Tell user that perses is located at http://localhost:3000
49+
50+
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Fixture Schema Reference
2+
3+
## Overview
4+
Quick reference for the YAML fixture schema structure, valid values, and common patterns.
5+
6+
## Schema Structure
7+
8+
```yaml
9+
name: string # Required: Human-readable scenario name
10+
description: string # Required: Detailed description
11+
incidents: array # Required: Array of incident objects
12+
- id: string # Required: Unique incident identifier
13+
component: string # Required: Component affected
14+
layer: string # Required: Layer (core/Others)
15+
timeline: object # Optional: Timeline information
16+
start: string # Required: When incident started
17+
end: string # Optional: When incident ended
18+
severityChanges: array # Optional: Severity changes over time
19+
alerts: array # Required: Array of alert objects
20+
- name: string # Required: Alert name
21+
namespace: string # Required: Alert namespace
22+
severity: string # Required: Alert severity
23+
firing: boolean # Optional: Firing state
24+
managed_cluster: string # Optional: Managed cluster ID
25+
```
26+
27+
## Valid Values
28+
29+
### Components
30+
- `monitoring` - Monitoring infrastructure
31+
- `storage` - Storage systems
32+
- `network` - Network components
33+
- `compute` - Compute resources
34+
- `api-server` - Kubernetes API server
35+
- `etcd` - etcd cluster
36+
- `version` - Cluster version
37+
- `Others` - Other components
38+
39+
### Layers
40+
- `core` - Core OpenShift components
41+
- `Others` - Non-core components
42+
43+
### Severities
44+
- `critical` - Critical alerts
45+
- `warning` - Warning alerts
46+
- `info` - Informational alerts
47+
48+
### Duration Format
49+
- Pattern: `^\d+[smhd]$`
50+
- Examples: `"30m"`, `"2h"`, `"7d"`, `"1h"`
51+
- Units: `s` (seconds), `m` (minutes), `h` (hours), `d` (days)
52+
53+
## Common Alert Names
54+
55+
### Monitoring Component
56+
```yaml
57+
- name: "AlertmanagerReceiversNotConfigured"
58+
namespace: "openshift-monitoring"
59+
severity: "warning"
60+
61+
- name: "KubeDeploymentReplicasMismatch"
62+
namespace: "openshift-monitoring"
63+
severity: "critical"
64+
65+
- name: "KubePodCrashLooping"
66+
namespace: "openshift-monitoring"
67+
severity: "warning"
68+
69+
- name: "PrometheusConfigReloadFailure"
70+
namespace: "openshift-monitoring"
71+
severity: "warning"
72+
73+
- name: "Watchdog"
74+
namespace: "openshift-monitoring"
75+
severity: "info"
76+
```
77+
78+
### Storage Component
79+
```yaml
80+
- name: "KubePersistentVolumeFillingUp"
81+
namespace: "openshift-storage"
82+
severity: "critical"
83+
84+
- name: "DiskSpaceRunningLow"
85+
namespace: "openshift-storage"
86+
severity: "critical"
87+
88+
- name: "VolumeReadOnly"
89+
namespace: "openshift-storage"
90+
severity: "critical"
91+
```
92+
93+
### Network Component
94+
```yaml
95+
- name: "NetworkLatencyHigh"
96+
namespace: "openshift-network"
97+
severity: "warning"
98+
99+
- name: "EtcdMemberCommunicationSlow"
100+
namespace: "openshift-etcd"
101+
severity: "warning"
102+
```
103+
104+
### Compute Component
105+
```yaml
106+
- name: "NodeNotReady"
107+
namespace: "openshift-machine-api"
108+
severity: "critical"
109+
110+
- name: "KubeNodeUnreachable"
111+
namespace: "openshift-machine-api"
112+
severity: "critical"
113+
```
114+
115+
## Timeline Patterns
116+
117+
### Simple Ongoing Incident
118+
```yaml
119+
timeline:
120+
start: "2h" # Started 2 hours ago
121+
```
122+
123+
### Resolved Incident
124+
```yaml
125+
timeline:
126+
start: "4h" # Started 4 hours ago
127+
end: "1h" # Resolved 1 hour ago
128+
```
129+
130+
### Severity Escalation
131+
```yaml
132+
timeline:
133+
start: "3h" # Started 3 hours ago
134+
severityChanges:
135+
- time: "3h" # Started as warning
136+
severity: "warning"
137+
- time: "1h" # Escalated to critical 1 hour ago
138+
severity: "critical"
139+
```
140+
141+
## Validation Rules
142+
143+
### Required Fields
144+
- Root: `name`, `description`, `incidents`
145+
- Incident: `id`, `component`, `layer`, `alerts`
146+
- Alert: `name`, `namespace`, `severity`
147+
- Timeline: `start`
148+
149+
### Format Constraints
150+
- Incident ID: Pattern `^[a-zA-Z0-9-_]+$`
151+
- Duration: Pattern `^\d+[smhd]$`
152+
- Component/Layer/Severity: Must be valid enum values
153+
154+
### Array Constraints
155+
- Incidents: `minItems: 0`
156+
- Alerts: `minItems: 1` per incident
157+
158+
## Usage in Tests
159+
160+
```typescript
161+
// Load YAML fixture
162+
cy.mockIncidentFixture('cypress/fixtures/incident-scenarios/critical-monitoring-issues.yaml');
163+
164+
// Load JSON fixture (backward compatibility)
165+
cy.mockIncidentFixture('cypress/fixtures/incident-scenarios/some-scenario.json');
166+
```
167+
168+
## Validation Tools
169+
170+
### CLI Validation
171+
```bash
172+
cd web/cypress/support/incidents_prometheus_query_mocks
173+
node validate-fixtures.js --all
174+
node validate-fixtures.js specific-file.yaml
175+
```
176+
177+
### Schema Files
178+
- Schema: `web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json`
179+
- Validator: `web/cypress/support/incidents_prometheus_query_mocks/schema-validator.ts`
180+
- CLI Tool: `web/cypress/support/incidents_prometheus_query_mocks/validate-fixtures.js`
181+
182+
## Best Practices
183+
184+
1. **Naming**: Use descriptive, specific names
185+
2. **Comments**: Add helpful comments for timeline values
186+
3. **Realistic Data**: Use actual OpenShift alert names
187+
4. **Consistent Format**: Follow established patterns
188+
5. **Validation**: Always validate before committing
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
description: Generate valid YAML incident fixtures for Cypress testing
3+
---
4+
5+
# Generate Incident Fixture
6+
7+
Generate valid YAML fixtures for incident scenarios based on text descriptions or UI screenshots.
8+
9+
## Process
10+
11+
### 1. Analyze Input
12+
- **Text Description**: Extract incident components, alert names, severities, and timeline
13+
- **Screenshot**: Identify visible incidents, alerts, and timeline - **CONVERT ALL DATES TO RELATIVE TIME**. There will be usually one chart 'Incident Timeline' displaying the incident timelines and second one 'Alert Timelines' which displays alerts for **a single particular incident**. When the Alert timeline is visible, include timestamps for the individual alerts within the incident, which may differ from the incident one.
14+
- Focus on capturing the precise start and end dates for incidents and individual alerts so that the variability from the screenshot is preserved.
15+
16+
### 2. Generate YAML Structure
17+
Create fixture following the schema in [fixture-schema.json](mdc:web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json). Prefer this schema over existing fixtures.
18+
19+
```yaml
20+
name: "[Scenario Name]"
21+
description: "[Detailed description]"
22+
incidents:
23+
- id: "[unique-incident-id]"
24+
component: "[component-name]"
25+
layer: "[core|Others]"
26+
timeline:
27+
start: "[duration]"
28+
# end: "[duration]" # Only if resolved
29+
alerts:
30+
- name: "[alert-name]"
31+
namespace: "[namespace]"
32+
severity: "[critical|warning|info]"
33+
firing: [true|false]
34+
timeline:
35+
start: "[duration]"
36+
```
37+
38+
### 3. Apply Constraints
39+
- **Name and Description**: Use generic name capturing the essence of the scenario
40+
- **File name**: Use generic name capturing the essence of the scenario
41+
- **Components**: `monitoring`, `storage`, `network`, `compute`, `api-server`, `etcd`, `version`, `Others`
42+
- **Layers**: `core`, `Others`
43+
- **Severities**: `critical`, `warning`, `info`
44+
- **Duration Format**: `<number><unit>` (e.g., `"2h"`, `"30m"`, `"7d"`)
45+
- **Alert Names**: Use descriptive, artificial names with unique indices (e.g., `"MonitoringAlertmanagerReceiversCritical001"`)
46+
47+
### 4. Time Conversion Rules
48+
- **NEVER use absolute dates/timestamps**
49+
- Convert screenshot dates to relative durations from the end of the chart
50+
- Example: If screenshot shows "2024-01-15 14:30" and current time is "2024-01-15 16:30", use `"2h"`
51+
52+
### 5. Run validation
53+
- run the validation using [fixture-schema.json](mdc:web/cypress/support/incident_prometheus_query_mocks/validate_fixture.js)
54+
55+
```yaml
56+
57+
## Validation Checklist
58+
- [ ] All required fields present (name, description, incidents)
59+
- [ ] Incident IDs are unique and follow naming convention
60+
- [ ] Components and layers use valid enum values from schema
61+
- [ ] Duration format matches pattern `^\d+[smhd]$`
62+
- [ ] **NO absolute dates or timestamps used - only relative durations**
63+
- [ ] Alert names are descriptive and artificial with unique indices
64+
- [ ] Alerts have timelines if different when the incidents
65+
- [ ] Namespaces follow OpenShift conventions
66+
- [ ] Severity levels are valid (critical, warning, info)
67+
- [ ] YAML syntax is correct with proper indentation
68+
- [ ] Schema validation passes against [fixture-schema.json](mdc:web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json)
69+
70+
## Output
71+
Provide complete YAML fixture ready for use with `cy.mockIncidentFixture()` in Cypress tests.

0 commit comments

Comments
 (0)