An AI-powered, extensible UI framework built on the OpenShift Console dynamic plugin, enabling unified, intelligent experiences across Red Hat products.
This README is a work in progress (WIP).
In one terminal window, run:
yarn installyarn run start
In another terminal window, run:
oc login(requires oc and an OpenShift cluster)yarn run start-console(requires Docker or podman 3.2.0+)
This will run the OpenShift console in a container connected to the cluster you've logged into. The plugin HTTP server runs on port 9001 with CORS enabled. Navigate to http://localhost:9000/example to see the running plugin.
If you are using podman on a Mac with Apple silicon, yarn run start-console
might fail since it runs an amd64 image. You can workaround the problem with
qemu-user-static by running
these commands:
podman machine ssh
sudo -i
rpm-ostree install qemu-user-static
systemctl rebootMake sure the Remote Containers extension is installed. This method uses Docker Compose where one container is the OpenShift console and the second container is the plugin. It requires that you have access to an existing OpenShift cluster. After the initial build, the cached containers will help you start developing in seconds.
- Create a
dev.envfile inside the.devcontainerfolder with the correct values for your cluster:
OC_PLUGIN_NAME=console-plugin-template
OC_URL=https://api.example.com:6443
OC_USER=kubeadmin
OC_PASS=<password>(Ctrl+Shift+P) => Remote Containers: Open Folder in Container...yarn run start- Navigate to http://localhost:9000/genie
This project uses Jest and React Testing Library for unit testing.
# Run all tests once
yarn test
# Run tests in watch mode (re-runs on file changes)
yarn test:watch
# Run tests with coverage report
yarn test:coverageTests should be placed alongside the components they test with a .test.tsx extension. For components with multiple test files, use a __tests__/ directory.
File Organization:
- Single test file:
src/components/MyComponent.test.tsx(co-located) - Multiple test files:
src/components/my-component/__tests__/(organized)
Example test:
import { render, screen } from '@testing-library/react';
import MyComponent from './MyComponent';
describe('MyComponent', () => {
it('renders correctly', () => {
render(<MyComponent />);
expect(screen.getByText('Expected Text')).toBeInTheDocument();
});
});Integration tests using Cypress are available. See the integration-tests directory for more details.
# Run Cypress in interactive mode
yarn test-cypress
# Run Cypress in headless mode
yarn test-cypress-headlessSee CONTRIBUTING.md for guidelines. A PR template is in place (see .github/pull_request_template.md) prompting for a summary and testing details.