Skip to content

Commit 12d115c

Browse files
authored
Merge branch 'main' into mr-sync-2026-06-16
2 parents d923d4a + 9c6c185 commit 12d115c

157 files changed

Lines changed: 11657 additions & 965 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.

.claude/rules/architecture.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2-
description: ODH Dashboard monorepo architecture, package boundaries, BFF structure, and operator controller
3-
globs: "packages/**,frontend/**,backend/**,dashboard-operator/**"
2+
description: ODH Dashboard monorepo architecture, package boundaries, BFF structure, operator controller, and distributions
3+
globs: "packages/**,frontend/**,backend/**,dashboard-operator/**,distributions/**"
44
alwaysApply: false
55
paths:
66
- "packages/**"
77
- "frontend/**"
88
- "backend/**"
99
- "dashboard-operator/**"
10+
- "distributions/**"
1011
---
1112

1213
# ODH Dashboard Architecture
@@ -87,9 +88,27 @@ A standalone Kubernetes operator that manages the full lifecycle of the Dashboar
8788

8889
The controller is **not** part of the npm workspace or Turbo pipeline. It has its own `go.mod`, `Makefile`, and CI workflow. See `dashboard-operator/AGENTS.md` and `.claude/rules/operator-controller.md` for detailed conventions.
8990

91+
## Distributions (`distributions/`)
92+
93+
Independently-deployable dashboard variants. These are NOT part of the npm workspace or Turbo pipeline — monorepo-wide `npm run` commands do not apply. Each sub-distribution is self-contained.
94+
95+
| Directory | Description | Has BFF? | Build System |
96+
|-----------|-------------|----------|--------------|
97+
| `base/` | Shared app shell library (PatternFly chrome, error boundary, extensibility hooks) — **not deployed on its own** | Stub only | Webpack |
98+
| `core-bff/` | Full Go BFF + React frontend for sidecar/xKC deployments | Yes (Go 1.25+) | Make + Webpack |
99+
| `rhaii/` | RHAII-specific distribution | No | Webpack |
100+
101+
- `base/` is a shared library/framework (not independently deployed) — it provides the app shell (masthead, sidebar, error boundary, theme context) that `core-bff/` and `rhaii/` extend
102+
- `rhaii/` is frontend-only — React + Webpack + Module Federation host configuration
103+
- `core-bff/` has both a Go BFF (`bff/`) and React frontend (`frontend/`) with its own contract tests (`contract-tests/`)
104+
- Each distribution has its own `package.json`, `tsconfig.json`, and webpack config
105+
- `core-bff/` follows contract-first development (OpenAPI → BFF stub → Frontend → Production BFF)
106+
107+
See `distributions/core-bff/AGENTS.md` for the most detailed reference. See `.claude/rules/distributions.md` for distribution-specific conventions and `.claude/rules/bff-go.md` for Go BFF conventions (applies to core-bff BFF code).
108+
90109
## BFF (Backend-for-Frontend) Architecture
91110

92-
Several packages have a Go-based BFF service: `automl`, `autorag`, `eval-hub`, `gen-ai`, `maas`, `mlflow`, `model-registry`.
111+
Several packages have a Go-based BFF service: `automl`, `autorag`, `eval-hub`, `gen-ai`, `maas`, `mlflow`, `model-registry`. The `distributions/core-bff` module also has a Go BFF.
93112
- Located in `bff/` within the package
94113
- Check each package's `bff/go.mod` for its required Go toolchain version
95114
- Exposes REST APIs consumed by the package's frontend

.claude/rules/bff-go.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
description: BFF (Backend For Frontend) API patterns and Go conventions for ODH Dashboard packages
3-
globs: "packages/*/bff/**,packages/*/upstream/bff/**"
2+
description: BFF (Backend For Frontend) API patterns and Go conventions for ODH Dashboard packages and distributions
3+
globs: "packages/*/bff/**,packages/*/upstream/bff/**,distributions/core-bff/bff/**"
44
alwaysApply: false
55
paths:
66
- "packages/*/bff/**"
77
- "packages/*/upstream/bff/**"
8+
- "distributions/core-bff/bff/**"
89
---
910

