plugins/console/skills/upgrade-console-sdk/SKILL.md
Assists in the upgrade of an OpenShift Console dynamic plugin to the latest Console SDK version.
npx skillsauth add openshift-eng/ai-helpers upgrade-console-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a senior software engineer with expertise in TypeScript, React, and webpack module federation, particularly in the context of OpenShift Console dynamic plugins. Your task is to assist developers in upgrading their Console dynamic plugins to a newer Console SDK version.
# Upgrade a Console plugin from version 4.18 to 4.22
/console:upgrade-sdk 4.18 4.22
The current-target-version and new-target-version arguments are mandatory -- when not provided, use the AskUserQuestion tool to gather this information from the user.
OpenShift Console is the web-based UI for Red Hat OpenShift Container Platform. It provides cluster management, workload monitoring, and administrative capabilities. Console is built with React and TypeScript, and is designed as an extensible platform that allows dynamic plugins to add functionality without rebuilding or redeploying the console itself.
Dynamic plugins use webpack module federation to load plugin code over the network at runtime. This means:
ConsolePlugin custom resource.console-extensions.json or inline in webpack.config.ts) that hook into Console's extension points -- adding pages, navigation items, resource views, dashboard cards, actions, and more.$codeRef entries that point to exposed webpack modules, which are loaded on demand.There are two distributable SDK packages plugins depend on:
| Package | Purpose |
|---------|---------|
| @openshift-console/dynamic-plugin-sdk | Core runtime APIs, types, hooks, and components used by plugins at runtime |
| @openshift-console/dynamic-plugin-sdk-webpack | Webpack ConsoleRemotePlugin that generates plugin manifests, configures module federation, and manages shared modules |
There is also @openshift-console/dynamic-plugin-sdk-internal which exposes additional Console code but has no backwards compatibility guarantees.
SDK packages follow a semver scheme where the major and minor version indicates the earliest supported OCP Console version, and the patch version indicates the release of that particular package. For example, 4.22.0 is the initial release targeting Console 4.22. Pre-release versions use the format 4.22.0-prerelease.1.
Console provides specific modules (e.g., React, Redux, routing libraries) to plugins at runtime via webpack's share scope. Plugins should list these as devDependencies (not dependencies) since Console supplies them. The exact list and versions change between Console releases -- when Console upgrades a shared module (e.g., React 17 to 18), all plugins must also upgrade to the matching version, since only one version of each singleton module can be loaded at runtime.
Always fetch the SDK README at runtime to get the current shared modules list.
Plugin metadata (consolePlugin object) can be specified in package.json or passed directly to ConsoleRemotePlugin in webpack.config.ts. Key fields:
name -- unique plugin identifier, must match the ConsolePlugin resource name on the cluster (must be a valid DNS subdomain name)version -- semver version of the pluginexposedModules -- map of module names to file paths that can be referenced via $codeRefdependencies -- @console/pluginAPI semver range declaring which Console versions the plugin supports (e.g., "^4.21.0")The following remote sources are the single source of truth for upgrade information. You MUST fetch and read these at runtime -- do NOT rely on memorized or cached data about version-specific changes. If a fetch fails (e.g., a release notes file doesn't exist yet for a pre-release version, or a rate limit is hit), inform the user and proceed with the data you have.
Fetch this file to determine shared modules, SDK version mapping, and PatternFly version compatibility:
https://raw.githubusercontent.com/openshift/console/refs/heads/main/frontend/packages/console-dynamic-plugin-sdk/README.md
Fetch both of these to identify breaking changes, type changes, deprecations, and new features across versions:
https://raw.githubusercontent.com/openshift/console/refs/heads/main/frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.mdhttps://raw.githubusercontent.com/openshift/console/refs/heads/main/frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-webpack.mdFetch the release notes for EACH version in the upgrade range (from one version above the current through the target). Release notes document shared module changes, CSS removals, migration guides, and upgrade tips.
Available release notes versions:
!gh api repos/openshift/console/contents/frontend/packages/console-dynamic-plugin-sdk/release-notes --jq .[].name
Fetch each relevant version using this URL pattern:
https://raw.githubusercontent.com/openshift/console/refs/heads/main/frontend/packages/console-dynamic-plugin-sdk/release-notes/<version>
The console-plugin-template is the canonical reference for a Console dynamic plugin. Fetch its package.json, tsconfig.json, and webpack.config.ts for correct dependency versions, build configuration, and compiler options:
https://raw.githubusercontent.com/openshift/console-plugin-template/refs/heads/main/package.jsonhttps://raw.githubusercontent.com/openshift/console-plugin-template/refs/heads/main/tsconfig.jsonhttps://raw.githubusercontent.com/openshift/console-plugin-template/refs/heads/main/webpack.config.tsKey patterns to note from the template:
4.21-latest rather than exact versions. Check what dist-tag is current for the target version.consolePlugin.dependencies field uses a semver range like "@console/pluginAPI": "^4.21.0" to declare Console version compatibility.Follow these steps in order:
package.json to understand current SDK versions, shared module versions, and PatternFly versions.webpack.config.ts (or .js) to understand the build setup.tsconfig.json to check compiler options.console-extensions.json if it exists, to understand extension types in use.Determine which package manager the plugin uses by checking these indicators in order:
packageManager field in package.json -- e.g., "packageManager": "[email protected]" means Yarn Berry (v4). This is the most reliable signal.yarn.lock -- Yarn (check format to distinguish v1 from Berry)package-lock.json -- npmpnpm-lock.yaml -- pnpm.yarnrc.yml file exists -- indicates Yarn Berry (v2 to v5). Yarn v1 uses .yarnrc (no .yml).Use the detected package manager for ALL dependency operations throughout the upgrade:
| Package Manager | Install | Add/upgrade a dep |
|-----------------|---------|-------------------|
| npm | npm install | npm install <pkg>@<version> |
| Yarn Classic (v1) | yarn install | yarn upgrade <pkg>@<version> |
| Yarn Berry (v2, v3, v4, v5) | yarn install | yarn up <pkg>@<version> |
| pnpm | pnpm install | pnpm update <pkg>@<version> |
react.dev/blog/2022/03/08/react-18-upgrade-guide for React 18):
https://raw.githubusercontent.com/facebook/react/refs/heads/main/CHANGELOG.mdhttps://raw.githubusercontent.com/i18next/react-i18next/refs/heads/master/CHANGELOG.mdgh api repos/reduxjs/react-redux/releases/tags/v9.0.0 --jq .body)patternfly-org repo (raw markdown, easier to parse than the website):
https://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content/releases/upgrade-guide.mdhttps://raw.githubusercontent.com/patternfly/patternfly-org/refs/heads/main/packages/documentation-site/patternfly-docs/content/releases/release-highlights.mdPresent a clear, versioned upgrade plan to the user that includes:
package.json dependency changes neededreact, react-i18next, react-redux, redux, redux-thunk, etc. Use the plugin template and release notes as the source of truth for correct versions.After the user approves the plan, make the changes:
package.json SDK and shared module versionstsconfig.json if needed (e.g., jsx compiler option)webpack.config.ts if neededconsole-extensions.json if extension types changed@console/pluginAPI semver range in plugin metadata (consolePlugin.dependencies) to match the new target version.devDependencies (not dependencies) in the plugin's package.json, since Console provides them at runtime.@types/react must also be updated to match. Major @types/react versions introduce their own breaking changes (e.g., v18 removed implicit children from React.FC). Check the plugin template for the correct @types/react version.@openshift-console/dynamic-plugin-sdk-internal, warn that this package has no backwards compatibility guarantees.research
Shared engine for analyzing Jira issue activity and generating status summaries
testing
Snapshot OpenShift payload data (release controller, PR diffs, comments, CI jobs, JUnit results, regression tracking) to a local directory for offline analysis
development
Analyze a payload snapshot to identify root causes of blocking job failures, score candidate PRs, and produce an HTML report with revert recommendations
tools
Create TRT JIRA bugs, open revert PRs, and trigger payload jobs for high-confidence revert candidates