Skip to content

Migrate the ascender_devel image and awx/ui build to pnpm - #658

Draft
clo-ciq wants to merge 1 commit into
mainfrom
pnpm-migration-ui
Draft

Migrate the ascender_devel image and awx/ui build to pnpm#658
clo-ciq wants to merge 1 commit into
mainfrom
pnpm-migration-ui

Conversation

@clo-ciq

@clo-ciq clo-ciq commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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.yml never calls npm/pnpm directly — the ui-lint/ui-test-screens/ui-test-general jobs run make docker-runner, which mounts the repo into the ascender_devel image and runs make ui-lint etc. inside the container. So the actual fix lives in the Makefile and in tools/ansible/roles/dockerfile/templates/Dockerfile.j2 (which generates the Dockerfile used to build that image), not in the workflow YAML itself. There is no actions/setup-node/pnpm/action-setup to add, since Node is installed via a dnf module stream inside the Dockerfile, not via a GitHub Action.

  • awx/ui/package.json: pin packageManager: pnpm@11.21.0 (with corepack-verified hash).
  • Lockfile converted with pnpm import (not a fresh install), so resolved dependency versions are unchanged. package-lock.json removed.
  • Three phantom dependencies fixed: @lingui/core, @patternfly/react-styles, and eslint-plugin-import-x were used directly in source/config but only ever present as transitive deps of @lingui/react, @patternfly/react-core, and eslint-config-airbnb-extended respectively. npm's flat/hoisted node_modules silently allowed this; pnpm's strict, symlinked layout does not, so eslint and ~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; every ui-* target (ui-lint, ui-test, ui-test-screens, ui-test-general, ui-devel, pot, po, etc.) now calls pnpm.
  • tools/ansible/roles/dockerfile/templates/Dockerfile.j2: the dnf module enable nodejs:22 stream does not bundle corepack (verified by installing it fresh in a throwaway rockylinux/rockylinux:9 container), so corepack is now bootstrapped explicitly (npm install -g corepack@0.35.0 && corepack enable) in both the builder stage and the ascender_devel dev-image stage — the two places this template installs Node.
  • awx/ui/Dockerfile: updated to use pnpm-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 (it ADDs .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 full docker build for that reason.
  • docs/development/docker.md, .github/copilot-instructions.md: updated stale npm references.
  • No pnpm-workspace.yaml/allowBuilds added: pnpm blocks postinstall scripts for esbuild, core-js, core-js-pure, and unrs-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.0 engines constraint and the nodejs:22 module stream CI uses):

  • pnpm install --frozen-lockfile succeeds cleanly, no ignored-builds warning
  • pnpm run lint (eslint) passes
  • pnpm run prettier-check passes
  • pnpm run pretest && pnpm run test-screens --runInBand — 376/376 suites, 1918/1918 tests
  • pnpm run pretest && pnpm run test-general --runInBand — 176/176 suites, 1009/1009 tests
  • pnpm run build (production webpack build) compiles successfully
  • CI green on the ui-lint/ui-test-screens/ui-test-general matrix jobs in ci.yml (depends on the ascender_devel image rebuild picking up the corepack change)

Note: pnpm peers check surfaces a pre-existing unmet-peer warning (@babel/core@^8.0.1 vs. 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

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
Copilot AI lite review requested due to automatic review settings August 13, 2026 18:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_devel build stages so the pnpm version pinned in awx/ui/package.json can be used reliably.
  • Update all ui-* Makefile targets to use pnpm (including install --frozen-lockfile) instead of npm.
  • Add packageManager and 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.

Comment thread awx/ui/Dockerfile
ADD public public
ADD package.json package.json
ADD package-lock.json package-lock.json
ADD pnpm-lock.yaml pnpm-lock.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants