Skip to content

Commit 88c1867

Browse files
committed
Merge remote-tracking branch 'origin/main' into merge-main
2 parents ba3697b + 62a22c1 commit 88c1867

261 files changed

Lines changed: 46305 additions & 7309 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.24-openshift-4.21
4+
tag: rhel-9-release-golang-1.25-openshift-4.22

.claude/commands/backport.md

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
---
2+
allowed-tools: Bash(git:*), Read, Write, Edit
3+
argument-hint: <target-branch> [commit-hash]
4+
description: Backport a feature or fix to a release branch with dependency adaptation
5+
---
6+
7+
# Backport Feature to Release Branch
8+
9+
## Context
10+
11+
- Current branch: !`git branch --show-current`
12+
- Target branch: $1
13+
- Commit to backport: $2 (or HEAD if not specified)
14+
- Latest commit info: !`git log -1 --format="%H %s"`
15+
- Changed files: !`git show --name-only HEAD | tail -n +7`
16+
17+
## Dependency Version Differences
18+
19+
| Dependency | Main (Latest) | release-4.21 | release-4.20 | release-4.19 | release-4.18 | release-4.17 | release-coo-0.5 | release-coo-0.4 |
20+
| ------------ | ------------- | ------------ | ------------ | ------------ | ------------ | ------------ | --------------- | --------------- |
21+
| PatternFly | v6.x | v6.x | v6.x | v6.x | v5.x | v4.x | v6.x | v5.x |
22+
| React Router | v6 compat | v6 compat | v6 compat | v6 compat | v5 | v5 | v6 compat | v5 |
23+
| Console SDK | 4.19+ | 4.19 | 4.19 | 4.19 | 1.6.0 | 1.6.0 | 4.19 | 1.6.0 |
24+
25+
## Project Structure Differences
26+
27+
| Branch | Frontend Location | Go Backend | Notes |
28+
| --------------- | ----------------- | ---------- | --------------------------------- |
29+
| release-4.14 | Root (`src/`) | No | Frontend-only plugin |
30+
| release-4.15 | Root (`src/`) | No | Frontend-only plugin |
31+
| release-4.16 | Root (`src/`) | No | Frontend-only plugin |
32+
| release-4.17+ | `web/` | Yes | Added Go backend (`pkg/`, `cmd/`) |
33+
| release-coo-0.x | `web/` | Yes | Same structure as 4.17+ |
34+
35+
> **Note**: When backporting to release-4.16 or earlier, file paths must be adjusted from `web/src/` to `src/`.
36+
37+
## PatternFly v6 → v5 Transformations
38+
39+
When targeting release-4.18 or earlier (or release-coo-0.4):
40+
41+
```typescript
42+
// v6 Dropdown (main)
43+
import { Dropdown, DropdownItem, MenuToggle } from "@patternfly/react-core";
44+
45+
<Dropdown
46+
isOpen={isOpen}
47+
onOpenChange={setIsOpen}
48+
toggle={(toggleRef) => (
49+
<MenuToggle ref={toggleRef} onClick={() => setIsOpen(!isOpen)}>
50+
{selected}
51+
</MenuToggle>
52+
)}
53+
>
54+
<DropdownItem>Option 1</DropdownItem>
55+
</Dropdown>;
56+
57+
// v5 Dropdown (release branches)
58+
import { Dropdown, DropdownItem, DropdownToggle } from "@patternfly/react-core";
59+
60+
<Dropdown
61+
isOpen={isOpen}
62+
onSelect={() => setIsOpen(false)}
63+
toggle={<DropdownToggle onToggle={setIsOpen}>{selected}</DropdownToggle>}
64+
dropdownItems={[<DropdownItem key="1">Option 1</DropdownItem>]}
65+
/>;
66+
```
67+
68+
Common v6 → v5 changes:
69+
| v6 (main) | v5 (release) | Notes |
70+
| ---------------------- | ------------------- | ---------------------------- |
71+
| `<Panel>` | `<Card>` | Different wrapper components |
72+
| `MenuToggle` | `DropdownToggle` | Dropdown API changed |
73+
| `Dropdown` (new API) | `Dropdown` (legacy) | Props differ significantly |
74+
| `Select` (typeahead) | `Select` (legacy) | Selection handling differs |
75+
| `onOpenChange` | `onToggle` | Event handler naming |
76+
77+
## React Router v6v5 Transformations
78+
79+
When targeting release-4.18 or earlier (or release-coo-0.4):
80+
81+
```typescript
82+
// v6 Navigation (main - using compat layer)
83+
import {
84+
useNavigate,
85+
useLocation,
86+
useSearchParams,
87+
} from "react-router-dom-v5-compat";
88+
89+
const navigate = useNavigate();
90+
navigate("/alerts");
91+
92+
const [searchParams, setSearchParams] = useSearchParams();
93+
const filter = searchParams.get("filter");
94+
95+
// v5 Navigation (release branches)
96+
import { useHistory, useLocation } from "react-router-dom";
97+
98+
const history = useHistory();
99+
history.push("/alerts");
100+
101+
const location = useLocation();
102+
const params = new URLSearchParams(location.search);
103+
const filter = params.get("filter");
104+
```
105+
106+
Common v6v5 changes:
107+
| v6 (main) | v5 (release) | Notes |
108+
| -------------------- | ----------------------- | --------------- |
109+
| `useNavigate()` | `useHistory()` | Navigation hook |
110+
| `navigate('/path')` | `history.push('/path')` | Navigation call |
111+
| `useParams<Type>()` | `useParams()` + casting | Type handling |
112+
| `<Routes>` | `<Switch>` | Route wrapper |
113+
| `<Route element={}>` | `<Route component={}>` | Route rendering |
114+
| `useSearchParams()` | `useLocation()` + parse | Query params |
115+
116+
## Your Task
117+
118+
Backport the specified commit to the target branch `$1`. Follow these steps:
119+
120+
### 1. Analyze the Commit
121+
122+
- Identify all changed files from the commit
123+
- Categorize by type (components, hooks, translations, backend, etc.)
124+
- Note any PatternFly, React Router, or Console SDK usage
125+
126+
### 2. Check Target Branch Dependencies
127+
128+
Run this command to compare versions:
129+
130+
```bash
131+
git show $1:web/package.json | grep -E 'patternfly.react-core|react-router|dynamic-plugin-sdk":'
132+
```
133+
134+
### 3. Identify Required Transformations
135+
136+
Based on the dependency differences table above:
137+
138+
- PatternFly v6v5 transformations (if targeting 4.18 or earlier, or coo-0.4)
139+
- React Router v6v5 transformations (if targeting 4.18 or earlier, or coo-0.4)
140+
- Path adjustments for 4.16 or earlier (web/src/src/)
141+
142+
### 4. Create Backport Branch and Apply Changes
143+
144+
```bash
145+
git checkout $1
146+
git checkout -b backport-<feature>-to-$1
147+
```
148+
149+
### 5. Reinstall Dependencies
150+
151+
After switching branches, always reinstall:
152+
153+
```bash
154+
cd web && rm -rf node_modules && npm install
155+
```
156+
157+
### 6. Apply the Backport
158+
159+
Either cherry-pick (if clean) or manually apply with transformations:
160+
161+
```bash
162+
# Clean cherry-pick
163+
git cherry-pick <commit-hash>
164+
165+
# Or with conflicts - resolve manually then:
166+
git cherry-pick --continue
167+
168+
# Abort if needed
169+
git cherry-pick --abort
170+
```
171+
172+
### 7. Verify
173+
174+
Run these commands to validate:
175+
176+
```bash
177+
cd web
178+
npm run lint
179+
npm run lint:tsc
180+
npm run test:unit
181+
cd .. && make test-translations
182+
make test-backend
183+
```
184+
185+
### 8. Report Summary
186+
187+
Provide a summary of:
188+
189+
- Files modified
190+
- Transformations applied (PF v6v5, Router v6v5, path changes)
191+
- Any issues encountered
192+
- Commands to push and create PR:
193+
194+
```bash
195+
git push origin backport-<feature>-to-$1
196+
# Then create PR targeting $1 branch
197+
```
198+
199+
## File Categorization by Complexity
200+
201+
| Category | Path Pattern | Backport Complexity |
202+
| ------------- | ------------------------ | ---------------------------------- |
203+
| Components | `web/src/components/**` | Medium-High (dependency sensitive) |
204+
| Hooks | `web/src/hooks/**` | Medium |
205+
| Store/Redux | `web/src/store/**` | Low-Medium |
206+
| Contexts | `web/src/contexts/**` | Low-Medium |
207+
| Translations | `web/locales/**` | Low |
208+
| Backend (Go) | `pkg/**`, `cmd/**` | Low |
209+
| Cypress Tests | `web/cypress/**` | Medium |
210+
| Config | `web/*.json`, `Makefile` | High (version specific) |
211+
212+
## Release Branch Ownership
213+
214+
| Branch Pattern | Managed By | Use Case |
215+
| ----------------- | ---------- | ------------------------------ |
216+
| `release-4.x` | CMO | OpenShift core monitoring |
217+
| `release-coo-x.y` | COO | Cluster Observability Operator |
218+
219+
## Common Backport Scenarios
220+
221+
### Simple Bug Fix
222+
223+
- Usually clean cherry-pick
224+
- No dependency changes
225+
- Just run tests
226+
227+
### New Component Feature
228+
229+
- Check for PatternFly component usage
230+
- Verify console-extensions.json compatibility
231+
- May need v6→v5 PatternFly transformations
232+
233+
### Dashboard/Perses Changes
234+
235+
- High dependency sensitivity
236+
- Check @perses-dev/\* versions in target
237+
- ECharts version compatibility
238+
239+
### Alerting/Incident Changes
240+
241+
- Check Alertmanager API compatibility
242+
- Verify any new console extension types
243+
244+
### Translation Updates
245+
246+
- Usually clean backport
247+
- Verify i18next key compatibility
248+
- Run `make test-translations`
249+
250+
## Troubleshooting
251+
252+
### "Module not found" after backport
253+
254+
- Check if imported module exists in target branch version
255+
- Verify package.json dependencies match
256+
257+
### TypeScript errors after adaptation
258+
259+
- Check type definitions between versions
260+
- Use explicit typing where inference differs
261+
262+
### Test failures after backport
263+
264+
- Compare test utilities between versions
265+
- Check for mock/fixture differences
266+
267+
### Build failures
268+
269+
- Verify webpack config compatibility
270+
- Check for console plugin SDK breaking changes
271+
272+
## Backport PR Template
273+
274+
When creating the PR, use this template:
275+
276+
```markdown
277+
## Backport of #<original-PR-number>
278+
279+
### Original Change
280+
281+
<Brief description of the feature or fix>
282+
283+
### Backport Target
284+
285+
- Branch: `$1`
286+
- OpenShift Version: 4.x / COO x.y
287+
288+
### Adaptations Made
289+
290+
- [ ] PatternFly v6 → v5 components adapted
291+
- [ ] React Router v6 → v5 hooks adapted
292+
- [ ] Console SDK API adjustments
293+
- [ ] No adaptations needed (clean cherry-pick)
294+
295+
### Testing
296+
297+
- [ ] `make lint-frontend` passes
298+
- [ ] `make test-backend` passes
299+
- [ ] `npm run test:unit` passes
300+
- [ ] `make test-translations` passes
301+
- [ ] Manual testing performed
302+
303+
### Notes
304+
305+
<Any additional context about the backport>
306+
```
307+
308+
## Quick Reference Commands
309+
310+
```bash
311+
# View commit to backport
312+
git show <commit-hash>
313+
314+
# Compare file between branches
315+
git diff $1:web/src/<file> main:web/src/<file>
316+
317+
# Check dependency versions in target
318+
git show $1:web/package.json | grep -A 5 "patternfly"
319+
320+
# Interactive cherry-pick with edit
321+
git cherry-pick -e <commit-hash>
322+
```

