Migrate the ascender_devel image and awx/ui build to pnpm - #658
Draft
clo-ciq wants to merge 1 commit into
Draft
Conversation
Converts awx/ui from npm to pnpm, matching the org-wide pnpm migration (Jira SRE-1792 / SRE-2288). Unlike a typical GH-Actions-runner Node setup, this repo's UI checks (ui-lint, ui-test-screens, ui-test-general) run inside the ascender_devel Docker image via `make docker-runner`, so the fix lives in the Makefile and in the Dockerfile.j2 template that builds that image, not in ci.yml itself (which never invokes npm/pnpm directly). - awx/ui/package.json: add packageManager pin; promote three phantom dependencies (@lingui/core, @patternfly/react-styles, eslint-plugin-import-x) from transitive-only to direct — pnpm's strict node_modules layout does not hoist them the way npm did, and eslint/tests failed to resolve them without this. - Lockfile converted with `pnpm import` (not a fresh install) so resolved versions are unchanged; package-lock.json removed. - Makefile: NPM_BIN -> PNPM_BIN, all ui-* targets now call pnpm. - tools/ansible/roles/dockerfile/templates/Dockerfile.j2: the dnf-installed nodejs:22 module stream doesn't bundle corepack, so bootstrap it explicitly in both the builder stage and the ascender_devel dev image. - awx/ui/Dockerfile: updated for consistency (uses pnpm-lock.yaml + corepack) but this file is unreferenced by any workflow or docker-compose config and was already broken independent of this change (stale ADDs for .eslintignore/.eslintrc.json/.linguirc removed in #391) — not verified with a full docker build. - docs/development/docker.md, .github/copilot-instructions.md: updated stale npm references. No pnpm-workspace.yaml/allowBuilds needed: verified the ignored postinstall scripts (esbuild, core-js, core-js-pure, unrs-resolver) don't affect lint/test/build in practice. Verified locally: pnpm install --frozen-lockfile clean (no ignored-builds warning), pnpm run lint + prettier-check clean, pnpm run test-screens (376/376 suites) and test-general (176/176 suites) green, production build (pnpm run build) compiles successfully. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EazRi5J66CRzQyVBevEfrW
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates Ascender’s UI build/test tooling (primarily executed inside the ascender_devel image via make targets) from npm to pnpm by bootstrapping Corepack in the image build, switching Makefile UI targets to pnpm, and aligning documentation and UI metadata.
Changes:
- Bootstrap Corepack in
ascender_develbuild stages so the pnpm version pinned inawx/ui/package.jsoncan be used reliably. - Update all
ui-*Makefile targets to use pnpm (includinginstall --frozen-lockfile) instead of npm. - Add
packageManagerand promote a few previously-transitive UI dependencies to direct dependencies; update docs and Copilot instructions to reference pnpm.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/ansible/roles/dockerfile/templates/Dockerfile.j2 |
Installs/enables Corepack (for pnpm shims) in builder/dev stages where Node is present. |
Makefile |
Replaces npm usage in UI targets with pnpm and standardizes on frozen-lockfile installs. |
docs/development/docker.md |
Updates contributor setup instructions from npm to pnpm/Corepack, plus wording cleanups. |
awx/ui/package.json |
Pins pnpm via packageManager and adds required direct dependencies for pnpm’s stricter resolution. |
awx/ui/Dockerfile |
Switches from package-lock.json/npm to pnpm-lock.yaml + Corepack/pnpm. |
.github/copilot-instructions.md |
Updates repository tooling description to indicate pnpm for the UI. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ADD public public | ||
| ADD package.json package.json | ||
| ADD package-lock.json package-lock.json | ||
| ADD pnpm-lock.yaml pnpm-lock.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of the org-wide npm/yarn -> pnpm migration tracked in Jira SRE-1792 (sub-task SRE-2288).
Unlike most repos in this migration,
ci.ymlnever calls npm/pnpm directly — theui-lint/ui-test-screens/ui-test-generaljobs runmake docker-runner, which mounts the repo into theascender_develimage and runsmake ui-lintetc. inside the container. So the actual fix lives in theMakefileand intools/ansible/roles/dockerfile/templates/Dockerfile.j2(which generates the Dockerfile used to build that image), not in the workflow YAML itself. There is noactions/setup-node/pnpm/action-setupto add, since Node is installed via adnfmodule stream inside the Dockerfile, not via a GitHub Action.awx/ui/package.json: pinpackageManager: pnpm@11.21.0(with corepack-verified hash).pnpm import(not a fresh install), so resolved dependency versions are unchanged.package-lock.jsonremoved.@lingui/core,@patternfly/react-styles, andeslint-plugin-import-xwere used directly in source/config but only ever present as transitive deps of@lingui/react,@patternfly/react-core, andeslint-config-airbnb-extendedrespectively. npm's flat/hoistednode_modulessilently allowed this; pnpm's strict, symlinked layout does not, soeslintand ~140 Jest suites failed to resolve these modules until they were promoted to direct dependencies (all three resolve to the exact same versions already in the lockfile — no version drift).Makefile:NPM_BIN->PNPM_BIN; everyui-*target (ui-lint,ui-test,ui-test-screens,ui-test-general,ui-devel,pot,po, etc.) now callspnpm.tools/ansible/roles/dockerfile/templates/Dockerfile.j2: thednf module enable nodejs:22stream does not bundle corepack (verified by installing it fresh in a throwawayrockylinux/rockylinux:9container), so corepack is now bootstrapped explicitly (npm install -g corepack@0.35.0 && corepack enable) in both the builder stage and theascender_develdev-image stage — the two places this template installs Node.awx/ui/Dockerfile: updated to usepnpm-lock.yaml+ corepack for consistency, but this Dockerfile is not referenced by any workflow or docker-compose config I could find, and was already broken independent of this change (itADDs.eslintignore/.eslintrc.json/.linguirc, which were removed in Modernize the frontend toolchain: Lingui 6, ESLint 9 and @dagrejs/dagre #391's ESLint-9/flat-config migration). Not verified with a fulldocker buildfor that reason.docs/development/docker.md,.github/copilot-instructions.md: updated stale npm references.pnpm-workspace.yaml/allowBuildsadded: pnpm blocks postinstall scripts foresbuild,core-js,core-js-pure, andunrs-resolver, but I verified none of them are actually needed (esbuild's binary and CLI both work fine as-is; lint/build/test all pass), so I didn't add the file speculatively.Test plan
All verified locally (Node v22.23.2, matching the
>=22.22.0engines constraint and thenodejs:22module stream CI uses):pnpm install --frozen-lockfilesucceeds cleanly, no ignored-builds warningpnpm run lint(eslint) passespnpm run prettier-checkpassespnpm run pretest && pnpm run test-screens --runInBand— 376/376 suites, 1918/1918 testspnpm run pretest && pnpm run test-general --runInBand— 176/176 suites, 1009/1009 testspnpm run build(production webpack build) compiles successfullyui-lint/ui-test-screens/ui-test-generalmatrix jobs inci.yml(depends on theascender_develimage rebuild picking up the corepack change)Note:
pnpm peers checksurfaces a pre-existing unmet-peer warning (@babel/core@^8.0.1vs. several plugins wanting^7.0.0) — unrelated to this migration, not blocking any of the above, left as-is.🤖 Generated with Claude Code
https://claude.ai/code/session_01EazRi5J66CRzQyVBevEfrW