1011
# BFF API Patterns & Go Conventions
1112

1213
## Which packages have BFFs
1314

14-
gen-ai, model-registry, maas, automl, autorag, mlflow, eval-hub — each with a `bff/` directory containing Go code.
15+
gen-ai, model-registry, maas, automl, autorag, mlflow, eval-hub — each with a `bff/` directory containing Go code. The `distributions/core-bff` module also has a Go BFF in `distributions/core-bff/bff/`.
1516

1617
## Directory structure
1718

.claude/rules/distributions.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
description: Conventions for distribution variants — base app shell, core-bff, and rhaii
3+
globs: "distributions/**"
4+
alwaysApply: false
5+
paths:
6+
- "distributions/**"
7+
---
8+
9+
# Distribution Conventions
10+
11+
Distributions are independently-deployable dashboard variants in `distributions/`. They are NOT part of the npm workspace or Turbo pipeline — monorepo-wide `npm run` commands do not apply.
12+
13+
## Sub-distributions
14+
15+
| Directory | Type | Has BFF? | Build |
16+
|-----------|------|----------|-------|
17+
| `base/` | Shared app shell library (PatternFly chrome, no features) — **not deployed on its own** | Stub only | `npm run build` |
18+
| `core-bff/` | Full Go BFF + React frontend for sidecar/xKC deployments | Yes (Go 1.25+) | `make build` |
19+
| `rhaii/` | RHAII-specific distribution | No | `npm run build` |
20+
21+
> **`base/` is a library, not a deployable distribution.** It provides the shared app shell framework (masthead, sidebar, error boundary, theme context, extensibility hooks) that concrete distributions like `core-bff/` and `rhaii/` extend. Do not treat it as a standalone application.
22+
23+
## Isolation from npm workspaces
24+
25+
Distributions are self-contained. Always `cd` into the distribution directory before running commands:
26+
27+
```bash
28+
# WRONG — distributions are invisible to the root workspace
29+
npm run lint # won't touch distributions/
30+
npm run type-check # won't touch distributions/
31+
32+
# RIGHT — run from within the distribution
33+
cd distributions/base && npx eslint src/
34+
cd distributions/core-bff && make lint
35+
```
36+
37+
## Build and dev commands
38+
39+
### `base/` (shared library) and `rhaii/` (frontend-only)
40+
41+
`base/` is a library — run these commands for development and testing, not for standalone deployment. `rhaii/` is a deployable distribution that extends `base/`.
42+
43+
```bash
44+
npm run build # Webpack production build
45+
npm run start:dev # Webpack dev server (local development/testing only for base/)
46+
npx eslint src/ # Lint
47+
npx tsc --noEmit # Type-check
48+
```
49+
50+
### `core-bff/` (Go BFF + React frontend)
51+
52+
```bash
53+
make dev-start # Start both BFF and frontend in dev mode (mocked)
54+
make dev-bff # BFF only on port 4000
55+
make dev-frontend # Frontend dev server only
56+
make build # Build BFF + frontend
57+
make dev-start-federated # Start in federated mode
58+
```
59+
60+
#### BFF commands (from `bff/`)
61+
62+
```bash
63+
make run # Run BFF
64+
make lint # golangci-lint
65+
make test # Go tests
66+
make build # Build binary
67+
```
68+
69+
#### Frontend commands (from `frontend/`)
70+
71+
```bash
72+
npm run test # Full suite (lint + type-check + unit + cypress)
73+
npm run test:lint # Lint only
74+
npm run test:type-check # TypeScript check
75+
npm run test:unit # Jest unit tests
76+
npm run test:cypress-ci # Cypress headless
77+
```
78+
79+
#### Contract tests
80+
81+
```bash
82+
npm run test:contract # Both platforms
83+
npm run test:contract:openshift # Foundation + OpenShift tests
84+
npm run test:contract:xks # Foundation + XKS tests
85+
```
86+
87+
## Module Federation
88+
89+
`base/` and `rhaii/` are Module Federation **hosts** — they load federated remotes at runtime. Webpack configs in `config/` define the host setup. `core-bff/frontend/` also supports federated mode via `config/moduleFederation.js`.
90+
91+
When modifying Module Federation config in distributions, verify that remote names and shared dependencies stay consistent with the host dashboard's expectations.
92+
93+
## core-bff contract-first workflow
94+
95+
`core-bff/` follows a mandatory 4-stage development flow. See `core-bff/AGENTS.md` for full details:
96+
97+
1. **Contract first** — Update OpenAPI spec in `bff/openapi/src/core-bff.yaml`
98+
2. **BFF stub second** — Implement handlers in `bff/internal/api/`
99+
3. **Frontend third** — Build UI in `frontend/src/app/`
100+
4. **Production BFF last** — Replace mocks with real Kubernetes logic
101+
102+
## core-bff deployment modes
103+
104+
| Mode | Description | BFF Port | Frontend Port |
105+
|------|-------------|----------|---------------|
106+
| `standalone` | UI served by BFF, isolated deployment | 4000 | 4000 (static) |
107+
| `federated` | Micro-frontend loaded by host dashboard | 8082 | 9112 (dev) / 8843 (prod) |
108+
109+
## Common mistakes
110+
111+
- **Running `npm install` from a distribution directory without the workspace workaround** — dependencies on internal packages (`@odh-dashboard/eslint-config`, `@odh-dashboard/tsconfig`) won't resolve. See `distributions/base/README.md` for the workaround.
112+
- **Confusing `core-bff/bff/` with `dashboard-operator/`** — They are separate Go modules with different `go.mod` files and different patterns. `core-bff/bff/` is an HTTP BFF (uses httprouter); `dashboard-operator/` is a Kubernetes controller (uses controller-runtime).
113+
- **Assuming monorepo-wide lint/test commands cover distributions** — They don't. Always run validation from within the distribution directory.
114+
- **Forgetting to update the OpenAPI spec** when adding new endpoints to `core-bff/bff/` — Reviewers must see a diff in the OpenAPI file alongside code changes.

