# Konflux UI [![Build](https://img.shields.io/github/check-runs/konflux-ci/konflux-ui/main?nameFilter=Red%20Hat%20Konflux%20%2F%20konflux-ui-on-push&label=Build)](https://github.com/konflux-ci/konflux-ui/commits/main) [![EC](https://img.shields.io/github/check-runs/konflux-ci/konflux-ui/main?nameFilter=Red%20Hat%20Konflux%20%2F%20ec%20%2F%20konflux-ui&label=EC)](https://github.com/konflux-ci/konflux-ui/commits/main) UI for [Konflux](https://github.com/konflux-ci/konflux-ci) ## Contributing We welcome contributions! Please read our [Contributing Guidelines](./CONTRIBUTING.md) to get started. If you find a bug or want to request a feature, feel free to open an issue as well. ## Quick Start **Prerequisites:** Node.js >= 24 Clone the repository, then run a single setup command (enables Corepack, installs dependencies, and starts the dev server): ```bash git clone https://github.com/konflux-ci/konflux-ui.git && cd konflux-ui yarn setup ``` Equivalent: `./setup.sh` ## Setting up development environment This project contains a DevContainer which has all dependencies for developing Konflux UI pre-installed. You can find out more information for how to configure your environment to use the DevContainer in the included [README.md](.devcontainer/README.md). ### Manual installation If you do not want to or cannot use the DevContainer, you can also setup the repository yourself. **Prerequisites:** - Node.js version >= 24 - Corepack enabled (included with Node.js 24+) > **Note:** This project uses [Yarn Berry (v4.x)](https://yarnpkg.com/) as the package manager. The correct Yarn version is automatically managed via the `packageManager` field in `package.json` and Corepack. A step by step series of examples that tell you how to get a development environment running: 1. Clone the repository 2. Enable Corepack (required for Yarn Berry) ```bash corepack enable ``` > On some systems you may need `sudo corepack enable` 3. Install dependencies ```bash yarn install ``` 4. Run the app in development mode ```bash yarn start ``` ## Running with Konflux-ci By default, the UI uses the stage cluster for API calls. However, if you want to run the UI with a local Konflux deployment, follow the steps below. 1. Follow the guide at https://konflux-ci.dev/konflux-ci/docs/installation/install-local/ to deploy Konflux locally 2. Once you have Konflux deployed, make the following changes to your .env file: ```diff # .env + AUTH_URL=https://127.0.0.1:9443/ + REGISTRATION_URL=https://127.0.0.1:9443/ + PROXY_URL=https://127.0.0.1:9443/ + PROXY_WEBSOCKET_URL=wss://127.0.0.1:9443 - AUTH_URL= https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/ - REGISTRATION_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/ - PROXY_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/ - PROXY_WEBSOCKET_URL=wss://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/ ``` 3. Update your webpack.dev.config.js file with the following changes: ```diff @@ webpack.dev.config.js:14 @@ historyApiFallback: true, hot: true, server: 'https', proxy: [ { + context: (path) => path.includes('/oauth2/') || path.includes('/idp/'), - context: (path) => path.includes('/oauth2/'), target: process.env.AUTH_URL, secure: false, changeOrigin: true, + autoRewrite: true, - autoRewrite: false, toProxy: true, headers: { 'X-Forwarded-Host': `localhost:${DEV_SERVER_PORT}`, }, onProxyRes: (proxyRes) => { const location = proxyRes.headers['location']; if (location) { proxyRes.headers['location'] = location.replace( + 'localhost:9443', + `localhost:${DEV_SERVER_PORT}`, - 'konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com%2Foauth2', - `localhost:${DEV_SERVER_PORT}/oauth2`, ); } }, ``` ### Copy login command on a local cluster On OpenShift, the UI derives the API server and OAuth URLs from a `*.apps.` hostname. You do not need extra ConfigMap fields for that case. For Kind or a custom UI hostname, **merge** a `cliLogin` object into the existing `info.json` of ConfigMap `konflux-public-info` (namespace `konflux-info`). Do not replace `info.json` entirely — that document also holds `rbac` and other required fields. konflux-operator reconciles this ConfigMap and will drop unknown fields, including `cliLogin`, unless the operator is extended to emit them. For a local cluster you can scale the operator deployment to 0 before patching, or wait for operator support. Example field to merge into the current `info.json`: ```json { "cliLogin": { "apiServerUrl": "https://127.0.0.1:", "authMode": "kubernetes", "kubeContext": "kind-konflux" } } ``` ## Available Scripts In the project directory, you can run: - `yarn build`: Builds the app for production using webpack with the production configuration file. - `yarn size-limit`: Checks production bundle sizes against the gzip budgets in `.size-limit.json`. Run `yarn build` first. See [docs/bundle-size-budgets.md](docs/bundle-size-budgets.md). - `yarn start`: Runs the app in development mode. Opens the app in your default browser. - `yarn test`: Runs unit tests using jest. - `yarn coverage`: Runs the test suite with coverage report. - `yarn lint`: Runs both TypeScript and SASS linting. - `yarn lint:ts`: Lints TypeScript files. - `yarn lint:sass`: Lints SASS files. ## Built With - [Webpack](https://webpack.js.org/) - Module bundler - [Jest](https://jestjs.io/) - Testing framework - [ESLint](https://eslint.org/) - TypeScript linting - [Stylelint](https://stylelint.io/) - SASS linting