Skip to content

PMM-15216: install pnpm in rpmbuild images for UI feature builds - #5654

Draft
fabio-silva wants to merge 12 commits into
PMM-15216from
cursor/pnpm-rpmbuild-fix-61cd
Draft

PMM-15216: install pnpm in rpmbuild images for UI feature builds#5654
fabio-silva wants to merge 12 commits into
PMM-15216from
cursor/pnpm-rpmbuild-fix-61cd

Conversation

@fabio-silva

@fabio-silva fabio-silva commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Ticket number: PMM-15216

Feature build: Percona-Lab/pmm-submodules#4474

Summary

Jenkins feature builds for the SEP frontend integration fail with pnpm: No such file or directory because public.ecr.aws/e7j3v3n0/rpmbuild:3 ships nodejs + yarn only.

This PR:

  1. Installs pnpm@11.1.3 (matches ui/package.json packageManager) in build/docker/rpmbuild/Dockerfile.{el8,el9,hetzner-el9}
  2. Hardens ui/Makefile setup: keep corepack enable, then fall back to sudo npm install -g pnpm@11.1.3 so FBs work before rpmbuild:3 is republished

Superseded: the same fix was pushed to PMM-15216 (03d5f0212), and that branch has since been updated with main (c2c84db17). This PR is empty/redundant vs its base; safe to close.

Related: Percona-Lab/pmm-submodules#4474, percona/pmm#5653

Open in Web Open in Cursor 

Ignacio Durand and others added 12 commits July 13, 2026 20:53
…ase 0)

Phase 0 of the SEP→PMM frontend migration (MERGE-PLAN-V2). React stays 18;
no app behavior change. Verified: pnpm install, turbo build/test/lint/
format:check/check-types all green (tests 44 files / 267 = pre-migration baseline).