.claude/commands/build-images.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: build-images
3+
description:
4+
parameters:
5+
- tag: The tag to be placed on the created images. This will typically be a jira ticket in the format of "letters-numbers" (ie. OU-1111).
6+
allowed-tools: Bash(INTERACTIVE=0 TAG=* make build-image), Bash(INTERACTIVE=0 TAG=* make build-dev-mcp-image), Bash(podman image ls -f "reference=$REGISTRY_ORG/monitoring-plugin*"), Bash(podman image ls -f "reference=$REGISTRY_ORG/monitoring-console-plugin*")
7+
---
8+
9+
## Context
10+
11+
- Prefer podman when running image related commands over docker.
12+
- All images that have currently been built for the monitoring plugin: !`podman image ls -f "reference=$REGISTRY_ORG/monitoring-plugin*"`
13+
- All images that have currently been built for the monitoring console plugin: !`podman image ls -f "reference=$REGISTRY_ORG/monitoring-plugin*"`
14+
- Scripting used: @Makefile @scripts/build-image.sh
15+
16+
## Your task
17+
18+
Determine an appropriate non-duplicate image tag to use. If the current git branch is a jira issue then you should use that as the base. If the tag is not already used then use it directly. If it has already been used, then add an additional index to the tag and increment one past the highest existing value. For example, if tags [OU-1111, OU-1111-2, and OU-1111-3] already exist then the the non-duplicate tag should be OU-1111-4. Do not attempt to use the same tag and override the previous build.
19+
20+
Run the `make build-image` and `make build-dev-mcp-image` commands with the INTERACTIVE=0 and TAG env variables set.
21+
22+
If the image fails to build, show the error to the user and offer to debug

0 commit comments

Comments
 (0)