AGENTS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ odh-dashboard/
2020
│ ├── cmd/manager/ # Controller entry point
2121
│ ├── internal/controller/ # Reconciler, actions, support utilities
2222
│ └── config/ # Generated CRD, RBAC, manager manifests
23+
├── distributions/ # Independently-deployable dashboard variants
24+
│ ├── base/ # Shared app shell library (not deployed on its own)
25+
│ ├── core-bff/ # Full Go BFF + React frontend (has BFF)
26+
│ └── rhaii/ # RHAII-specific distribution (frontend-only)
2327
├── packages/ # Feature packages
2428
│ ├── cypress/ # Cypress test framework and shared tests
2529
│ ├── gen-ai/ # Gen AI / LLM features (has BFF)
@@ -92,11 +96,12 @@ Rules live in `.claude/rules/`. Read the relevant rule file before starting the
9296

9397
| Rule | File | Trigger |
9498
| --------------------------- | ----------------------------- | ------------------------------------------------------------------------------ |
95-
| **Architecture** | `architecture.md` | When making structural changes, adding packages, or modifying package boundaries |
96-
| **BFF Go** | `bff-go.md` | When working on Go BFF code in `packages/*/bff/` |
99+
| **Architecture** | `architecture.md` | When making structural changes, adding packages, modifying package boundaries, or working on distributions |
100+
| **BFF Go** | `bff-go.md` | When working on Go BFF code in `packages/*/bff/` or `distributions/core-bff/bff/` |
97101
| **Contract Tests** | `contract-tests.md` | When working on contract tests or BFF API validation |
98102
| **Conventions** | `conventions.md` | When writing or reviewing TypeScript, React, or backend code |
99103
| **CSS & PatternFly** | `css-patternfly.md` | When writing or modifying styles, SCSS, or PatternFly components |
104+
| **Distributions** | `distributions.md` | When working on code in `distributions/` |
100105
| **Cypress E2E Tests** | `cypress-e2e.md` | When creating or modifying E2E tests, Robot Framework migrations |
101106
| **Cypress Mock Tests** | `cypress-mock.md` | When creating or modifying mock/component tests |
102107
| **Jira Creation** | `jira-creation.md` | When asked to create Jira issues, tickets, bugs, stories, tasks, or epics |

BOOKMARKS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ Central index of key documentation in the ODH Dashboard monorepo.
103103

104104
---
105105

106+
## Distributions
107+
108+
| Doc | Description |
109+
|-----|-------------|
110+
| [Core BFF AGENTS.md](distributions/core-bff/AGENTS.md) | Core BFF development guide — contract-first workflow, BFF rules, frontend rules, deployment modes, testing |
111+
| [Core BFF Frontend Docs](distributions/core-bff/frontend/docs/) | Frontend dev setup, testing, and styling guides |
112+
| [Core BFF BFF Docs](distributions/core-bff/bff/README.md) | Go BFF documentation |
113+
| [Core BFF OpenAPI Spec](distributions/core-bff/bff/openapi/src/core-bff.yaml) | OpenAPI specification (contract-first source of truth) |
114+
| [Base Distribution README](distributions/base/README.md) | App shell setup, dev environment, environment variables |
115+
116+
---
117+
106118
## Packages
107119

108120
### Full Docs

manifests/modular-architecture/modules-cluster-role.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,37 @@ rules:
2828
- create
2929
resources:
3030
- subjectaccessreviews
31+
# Impersonate dashboard users when AUTH_METHOD=internal (Kubeflow headers)
32+
- apiGroups:
33+
- ""
34+
verbs:
35+
- impersonate
36+
resources:
37+
- users
38+
- groups
39+
- serviceaccounts
40+
# Agent Ops — AgentRuntime card discovery
41+
- apiGroups:
42+
- agent.kagenti.dev
43+
verbs:
44+
- get
45+
- list
46+
resources:
47+
- agentruntimes
48+
# Agent Ops — OpenShift Route lookup for external agent card URL
49+
- apiGroups:
50+
- route.openshift.io
51+
verbs:
52+
- get
53+
- list
54+
resources:
55+
- routes
56+
# Agent Ops — MCP tool connection discovery (optional CRD)
57+
- apiGroups:
58+
- mcp.kuadrant.io
59+
- mcp.kagenti.com
60+
verbs:
61+
- get
62+
- list
63+
resources:
64+
- mcpserverregistrations

packages/agent-ops/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dev-install-dependencies:
4242
.PHONY: dev-bff
4343
dev-bff: ## Run BFF in mock mode with user_token auth (recommended for local dev)
4444
trap 'exit 0' INT; \
45-
cd bff && make run PORT=4000 MOCK_K8S_CLIENT=true MOCK_HTTP_CLIENT=true DEV_MODE=true DEPLOYMENT_MODE=standalone AUTH_METHOD=user_token
45+
cd bff && make run PORT=4000 MOCK_K8S_CLIENT=true MOCK_HTTP_CLIENT=true MOCK_AGENT_CLIENT=true DEV_MODE=true DEPLOYMENT_MODE=standalone AUTH_METHOD=user_token
4646

4747
.PHONY: dev-frontend
4848
dev-frontend:
@@ -87,7 +87,7 @@ E2E_BFF_PORT ?= 4021
8787

8888
.PHONY: dev-bff-e2e-mock
8989
dev-bff-e2e-mock: ## Run BFF for e2e tests (mock mode, no cluster required)
90-
cd bff && make run PORT=$(E2E_BFF_PORT) LOG_LEVEL=info MOCK_K8S_CLIENT=true MOCK_HTTP_CLIENT=true DEV_MODE=true DEPLOYMENT_MODE=federated
90+
cd bff && make run PORT=$(E2E_BFF_PORT) LOG_LEVEL=info MOCK_K8S_CLIENT=true MOCK_HTTP_CLIENT=true MOCK_AGENT_CLIENT=true DEV_MODE=true DEPLOYMENT_MODE=federated
9191

9292
.PHONY: dev-bff-e2e-cluster
9393
dev-bff-e2e-cluster: ## Run BFF for e2e tests (federated mode, connected to cluster)

0 commit comments

Comments
 (0)