- What: Dual frontend plugins for OpenShift observability (monitoring-plugin + monitoring-console-plugin)
- Purpose: Alerts, Metrics, Targets, Dashboards + Perses, Incidents, ACM integration
- Tech Stack: React + TypeScript + Webpack + i18next + Go
- Key Files:
web/console-extensions.json,web/src/components/
- Check if it belongs in
monitoring-plugin(core) ormonitoring-console-plugin(extended) - Update console extensions in
web/console-extensions.json - Add React components in
web/src/components/ - Add translations in
public/locales/ - Test with
make lint-frontend && make test-backend
- Build failures: Check
Makefiletargets - Console integration: Verify
console-extensions.json - Plugin loading: Check OpenShift Console logs
- Perses dashboards: Debug at
web/src/components/dashboards/perses/
- See README.md for full setup
- Deployment: https://github.com/observability-ui/development-tools/
- Files:
web/src/components/alerts/ - Integration: Alertmanager API
- Testing: Cypress tests in
web/cypress/
- Legacy: Standard OpenShift dashboards
- Perses:
web/src/components/dashboards/perses/(uses ECharts wrapper) - Upstream: https://github.com/perses/perses
- Multi-cluster observability
- Hub cluster aggregation
- Thanos/Alertmanager integration
- monitoring-plugin: Core observability (always available)
- monitoring-console-plugin: Optional features (COO required)
- Check compatibility with OpenShift Console versions
- Verify i18next translation support
- Consider CMO vs COO deployment differences
| System | Repository | Purpose |
|---|---|---|
| CMO | https://github.com/openshift/cluster-monitoring-operator | Manages monitoring-plugin |
| COO | https://github.com/rhobs/observability-operator | Manages monitoring-console-plugin |
| Perses | https://github.com/perses/perses | Dashboard engine |
| Console SDK | https://github.com/openshift/console | Plugin framework |
- Plugin SDK: https://github.com/openshift/console/tree/main/frontend/packages/console-dynamic-plugin-sdk
- Extensions docs: https://github.com/openshift/console/blob/main/frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
- Example plugin: https://github.com/openshift/console/tree/main/dynamic-demo-plugin
- CMO (monitoring-plugin): Integrated with cluster monitoring stack
- COO (monitoring-console-plugin): Optional operator for extended features
- UIPlugin CR example:
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
name: monitoring
spec:
type: Monitoring
monitoring:
acm:
enabled: true
alertmanager:
url: "https://alertmanager.open-cluster-management-observability.svc:9095"
thanosQuerier:
url: "https://rbac-query-proxy.open-cluster-management-observability.svc:8443"
perses:
enabled: true
incidents:
enabled: true- Core: https://github.com/perses/perses
- Plugins: https://github.com/perses/plugins (chart specifications and datasources)
- Operator: https://github.com/perses/perses-operator (Red Hat fork: https://github.com/rhobs/perses)
- Chart Engine: ECharts (https://echarts.apache.org/)
- Multi-cluster monitoring: Centralized observability across managed clusters
- Components: Hub cluster Thanos, Grafana, Alertmanager + endpoint operators
- Integration: COO provides unified alerting UI for ACM environments
- Features: Cross-cluster silences, cluster-labeled alerts, centralized metrics
make lint-frontend
make lint-backend
make test-translations
make test-backend
make test-frontend
# future slash command for test execution- Title format:
[JIRA_ISSUE]: Description - Testing: All linting and tests must pass
- Translations: Ensure i18next keys are properly added
The Monitoring Plugin uses a dual testing approach for unit tests:
- Frontend Unit Tests: Jest + TypeScript for React components and utilities
- Backend Unit Tests: Go's built-in testing framework for server functionality
Unit tests focus on isolated function testing and run quickly in CI/CD pipelines, while E2E tests (Cypress) validate full user workflows.
Frontend Tests:
- Location: Co-located with source files in
web/src/ - Naming:
*.spec.ts(e.g.,format.spec.ts,utils.spec.ts) - Framework: Jest 30.2.0 with ts-jest
- Configuration:
web/jest.config.js
Backend Tests:
- Location: Co-located with source files in
pkg/ - Naming:
*_test.go(e.g.,server_test.go) - Framework: Go testing package + testify/require
- Configuration: Standard Go test conventions
# Run all tests (backend + frontend)
make test-backend
make test-frontend
# Run individually from web directory
cd web && npm run test:unit
# Run Go tests directly
go test ./pkg/... -vCreate unit tests when:
- Adding utility functions: Pure functions, formatters, data transformations
- Adding business logic: Data processing, calculations, validations
- Fixing bugs: Regression tests to prevent bug recurrence
- Adding API handlers: Backend endpoint logic (Go tests)
Frontend:
jest(v30.2.0) - Test runner and assertionsts-jest(v29.4.4) - TypeScript support@types/jest- TypeScript definitions
Backend:
testing(stdlib) - Go testing frameworkgithub.com/stretchr/testify(v1.9.0) - Assertions and test utilities
Testing Framework & Configuration Test Framework: Jest + ts-jest Configuration File: web/jest.config.js
Test File Location & Naming Convention Pattern: *.spec.ts files co-located with source code
Test Coverage Areas
- Edge cases (null, undefined, empty values)
- Normal behavior and expected outputs
- Boundary conditions
- Complex scenarios and integration
- Data transformations and formatting
Testing Framework & Configuration Test Framework: Go's built-in testing package Assertion Library: github.com/stretchr/testify v1.9.0
Test File Location & Naming Convention Pattern: *_test.go files in the same directory as source code
Test Helper Functions
startTestServer()- Starts server for testingprepareServerAssets()- Sets up test environmentgenerateCertificate()- Creates TLS certificates for testscheckHTTPReady()- Waits for server to be readygetRequestResults()- Makes HTTP requests
Test Coverage Areas
- HTTP server functionality
- HTTPS/TLS configuration
- Certificate handling
- Security settings (TLS versions, cipher suites)
- Endpoint availability
The Monitoring Plugin uses Cypress for comprehensive End-to-End (E2E) testing to ensure functionality across both the core monitoring-plugin (managed by CMO) and the monitoring-console-plugin (managed by COO). Our test suite covers test scenarios including alerts, metrics, dashboards, and integration with Virtualization and Fleet Management (ACM).
Key Testing Documentation:
- Setup & Configuration:
web/cypress/README.md- Environment variables, installation, troubleshooting - Testing Guide:
web/cypress/CYPRESS_TESTING_GUIDE.md- Test architecture, creating tests, workflows - Test Catalog:
web/cypress/E2E_TEST_SCENARIOS.md- Complete list of all test scenarios
You should create new Cypress tests when:
- Adding New Features: Any new UI feature requires corresponding E2E tests
- Fixing Bugs: Bug fixes should include tests to prevent regression
- Modifying Existing Features: Changes to existing functionality require test updates
cd web/cypress
# Run all regression tests
npm run cypress:run --spec "cypress/e2e/**/regression/**"
# Run BVT (Build Verification Tests)
npm run cypress:run --spec "cypress/e2e/monitoring/00.bvt_admin.cy.ts"
# Run COO tests
npm run cypress:run --spec "cypress/e2e/coo/*.cy.ts"
# Interactive mode
npm run cypress:openFor detailed testing instructions, see web/cypress/CYPRESS_TESTING_GUIDE.md
Cypress component tests mount individual React components in isolation, without requiring a running OpenShift cluster. They are useful for testing component rendering, user interactions, and visual behavior with fast feedback.
- Test location:
web/cypress/component/ - Support file:
web/cypress/support/component.ts - Config:
componentsection inweb/cypress.config.ts
- Testing a component's rendering logic (conditional display, empty states)
- Verifying props are handled correctly
- Validating user interactions within a single component
- When E2E tests would be overkill for the behavior under test
cd web
# Interactive mode
npm run cypress:open:component
# Headless mode - all component tests
npm run cypress:run:component
# Run a single component test file
npx cypress run --component --spec cypress/component/labels.cy.tsxComponent test files use the .cy.tsx extension and go in web/cypress/component/:
import React from 'react';
import { MyComponent } from '../../src/components/MyComponent';
describe('MyComponent', () => {
it('renders correctly', () => {
cy.mount(<MyComponent prop="value" />);
cy.contains('expected text').should('be.visible');
});
});- Konflux: Handles CI/CD and release automation
- CMO releases: Follow OpenShift release cycles
- COO releases: Independent release schedule
For backporting features from main to release branches (e.g., release-4.x, release-coo-x.y), use the /backport slash command:
/backport <target-branch> [commit-hash]
# Examples:
/backport release-4.18
/backport release-coo-0.4 abc123The command is located at .claude/commands/backport.md and handles:
- PatternFly v6 → v5 component transformations
- React Router v6 → v5 hook adaptations
- Console SDK API compatibility
- Dependency version differences between branches
- Project structure differences (web/ vs root for older releases)
- Inherits OpenShift Console RBAC
- Respects cluster monitoring permissions
- ACM integration requires appropriate hub cluster access
- No credentials in code
- Use cluster service accounts
- Follow OpenShift security guidelines
| Topic | Channel/Resource |
|---|---|
| Console Plugins | OpenShift Console SDK documentation |
| Perses | Slack: Cloud Native Computing Foundation >> #perses-dev |
| COO | Slack: Internal Red Hat >> #forum-cluster-observability-operator |
- Monitoring Plugin: https://github.com/observability-ui/development-tools/tree/main/monitoring-plugin
- Perses: https://github.com/observability-ui/development-tools/tree/main/perses
- Wiki: https://github.com/observability-ui/development-tools/tree/main/wiki
- TypeScript: https://www.typescriptlang.org/
- React: https://react.dev/
- Webpack: https://webpack.js.org/
- Go: https://go.dev/
- i18next: https://www.i18next.com/
This guide is optimized for AI agents and developers. For detailed setup instructions, also refer to README.md and Makefile.