Package manager: yarn 1 → pnpm 11 (corepack)
- pnpm-workspace.yaml (apps/*, packages/*, packages/plugins/*); resolutions →
  overrides; internal deps "*" → workspace:*.
- blockExoticSubdeps:false (@grafana/ui pulls react-data-grid via git);
  allowBuilds for @swc/core, esbuild, protobufjs.
- Pin @mui/* core to 7.3.7 (float to 7.3.11 breaks @mui/x-date-pickers
  deep-import of @mui/utils/generateUtilityClass).
- Declare previously-phantom deps in apps/pmm: material-react-table, react-router.
- Update Makefile, Makefile.devcontainer, .devcontainer/setup.py, ui.yml CI to pnpm.

Lint/format: eslint 8 + prettier → oxlint / oxfmt
- oxfmt config mirrors @percona/prettier-config (es5 / width 80); oxlintrc rules
  kept lenient (no-console/no-duplicate-imports/curly/eqeqeq → warn) so existing
  PMM code lints with 0 errors and minimal source churn.
- Remove eslint/prettier deps + configs; drop eslint-webpack-plugin from
  pmm-compat webpack config. Exclude grafana-scaffolded **/.config/** from oxfmt.

Fixes for pnpm's stricter resolution:
- vitest.config.ts: drop hardcoded react node_modules path aliases (yarn-link
  hack that split React from react-dom under pnpm); rely on resolve.dedupe +
  inline react-dom/@testing-library/react/@percona/percona-ui.
- SyntaxHighlighter.tsx: @ts-expect-error@ts-ignore (TS2578 under pnpm).
- pmm-compat tsconfig ts-node moduleResolution fix for webpack config load.

pmm-compat stays React 18 / webpack / grafana tooling (isolated).
…ase 1)

Version alignment (MERGE-PLAN-V2 Phase 1). apps/pmm + packages/shared move to the
SEP-target stack; pmm-compat stays React 18 (Grafana plugin, isolated). All gates
green: build, unit tests (44 files / 267 = pre-migration baseline), lint, format,
check-types.

apps/pmm: react/react-dom 18→19.1, react-is 19, @types/react* 19,
@testing-library/react 15→16, react-router(-dom) 6.30→7.14, vite 5→8, vitest 2→4,
typescript 5.8→6, jsdom 24→29, and Vite-8-compatible plugin bumps
(plugin-react-swc 4, plugin-basic-ssl 2, vite-tsconfig-paths 6, vite-plugin-svgr 5).
Root typescript → 6.

Two-React-versions handling:
- packages/shared imports no React; peer widened to ^18 || ^19.
- pmm-compat pins its own react + @types/react 18. @grafana/* declare no
  @types/react peer, so pnpm packageExtensions add it, tying it to pmm-compat's 18
  (else their .d.ts resolve apps/pmm's hoisted @types/react 19 → TS2786).
- Dropped the react-router / @remix-run/router override pins.

Source fixes for the new stack:
- React 19 types: useRef<T>() needs an initial arg; RefObject<T> → RefObject<T|null>.
- RR7 is ESM-only: useKioskMode.test uses vi.mock instead of default-import + spyOn.
- TS6: keep baseUrl via ignoreDeprecations "6.0"; global → globalThis; declare
  module '@fontsource/*' for the untyped side-effect font import.
- Vitest 4: give the real-time default-timeout test explicit headroom (it(..., 7000)).
…ion Phase 2)

Migrate SEP's shared packages into pmm/ui/packages/sep/ (names unchanged), on the
Phase 1 stack (React 19 / Vitest 4 / TS 6 / msw 2). All gates green: check-types,
build, lint, format, and unit tests — @sep/api 6 files/69, @sep/framework 46
files/550 (the material-react-table 1.15.1 + MUI 7 + React 19 smoke test), apps/pmm
44/267 = baseline.

Packages: under packages/sep/ (grouped subdir; packages/shared is already
@pmm/shared). Workspace glob packages/sep/* added. New ui/tsconfig.base.json
(target ES2022 + lib ES2023 — SEP uses Array.at()).

@sep/framework:
- Storybook stripped (deferred to Phase 4): .storybook/, *.stories.tsx, storybook
  deps/scripts, tsconfig include.
- material-react-table pinned as a direct dep ^1.15.1 (framework's own copy;
  apps/pmm keeps 3.x). Peers needed at test time added as devDeps.
- vitest.config: @vitejs/plugin-react → -swc; dropped hard react path aliases for
  resolve.dedupe + server.deps.inline (pnpm React-dup fix).
- percona-ui 1.0.22 API drift (SEP built against 1.0.16): AutoCompleteInput
  controllerProps now omits `name` — removed the redundant `name` in
  Host/Schema/Service/Table selectors (still passed as a direct prop).

apps/pmm:
- @tanstack/react-query → ^5.100.7 (shared query context with the framework).
- Dev proxy: SEP paths (/api, /sep_app, /stream-logs, /execution-events, /files)
  → SEP_BACKEND_URL (default http://localhost:8000). Interim auth (Option D):
  inject SEP_INTERNAL_TOKEN server-side as a Bearer header when set.
…ion Phase 3)

Mount the first two SEP apps as native PMM routes. Gates green: build,
check-types (6/6), lint, format, unit tests (snippets 3 files/31, framework
46/550, api 6/69, apps/pmm 44/267), and a Vite-8 dev-server smoke (index + full
main.tsx module graph + SnippetsPlugin transform all 200, no errors).

- @sep/plugins-snippets → packages/plugins/snippets (swc vitest, dedupe+inline,
  test-time peer devDeps, oxlint/oxfmt).
- Router under MainWithNav: sep/snippets/* → <SnippetsPlugin isAdmin/>,
  sep/mysql-backups/* → <SchemaDrivenPlugin pluginName="mysql_backups"/>. Splat
  paths (both plugins compose their own <Routes>).
- Nav: addSepApps() builder (Snippets/CodeIcon, MySQL Backups/MySqlIcon) wired
  into navTree when a session exists; rendered as client-side react-router links.
- Interim auth (Option D): src/sep/bootstrap.ts initSepAuth() stubs
  setTokenProvider(()=>null) + no-op setOnUnauthorized, called from main.tsx.
- apps/pmm depends on @sep/{api,framework,plugins-snippets}; MRT 1.15.1
  (framework) and 3.x (apps/pmm) coexist in the build.

Pending (need running stack / decisions): live "data loads from SEP backend"
gate (SEP_BACKEND_URL, open decision #3) and e2e specs (open decision #2 —
PMM has no in-repo Playwright).
Ports feature/bugfix changes made in SEP after the migration snapshot
(base ~ SEP c65a3e26^), translated onto PMM's Plugin* naming. The SEP
Plugin->App rename churn is intentionally not carried over.

- SEP-1455: snippets Manager filters (search / approval / service type),
  service_type field on SnippetResponse, Service column, empty state,
  batch-select scoped to the filtered rows.
- SEP-1397: "Executor Host" -> "Execution Host" default label; Logs tab
  relabelled "Execution History" (route /logs unchanged).
- SEP-1496: expose separately-registered apps as sibling tabs via a new
  related_apps schema field (RelatedApp type + RelatedAppTabBar); fixes
  the MySQL Backups Restore section being unreachable in the migrated UI.
- SEP-1398: surface post-create connectivity warnings on the task detail
  page with a run-script log link, threaded from the create response via
  navigation state.

Also included: SepPage container wrapper for the mounted SEP routes
(Page + Stack chrome) and the SchemaFormRenderer form maxWidth tweak
(640 -> 800).

Gates green: check-types, lint, format, and unit tests across
snippets (40), framework (568), api (69), and apps/pmm (267).
Replace Page's inline width Stack with the shared PageContainer component.
Add a maxWidth prop (number | 'full', default 1000) to Page; keep fullWidth
as a deprecated alias mapping to maxWidth='full'. SepPage now requests full
width explicitly; Settings pins maxWidth={1000}.
SEP-1555 (SnippetExecutionAccordion): stop stripping the read-only
`script_preview` field so the backend's "Script preview" collapsible
renders its content instead of an empty body; add regression test.

SEP-1556: drop MUI Button `color` props (warning/success/error/primary)
in favor of `variant` only across the migrated snippets + schema-driven
components (SnippetsListPage, ScheduledTaskRow, PluginDetailPage,
DeleteConfirmDialog, SchemaFormRenderer, TaskHistoryTable).

Preserves the PMM-specific SchemaFormRenderer maxWidth mod.
Gates green: framework 569 tests, snippets 40, both typecheck + lint clean.
Move the addSepApps() nav push out of the early user-only block into the
settings-gated user.isPMMAdmin block, alongside inventory/backups, so the
SEP apps only surface for admins once settings have loaded.
SchemaDrivenPlugin navigates with an absolute routeBase (detail back/edit/
schedule links and the related-app tab bar). Without the prop it defaulted
to the SEP path /apps/mysql_backups, which has no route under PMM's /pmm-ui
basename — clicking the Restore tab (and detail nav) hit the catch-all
NotFound. Pin routeBase to the actual mount /sep/mysql-backups.
Build image ships nodejs but not pnpm, breaking 'make release' in
pmm-managed.spec %build. Enable pnpm through corepack (pins pnpm@11.1.3
from package.json) in the setup target. Also switch format-check from
stale 'yarn format:check' to pnpm.
Feature builds fail with `pnpm: No such file or directory` because
public.ecr.aws/e7j3v3n0/rpmbuild:3 ships nodejs+yarn only. Install
pnpm@11.1.3 in the rpmbuild Dockerfiles, and add an npm global
fallback in ui/Makefile so FBs work before the image is republished.

Co-authored-by: Fábio Silva <fabio-silva@users.noreply.github.com>
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (PMM-15216@a2453ce). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff              @@
##             PMM-15216    #5654   +/-   ##
============================================
  Coverage             ?   44.10%           
============================================
  Files                ?      416           
  Lines                ?    43067           
  Branches             ?        0           
============================================
  Hits                 ?    18996           
  Misses               ?    22192           
  Partials             ?     1879           
Flag Coverage Δ
admin 34.78% <ø> (?)
agent 50.27% <ø> (?)
managed 43.27% <ø> (?)
vmproxy 72.22% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nachodd
nachodd force-pushed the PMM-15216 branch 2 times, most recently from c49953f to 3324c95 Compare August 3, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants