Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ AGENTS.override.md
.claude/pr/*
.mcp*
.tmp
.pi-subagents

# Editors
*.code-workspace
Expand Down
1 change: 1 addition & 0 deletions .pi/prompts/create-pr.md
1 change: 1 addition & 0 deletions .pi/prompts/pdf-transcription-demo.md
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Check out the **[Github page](https://github.com/openshift/faas-console-plugin)*
| [PR Template](.github/pull_request_template.md) | Pull request description format |
| [Jira Epic](docs/templates/jira-epic-template.md) | Template for creating Jira epics |
| [Jira Story](docs/templates/jira-story-template.md) | Template for creating Jira stories |
| [Jira Bug](docs/templates/jira-bug-template.md) | Template for filing Jira bugs |

### Slash Commands

Expand Down
1 change: 1 addition & 0 deletions docs/AGILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ We use Jira for planning and tracking. Issues are organized as:

- **Epics** group related stories under a single initiative (see [epic template](templates/jira-epic-template.md))
- **Stories** describe a unit of deliverable work (see [story template](templates/jira-story-template.md))
- **Bugs** describe a defect to fix (see [bug template](templates/jira-bug-template.md))
- **Sub-tasks** break a story into smaller pieces when needed

## Jira Story Status
Expand Down
3 changes: 2 additions & 1 deletion docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Red/green/refactor TDD — **one test at a time**:

Do NOT write all test cases first and then implement everything at once.

**Bug fixes require a regression test.** Add a unit test that reproduces the bug, or an e2e test if the bug is not testable at the unit level.

## Test Layers

| Layer | Tool | Scope |
Expand Down Expand Up @@ -326,7 +328,6 @@ test.describe('My feature', () => {
});
```


---

## Backend (Go)
Expand Down
32 changes: 32 additions & 0 deletions docs/references/ocp-dynamic-plugin-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,35 @@ return <h1>{t('Hello, World!')}</h1>;
1. Module federation requires exact module mapping: `exposedModules` must match `$codeRef` values
2. No webpack HMR for extensions: changes to `console-extensions.json` require restart
3. React 17, not 18: matches console's React version

## Plugin Inventory

[OCP Dynamic Plugin Inventory](https://docs.google.com/spreadsheets/d/1wcCdc1s4ewzxtUJ42VdRhAJ9wFA8UwoTajGSftrr5fM/edit?gid=0#gid=0)

| Plugin | Repo | Description |
|--------|------|-------------|
| Console Plugin Template | [openshift/console-plugin-template](https://github.com/openshift/console-plugin-template) | Starter template for OCP dynamic plugins |
| Console Demo Plugin | [openshift/console (demo)](https://github.com/openshift/console/tree/main/dynamic-demo-plugin) | SDK feature testing and reference |
| KubeVirt | [kubevirt-ui/kubevirt-plugin](https://github.com/kubevirt-ui/kubevirt-plugin) | Virtual machine management UI |
| Forklift | [kubev2v/forklift-console-plugin](https://github.com/kubev2v/forklift-console-plugin) | VM migration from other platforms to KubeVirt |
| Monitoring | [openshift/monitoring-plugin](https://github.com/openshift/monitoring-plugin) | Prometheus monitoring dashboards and alerts |
| Logging | [openshift/logging-view-plugin](https://github.com/openshift/logging-view-plugin) | Log viewing and querying |
| Distributed Tracing | [openshift/distributed-tracing-console-plugin](https://github.com/openshift/distributed-tracing-console-plugin) | Distributed tracing with Tempo/Jaeger |
| Console Dashboards | [openshift/console-dashboards-plugin](https://github.com/openshift/console-dashboards-plugin) | Custom dashboard support for OCP console |
| Troubleshooting Panel | [openshift/troubleshooting-panel-console-plugin](https://github.com/openshift/troubleshooting-panel-console-plugin) | Guided troubleshooting for cluster issues |
| Networking | [openshift/networking-console-plugin](https://github.com/openshift/networking-console-plugin) | Network policies, routes, and services |
| Network Observability | [netobserv/network-observability-console-plugin](https://github.com/netobserv/network-observability-console-plugin) | Network traffic flow visualization |
| OpenShift Pipelines | [openshift-pipelines/console-plugin](https://github.com/openshift-pipelines/console-plugin) | Tekton pipeline builder and viewer |
| OpenShift GitOps | [redhat-developer/gitops-console-plugin](https://github.com/redhat-developer/gitops-console-plugin) | ArgoCD/GitOps application status |
| OpenShift Data Foundation | [red-hat-storage/odf-console](https://github.com/red-hat-storage/odf-console) | Ceph/NooBaa storage management |
| Service Mesh (Kiali) | [kiali/openshift-servicemesh-plugin](https://github.com/kiali/openshift-servicemesh-plugin) | Istio service mesh observability |
| ACM / MCE | [stolostron/console](https://github.com/stolostron/console) | Advanced Cluster Management multi-cluster UI |
| Cluster Templates | [stolostron/cluster-templates-operator](https://github.com/stolostron/cluster-templates-operator) | Cluster provisioning templates |
| Crane (Migration) | [migtools/crane-ui-plugin](https://github.com/migtools/crane-ui-plugin) | Application migration toolkit |
| NMState | [nmstate/nmstate-console-plugin](https://github.com/nmstate/nmstate-console-plugin) | Declarative node network configuration |
| Console Telemetry | [christianvogt/console-telemetry-plugin](https://github.com/christianvogt/console-telemetry-plugin) | Usage telemetry collection for console |
| Lightspeed | [openshift/lightspeed-console](https://github.com/openshift/lightspeed-console) | AI assistant for OpenShift |
| Cryostat | [cryostatio/cryostat-openshift-console-plugin](https://github.com/cryostatio/cryostat-openshift-console-plugin) | JFR profiling and recording management |
| Node Remediation | [medik8s/node-remediation-console](https://github.com/medik8s/node-remediation-console) | Automated node health check and remediation |
| Skupper | [bartoval/skupper-site-console](https://github.com/bartoval/skupper-site-console) | Multi-cluster service connectivity |
| Kuadrant | [Kuadrant/kuadrant-console-plugin](https://github.com/Kuadrant/kuadrant-console-plugin) | API gateway policies (rate limiting, auth) |
37 changes: 37 additions & 0 deletions docs/templates/jira-bug-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Jira Bug Template

```
### Summary

<One sentence describing what is broken and where.>

Every bug fix requires a regression test (see [Testing](../TESTING.md#approach)).

### Steps to Reproduce

1. <Step-by-step instructions to trigger the bug.>

### Expected Behavior

<What should happen.>

### Actual Behavior

<What happens instead. Include error messages, stack traces, or screenshots.>

### Environment

<OCP version, browser, cluster type, or other relevant context.>

### Root Cause (optional)

<Brief explanation of why it happens, if known.>

### Fix (optional)

<Brief description of the fix, if known.>

### References

<Links to code, logs, screenshots, recordings, related issues.>
```
60 changes: 60 additions & 0 deletions e2e/use-cases/edit/edit-javascript-function.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { test, expect } from '../../fixtures/authenticated-page';
import { navigateToEditPage } from '../../helpers/navigation';
import { PRESEEDED_FUNC_NAME } from '../../mocks/github';

test.describe('Edit JavaScript function', () => {
test('regression SRVOCF-1007: editor loads JS files without Monaco worker errors', async ({
page,
}) => {
const consoleErrors: string[] = [];
page.on('pageerror', (err) => consoleErrors.push(err.message));

Comment on lines +9 to +11

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twoGiants that seems like a reasonably addition to test coverage.

await test.step('navigate to edit page', async () => {
await navigateToEditPage(page, PRESEEDED_FUNC_NAME);
await expect(page.getByRole('heading', { name: 'Edit function' })).toBeVisible({
timeout: 10_000,
});
});

await test.step('verify editor loads with JavaScript syntax highlighting', async () => {
const editor = page.locator('.monaco-editor');
await expect(editor.first()).toBeVisible({ timeout: 10_000 });
await expect(editor.first()).toContainText('module.exports');

// Language label shows JAVASCRIPT
await expect(page.getByText('JAVASCRIPT')).toBeVisible();
});

await test.step('verify no webpack error overlay appeared', async () => {
const overlay = page.locator('#webpack-dev-server-client-overlay');
await expect(overlay).toHaveCount(0);
});

await test.step('verify no "Unexpected usage" errors in console', async () => {
const workerErrors = consoleErrors.filter((msg) => msg.includes('Unexpected usage'));
expect(workerErrors).toHaveLength(0);
});

await test.step('verify file tree loaded', async () => {
const tree = page.getByRole('tree', { name: 'File tree' });
await expect(tree.getByText('func.yaml')).toBeVisible();
await expect(tree.getByText('index.js')).toBeVisible();
});

await test.step('verify switching files works without errors', async () => {
const tree = page.getByRole('tree', { name: 'File tree' });
await tree.getByText('func.yaml', { exact: true }).click();

const editor = page.locator('.monaco-editor');
await expect(editor.first()).toContainText('runtime: node');

// Switch back to JS file
await tree.getByText('index.js', { exact: true }).click();
await expect(editor.first()).toContainText('module.exports');

// Still no worker errors after switching
const workerErrors = consoleErrors.filter((msg) => msg.includes('Unexpected usage'));
expect(workerErrors).toHaveLength(0);
});
});
});
10 changes: 10 additions & 0 deletions src/pages/function-edit/FunctionEditPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CodeEditor, DocumentTitle, ListPageHeader } from '@openshift-console/dynamic-plugin-sdk';
import type { Language } from '@patternfly/react-code-editor';
import type { Monaco } from '@monaco-editor/react';
import {
DescriptionList,
DescriptionListDescription,
Expand Down Expand Up @@ -90,6 +91,15 @@ function FunctionEditPageContent() {
</EmptyState>
}
isLanguageLabelVisible
editorProps={{
beforeMount: (monaco: Monaco) => {
// SRVOCF-1007: the OCP console does not bundle Monaco's TS worker.
Comment on lines +94 to +96
// Disable all worker-dependent features for JS/TS so the missing
// worker is never requested. Monarch syntax highlighting is unaffected.
monaco.languages.typescript.javascriptDefaults.setModeConfiguration({});
monaco.languages.typescript.typescriptDefaults.setModeConfiguration({});
},
}}
/>
</SidebarContent>
</Sidebar>
Expand Down