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
11 changes: 7 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
node-version: '24'

- run: yarn install --frozen-lockfile
- uses: pnpm/action-setup@v4
with:
run_install: false

- run: pnpm install --frozen-lockfile

- run: yarn test:coverage
- run: pnpm test:coverage

- uses: codecov/codecov-action@v5
with:
Expand Down
16 changes: 7 additions & 9 deletions .konflux/Containerfile.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@ FROM registry.access.redhat.com/ubi9/nodejs-22 AS builder

USER root

# Install Yarn
RUN npm install --global yarn
# Install pnpm
RUN npm install --global pnpm

COPY ["package.json", "yarn.lock", "./"]
COPY ["package.json", "pnpm-lock.yaml", "./"]

RUN yarn install --no-progress --non-interactive
RUN pnpm install --no-frozen-lockfile --ignore-scripts

ADD . /usr/src/app
WORKDIR /usr/src/app

RUN yarn install --network-timeout 600000 && \
yarn cache clean

RUN yarn install --no-progress --non-interactive
RUN pnpm install --no-frozen-lockfile && \
pnpm store prune
Comment on lines +21 to +32

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n "packageManager" package.json

Repository: redhat-developer/gitops-console-plugin

Length of output: 176


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== package.json ==\n'
sed -n '1,120p' package.json

printf '\n== pnpm-lock.yaml head ==\n'
sed -n '1,40p' pnpm-lock.yaml

printf '\n== .konflux/Containerfile.plugin ==\n'
nl -ba .konflux/Containerfile.plugin | sed -n '1,80p'

Repository: redhat-developer/gitops-console-plugin

Length of output: 5151


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check whether corepack or pnpm version pinning is already used elsewhere
rg -n "corepack|pnpm@|packageManager|frozen-lockfile|no-frozen-lockfile" -S .

Repository: redhat-developer/gitops-console-plugin

Length of output: 176


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect lockfile version semantics without executing repo code
python3 - <<'PY'
from pathlib import Path
import re

text = Path('pnpm-lock.yaml').read_text()
m = re.search(r'^lockfileVersion:\s*(.+)$', text, re.M)
print('lockfileVersion:', m.group(1).strip() if m else 'MISSING')
PY

Repository: redhat-developer/gitops-console-plugin

Length of output: 199


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== .konflux/Containerfile.plugin ==\n'
sed -n '1,80p' .konflux/Containerfile.plugin

printf '\n== pnpm pinning / corepack references ==\n'
grep -RInE 'corepack|pnpm@|packageManager|frozen-lockfile|no-frozen-lockfile' . --exclude-dir=.git || true

Repository: redhat-developer/gitops-console-plugin

Length of output: 50394


Pin pnpm and restore frozen installs in the container build.

  • package.json has no packageManager pin, so npm install --global pnpm can drift to a different pnpm release over time.
  • Both pnpm install steps use --no-frozen-lockfile, which allows dependency resolution to move away from the committed pnpm-lock.yaml.

Use a pinned pnpm version (or Corepack) and switch back to frozen-lockfile behavior for the image build.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.konflux/Containerfile.plugin around lines 21 - 32, The container build in
Containerfile.plugin uses an unpinned pnpm install and disables lockfile
enforcement, so update the build to use a pinned pnpm version via Corepack or an
explicit version tied to packageManager, and switch both pnpm install steps back
to frozen-lockfile behavior. Adjust the install flow around the pnpm setup and
the two pnpm install commands so the image build always follows the committed
pnpm-lock.yaml and does not drift with newer pnpm releases.


COPY [".", "."]

RUN yarn build
RUN pnpm build

####################################################################################################

Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public-hoist-pattern[]=*types*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM docker.io/library/node:23 AS build

RUN corepack enable && corepack prepare pnpm@10.33.2 --activate

ADD . /usr/src/app
WORKDIR /usr/src/app
RUN yarn config set network-timeout 600000 -g
RUN yarn install && yarn build
RUN pnpm config set fetchTimeout 600000 -g
RUN pnpm install --frozen-lockfile && pnpm build

FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/httpd-24

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Based on [Openshift Console dynamic plugin](https://github.com/openshift/console

In one terminal window, run:

1. `yarn install`
2. `yarn run start`
1. `pnpm install`
2. `pnpm run start`

In another terminal window, run:

Expand All @@ -30,15 +30,15 @@ spec:
termination: reencrypt
insecureEdgeTerminationPolicy: Allow
```
3. `yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
3. `pnpm run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))

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/envdynamic> to see the running plugin.

#### Running start-console with Apple silicon and podman

If you are using podman on a Mac with Apple silicon, `yarn run start-console`
If you are using podman on a Mac with Apple silicon, `pnpm run start-console`
might fail since it runs an amd64 image. You can work around the problem with
[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running
these commands:
Expand All @@ -54,8 +54,8 @@ systemctl reboot

In plugin directory, run

1. `yarn install`
2. `yarn run start`
1. `pnpm install`
2. `pnpm run start`

In your local `console/` directory

Expand Down Expand Up @@ -90,13 +90,13 @@ Unit tests use [Jest](https://jestjs.io/) with inline snapshots (`toMatchInlineS

```bash
# Run all tests
yarn test
pnpm test

# Run tests and update inline snapshots
yarn test:update
pnpm test:update

# Run tests with coverage report
yarn test:coverage
pnpm test:coverage
```

When a component's rendered output or a utility's return value changes, the inline snapshots will fail. Run `yarn test:update` to accept the new output — the diff will show exactly what changed.
When a component's rendered output or a utility's return value changes, the inline snapshots will fail. Run `pnpm test:update` to accept the new output — the diff will show exactly what changed.
62 changes: 40 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"description": "OpenShift Console plugin for GitOps.",
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@10.33.2",
"license": "Apache-2.0",
"scripts": {
"preinstall": "npx only-allow pnpm",
"http-server": "./http-server.sh ./dist",
"clean": "rm -rf dist",
"build": "yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack",
"build-dev": "yarn clean && yarn ts-node node_modules/.bin/webpack",
"start": "yarn ts-node node_modules/.bin/webpack serve",
"build": "pnpm clean && NODE_ENV=production pnpm ts-node node_modules/webpack-cli/bin/cli.js",
"build-dev": "pnpm clean && pnpm ts-node node_modules/webpack-cli/bin/cli.js",
"start": "pnpm ts-node node_modules/webpack-cli/bin/cli.js serve",
"start-console": "./start-console.sh",
"i18n": "i18next \"src/**/*.{js,jsx,ts,tsx}\" [-oc] -c i18next-parser.config.js",
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}'",
"lint": "eslint ./src --fix",
"test": "jest",
"test:update": "jest -u",
"test:update": "jest --updateSnapshot",
"test:coverage": "jest --coverage"
},
"devDependencies": {
Expand All @@ -28,13 +30,19 @@
"@patternfly/react-charts": "^8.4.0",
"@patternfly/react-core": "^6.4.0",
"@patternfly/react-data-view": "^6.4.0",
"@patternfly/react-component-groups": "^6.3.0",
"@patternfly/react-icons": "^6.4.0",
"@patternfly/react-styles": "^6.4.0",
"@patternfly/react-table": "^6.4.0",
"@patternfly/react-tokens": "6.4.0",
"@patternfly/react-topology": "^6.2.0",
"@svgr/webpack": "^8.1.0",
"@types/classnames": "^2.3.1",
"@jest/types": "^29.0.0",
"@types/jest": "^29.0.0",
"@types/dagre": "^0.7.53",
"@types/git-url-parse": "^9.0.0",
"@types/lodash": "^4.14.0",
"@types/node": "^17.0.21",
"@types/react": "17.0.91",
"@types/react-redux": "7.1.34",
Expand All @@ -61,44 +69,53 @@
"i18next-parser": "^3.3.0",
"lodash-es": "^4.17.23",
"marked": "15.0.12",
"mobx-react": "^7.6.0",
"prettier": "^2.6.0",
"prop-types": "15.8.x",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-i18next": "^11.7.3",
"react-router": "5.3.4",
"semver": "^7.0.0",
"sass": "^1.42.1",
"sass-loader": "^10.1.1",
"style-loader": "^2.0.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.7.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
"ts-jest": "^29.0.0",
"typesafe-actions": "^4.4.2",
"typescript": "5.9.3",
"webpack": "^5.1.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.9.3",
"jest": "^29.7.0",
"ts-jest": "^29.3.4",
"@types/jest": "^29.5.0",
"jest-environment-jsdom": "^29.7.0"
"webpack-dev-server": "^4.9.3"
},
"resolutions": {
"glob-parent": "^6.0.0",
"showdown": "^2.1.0",
"express": "4.22.1",
"@types/jest": "^29.5.0",
"hosted-git-info": "^3.0.8",
"jquery": "4.0.0",
"lodash-es": "^4.17.23",
"minimist": "1.2.8",
"ua-parser-js": "^0.7.24",
"jest": "^29.7.0",
"postcss": "^8.2.13"
"pnpm": {
"overrides": {
"glob-parent": "^5.1.2",
"showdown": "^2.1.0",
"express": "4.22.1",
"hosted-git-info": "^3.0.8",
"jquery": "3.7.1",
"lodash-es": "^4.17.23",
"minimist": "1.2.8",
"ua-parser-js": "^0.7.24",
"postcss": "^8.2.13"
}
},
"consolePlugin": {
"name": "gitops-plugin",
"version": "0.0.17",
"version": "0.0.16",
"displayName": "GitOps Plugin",
"description": "OpenShift Console plugin for GitOps.",
"exposedModules": {
"environments": "./components/ApplicationListPage",
"detailsPage": "./components/EnvironmentDetailsPageTabs",
"gitopsFlags": "./components/utils/flags",
"topology": "./components/topology"
},
"dependencies": {
"@console/pluginAPI": "*"
}
Expand All @@ -107,6 +124,7 @@
"classnames": "^2.3.2",
"dagre": "^0.8.5",
"git-url-parse": "^13.1.0",
"lodash": "^4.18.1",
"react": "17.0.2",
"react-helmet": "^6.1.0",
"react-redux": "7.2.9",
Expand Down
Loading
Loading