Repository navigation
perf(ui): switch build to Rolldown — 10 min → 20 s - #32384
Conversation
Wall-clock production `yarn build` drops from ~628 s to ~20 s (28×
faster; 50× on the Vite phase alone) with all bundle-check budgets
green. Chunk count of 1237 emitted files sits above Rollup's post-
merge 671 because Rolldown emits at every dynamic-import boundary and
has no `experimentalMinChunkSize` merger; bootstrap brotli, largest
chunk, and top-N ratchets are unchanged.
Build config
- Swap `@vitejs/plugin-react` (Babel) → `@vitejs/plugin-react-swc`.
Cheap wall-time win on JSX transform; kept behind the same zero-arg
`react()` call site.
- Alias `vite` → `npm:rolldown-vite@latest` in package.json. Rust
Rollup replacement, ships per-platform NAPI bindings; parallelism
gives 249% CPU on multicore.
- Add explicit `esbuild` dev-dep — Rolldown deprecated
`transformWithEsbuild` but downstream plugins still call it; keep
the compat shim working until the ecosystem migrates to Oxc.
- Extract the vendor classifier to a shared `classifyChunk`, register
it under both `rollupOptions.output.manualChunks` (Rollup fallback)
and `advancedChunks.groups[].name` (Rolldown native). Both bundlers
land on the same vendor buckets.
- Remove the second `viteCompression` (brotli) pass; the deployed
servlet negotiates content-encoding at request time and the
bundle-check now brotli-compresses the ~8 bootstrap files in-memory
via `zlib.brotliCompressSync`, so the 950 KiB budget is still
enforced without paying to compress 1200 chunks in Rollup's
writeBundle.
- Bump ratchets in `scripts/check-bundle-chunks.mjs` from
720/540 → 1400/1250 to accept Rolldown's un-merged chunk count.
Bootstrap ratchet stays at 970 KiB brotli (current: 957 KiB).
Static assets
- Move `openmetadata-ui/src/main/resources/ui/src/jsons/connectionSchemas/`
(195 JSON files, 6.5 MB) to `public/jsons/connectionSchemas/`.
These are pure data — no reason for Rollup to walk them. Vite
copies them verbatim to `dist/`; the Java `AssetServlet` serves
them from the same root as `favicons/`, and `parseSchemas.js`
generates directly into the new location.
- Add `src/utils/loadConnectionSchema.ts` — bounded LRU-cached
`fetch()` loader that reads `${basePath}/jsons/connectionSchemas/...`
at runtime and dedupes concurrent callers via promise memoization.
Rewrite 11 service utils (Database, Storage, Drive, Dashboard,
MlModel, Messaging, Search, Pipeline, Security, API, Metadata) to
call `loadConnectionSchema()` instead of the old dynamic `import()`.
- Update 4 test files (Database/Search/Drive/MessagingServiceUtils
tests) to mock `loadConnectionSchema` instead of the removed JSON
module paths, and to import assertion fixtures from `public/`.
Template-literal `import()` chunk fragmentation
Three call sites globbed to hundreds of chunks because Vite must emit
one chunk per possible match of a template-literal `import()`:
- `ApplicationsClassBase.importAppLogo`: `import(`../../../../assets/svg/${appName}.svg`)`
matched every SVG in `assets/svg/` (799 files) despite only ~9
`*Application.svg` files being real logos. Replace with
`import.meta.glob('../../../../assets/svg/*Application.svg',
{ query: '?react' })`. Same lazy behaviour, chunk count drops from
~799 to 9.
- `useImage`: `import(`../assets/img/${fileName}.png`)` matched every
PNG in `assets/img/**` (~106) while the only two callers use
`useImage(`emojis/${reaction}`)`. Rewrite with
`import.meta.glob('../assets/img/emojis/*.png', { eager: true,
query: '?url', import: 'default' })` — Vite emits static asset URLs
with zero JS chunks and the hook returns synchronously.
- `ApplicationsClassBase.importAppScreenshot`: same treatment
(eager URL glob).
- `ApplicationsClassBase.importSchema`: narrowed to a typed
`import.meta.glob` so the emit graph is transparent to reviewers.
Numbers
| Metric | Rollup baseline | Rolldown + fixes |
|----------------------|----------------:|-----------------:|
| yarn build wall time | 628 s (10:28)| ~20 s |
| Vite `built in` | 614 s (10:14)| 12–14 s |
| Emitted JS chunks | 671 | 1237 |
| Bootstrap brotli | 959 KiB | 957 KiB |
| Largest chunk | 1.59 MB | 1.64 MB |
| CPU utilization | 91% (1 core)| 249% (2.5 cores)|
Notes for reviewers
- `[email protected]` is beta; occasional intermittent Less
plugin errors have been observed and clear on
`rm -rf node_modules/.vite` + rebuild. Track as a known issue.
- Removing Vite-time brotli means the deployed asset servlet's
`.br` fallback path never resolves and it falls back to `.gz`.
For raw servlet deployments this is a ~5-15% transfer regression on
modern browsers; behind a CDN/nginx with on-the-fly brotli, invisible.
Re-add later as a parallel post-step if pre-compressed brotli is
required for CI-published artifacts.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Too many files changed for review (225 files, 100 file limit). Bypass the limit by tagging |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| if (!loader) { | ||
| return {}; | ||
| } | ||
| const module = await loader(); |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the OpenMetadata UI production build pipeline to drastically reduce yarn build wall time by switching the bundler stack (Rollup/Babel → Rolldown/SWC), and by removing expensive build-time brotli generation. It also shrinks the bundler module graph by moving large connection-schema JSON assets under public/ and loading them at runtime via a cached fetch helper, plus narrowing several dynamic-import patterns to avoid chunk explosion.
Changes:
- Switch UI build tooling to
rolldown-viteand@vitejs/plugin-react-swc, and update bundle-budget enforcement to brotli-compress bootstrap files in-memory. - Move connection schemas into
public/jsons/connectionSchemas/and introduceloadConnectionSchema()to fetch + cache schemas at runtime; update service utils and tests accordingly. - Replace template-literal
import()patterns withimport.meta.glob(logos/screenshots/emojis/schemas) to avoid over-matching and excessive chunk emission.
Reviewed changes
Copilot reviewed 22 out of 218 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/utils/StorageServiceUtils.ts | Switch storage connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/SecurityServiceUtils.ts | Switch security connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/SearchServiceUtils.ts | Switch search connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/SearchServiceUtils.test.ts | Update tests to mock loadConnectionSchema() and use public/ fixtures. |
| openmetadata-ui/src/main/resources/ui/src/utils/PipelineServiceUtils.ts | Switch pipeline connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/MlmodelServiceUtils.ts | Switch ML model connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/MetadataServiceUtils.ts | Switch metadata service connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.ts | Switch messaging connection schema loading to runtime loadConnectionSchema() (+ type-only import). |
| openmetadata-ui/src/main/resources/ui/src/utils/MessagingServiceUtils.test.ts | Update tests to mock loadConnectionSchema() instead of virtual JSON modules. |
| openmetadata-ui/src/main/resources/ui/src/utils/loadConnectionSchema.ts | Add runtime fetch-based schema loader with bounded caching. |
| openmetadata-ui/src/main/resources/ui/src/utils/DriveServiceUtils.ts | Switch drive connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/DriveServiceUtils.test.ts | Update drive tests to mock loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/utils/DatabaseServiceUtils.test.tsx | Update database tests to mock loadConnectionSchema() and use public/ fixtures. |
| openmetadata-ui/src/main/resources/ui/src/utils/DashboardServiceUtils.ts | Switch dashboard connection schema loading to runtime loadConnectionSchema() (+ type-only import). |
| openmetadata-ui/src/main/resources/ui/src/utils/APIServiceUtils.ts | Switch API service connection schema loading to runtime loadConnectionSchema(). |
| openmetadata-ui/src/main/resources/ui/src/hooks/useImage.ts | Replace dynamic import with eager import.meta.glob URL map for emojis. |
| openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts | Narrow dynamic imports using import.meta.glob for logos/screenshots/schemas. |
| openmetadata-ui/src/main/resources/ui/scripts/check-bundle-chunks.mjs | Replace .br artifact dependency with in-memory brotli compression for bootstrap budgets; adjust ratchets. |
| openmetadata-ui/src/main/resources/ui/parseSchemas.js | Write connection schemas into public/ instead of src/ to keep them out of the bundler graph. |
| openmetadata-ui/src/main/resources/ui/package.json | Swap Vite to rolldown-vite alias; switch React plugin to SWC. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/storage/customStorageConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/security/rangerConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/security/ranger/basicAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/search/elasticSearch/basicAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/search/elasticSearch/apiAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/search/customSearchConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/stitchConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/splineConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/sparkConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/sapBw4HanaPipelineConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/prefect/serverAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/prefect/cloudAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/openlineage/kinesisBrokerConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/nifi/clientCertificateAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/nifi/basicAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/microsoftFabricPipelineConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/matillion/matillionETL.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/matillion/matillionDPC.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/kafkaConnectConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/domoPipelineConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/dbtCloudConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/dagsterConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/customPipelineConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/backendConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/airbyteConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/airbyte/oauthClientAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/pipeline/airbyte/basicAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/mlmodel/sklearnConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/mlmodel/mlflowConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/mlmodel/customMlModelConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/messaging/saslMechanismType.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/messaging/pulsarConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/messaging/customMessagingConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/vertexAIConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/openAIConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/ollamaConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/huggingFaceConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/customLLMConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/bedrockConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/azureOpenAIConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/llm/anthropicConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/ssasConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/serviceNowConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/sapHana/sapHanaSQLConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/sapHana/sapHanaHDBConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/epicConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/dremio/softwareAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/dremio/cloudAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/datalake/s3Config.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/datalake/azureConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/databricks/personalAccessToken.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/databricks/databricksOAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/databricks/azureAdSetup.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/customDatabaseConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/common/noConfigAuthenticationTypes.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/common/jwtAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/common/iamAuthConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/common/basicAuth.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/common/azureConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/cassandra/cloudConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/database/burstIQConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/dashboard/thoughtSpotConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/dashboard/powerbi/bucketDetails.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/dashboard/powerbi/azureConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/dashboard/hexConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/dashboard/grafanaConnection.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/common/sslConfig.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/common/sslCertValues.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/common/sslCertPaths.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/api/openAPISchemaURL.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/api/openAPISchemaS3.json | Connection schema JSON served as static asset under public/. |
| openmetadata-ui/src/main/resources/ui/public/jsons/connectionSchemas/connections/api/openAPISchemaFilePath.json | Connection schema JSON served as static asset under public/. |
Suppressed comments (2)
openmetadata-ui/src/main/resources/ui/src/utils/loadConnectionSchema.ts:72
- On cache hits, the entry ordering is not refreshed, so even with bounded size the cache behaves like FIFO rather than LRU. Refresh the Map insertion order when returning a cached promise.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts:116 importAppScreenshot()always resolves (returning{ default: null }when missing), but callers wrap it in try/catch expecting missing screenshots to reject so they can skip rendering. Throw on missing URLs to preserve the current caller contract.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (!loader) { | ||
| return {}; | ||
| } |
| const rememberSchema = ( | ||
| key: string, | ||
| value: Promise<ConnectionSchemaModule> | ||
| ) => { | ||
| if (schemaCache.size >= SCHEMA_CACHE_LIMIT) { | ||
| const oldest = schemaCache.keys().next().value; | ||
| if (oldest !== undefined) { | ||
| schemaCache.delete(oldest); | ||
| } | ||
| } | ||
| schemaCache.set(key, value); | ||
| }; |
| const fetchSchema = async ( | ||
| relativePath: string | ||
| ): Promise<ConnectionSchemaModule> => { | ||
| const url = `${getBasePath()}/jsons/connectionSchemas/${relativePath}`; | ||
| const response = await fetch(url, { | ||
| headers: { Accept: 'application/json' }, | ||
| }); |
| import type { | ||
| DashboardConnection} from '../generated/entity/services/dashboardService'; | ||
| import { | ||
| DashboardConnection, | ||
| DashboardServiceType, | ||
| } from '../generated/entity/services/dashboardService'; |
| import type { | ||
| MessagingConnection} from '../generated/entity/services/messagingService'; | ||
| import { | ||
| MessagingConnection, | ||
| MessagingServiceType, | ||
| } from '../generated/entity/services/messagingService'; |
✅ Playwright Results — workflow succeededValidated commit ✅ 578 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 53m 30s ⏱️ Max setup 5m 7s · max shard execution 18m 6s · max shard-job elapsed before upload 22m 10s · reporting 5s 🌐 244.68 requests/attempt · 2.81 app boots/UI scenario · 2.58% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Address four CI failures on top of the Rolldown migration:
**esbuild missing on CI** (playwright__build, maven-collate-ci)
Rolldown's `transformWithEsbuild` compat shim needs esbuild resolvable
from `node_modules/vite/`. The previous commit declared `esbuild` only
in `resolutions` (version pin), which yarn 1 does not treat as a
dependency, so nothing installed it on frozen-lockfile CI runs. Add
`esbuild: ^0.28.1` to `devDependencies` and record it in the lockfile.
**Jest cannot parse `import.meta.glob`** (ui-coverage-tests: 23 test
suites failed, cascading to ui-coverage + ui-sonar-gate)
`import.meta.glob(...)` is a Vite-only syntax extension; ts-jest fails
at parse time with `SyntaxError: Cannot use 'import.meta' outside a
module`, taking down every downstream test that transitively imports
the affected file.
Move each `import.meta.glob(...)` call out of the module that consumes
it into a sibling `*.assets.ts` file:
- `src/hooks/useImage.assets.ts` — the emoji-URL map
- `src/components/Settings/Applications/AppDetails/ApplicationsClassBase.assets.ts`
— the three app-logo / screenshot-URL / application-schema maps
Add a `moduleNameMapper` entry in `jest.config.js` that redirects any
`*.assets` import to `src/test/unit/mocks/glob.mock.js`, a Proxy that
returns `{}` for every named export. Consumers hit their existing
empty-map fallback branches — `if (!loader) return DefaultAppLogo`,
`url ?? null` — without any real asset resolution happening in tests.
Runtime behaviour is unchanged; Vite builds still see the globs
directly through the wrapper file.
**Formatting** (ui-checkstyle: 14 files)
Run the exact CI sequence — `organize-imports-cli` → `eslint --fix` →
`prettier --write` — against the changed files. Three service utils
(Dashboard/Messaging/Pipeline) needed prettier reformats; the rest
were already clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
CI status updateTwo follow-up commits landed:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 222 changed files in this pull request and generated 2 comments.
Suppressed comments (2)
openmetadata-ui/src/main/resources/ui/package.json:282
- The Vite alias uses
rolldown-vite@latest, which makes builds non-reproducible and can break CI whenever a newlatestis published. Since yarn.lock already resolves this to 7.3.1, pin package.json to that version (or another explicitly chosen version) to keep installs deterministic.
"vite": "npm:rolldown-vite@latest",
openmetadata-ui/src/main/resources/ui/src/utils/loadConnectionSchema.ts:72
- The cache eviction logic is FIFO (insertion-order) rather than LRU: cache hits return the stored promise but do not update recency, so frequently-used schemas can still be evicted before rarely-used ones. If the intent is an LRU cache (as described in the PR), refresh the entry on read by moving it to the end of the Map.
| public async importAppScreenshot(screenshotName: string) { | ||
| const key = `../../../../assets/img/appScreenshots/${screenshotName}.png`; | ||
| const url = appScreenshotUrls[key]; | ||
|
|
||
| return { default: url ?? null }; | ||
| } |
**Test failures (ui-coverage-tests, cascade to ui-coverage + ui-sonar-gate)**
Three suites still failed after the previous fix — `ApplicationsClassBase.test`
expected the real on-disk schema (my glob mock returned `{}`), and two schema-
render suites hit `ReferenceError: fetch is not defined` from the new
`loadConnectionSchema()` call inside jsdom. Fix each:
- `glob.mock.js`: keep the empty-map behaviour for `appLogoLoaders`,
`appScreenshotUrls`, `emojiUrls`, but back `applicationSchemaLoaders` with a
`Proxy` that reads matching JSON from `src/jsons/applicationSchemas/` via
`require()` on demand. Real payloads flow through, tests that assert on
schema fields (e.g. `RdfIndexApp`) pass again.
- Add `src/test/unit/mocks/loadConnectionSchema.mock.js`: a synchronous
`require()`-backed shim that loads schemas from `public/jsons/...` and
wraps them in `Promise.resolve`. jest.config.js `moduleNameMapper`
(`/loadConnectionSchema$`) redirects every call site to it, so the four
service-util tests that already `jest.mock('./loadConnectionSchema', ...)`
keep their custom factories (jest.mock wins over moduleNameMapper), and
every other consumer gets real schemas without needing a mock.
- `eslint.config.mjs`: scope the existing `no-require-imports: off` rule to
`src/test/unit/mocks/**` so the two new mocks pass lint.
Confirmed locally: `yarn test` on the previously-failing files now reports
7/7 suites, 64/64 passing.
**ui-checkstyle (14 files)**
Re-ran `yarn ui-checkstyle:changed` — the CI script. It applied
organize-imports + prettier + license-header + i18n + app-docs and reformatted
several files my earlier manual pass had missed. Committed the result.
**Review comments from @copilot-pull-request-reviewer and @gitar-bot**
- **package.json**: pin `vite` alias to `npm:[email protected]` instead of
`@latest` so lockfile regens can't silently upgrade.
- **ApplicationsClassBase.assets.ts**: drop the `?react` query on the app-logo
glob. The repo's `src/@types/svg.d.ts` declares plain `import '*.svg'`
returns `{ ReactComponent, default: <url> }`; keeping that convention here
means the loader's returned module shape matches every other SVG import
site.
- **ApplicationsClassBase.ts**: `importSchema()` and `importAppScreenshot()`
used to reject when the target didn't exist. Callers (`AppDetails.component`
and `MarketPlaceAppDetails`) rely on `try/catch` to surface a toast /
drop the empty screenshot slot. Preserve the rejection semantics — throw
instead of returning `{}` or `{default: null}`.
- **loadConnectionSchema.ts**: add `assertSafeRelativePath()` — reject
leading `/`, `\`, `..`, or `\0` before concatenating into the fetch URL, so
a future dynamic caller can't probe arbitrary paths on the origin.
- **loadConnectionSchema.ts**: the cache was described as LRU but only
evicted the first-inserted key. Introduce `touchLRU()` that
`delete`-then-`set`s on every access, so Map iteration order truly
reflects LRU semantics and evicting from the head drops the least-
recently-used entry.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 224 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
openmetadata-ui/src/main/resources/ui/src/hooks/useImage.ts:29
error: null as Error | nullis a type assertion that can be avoided while still keeping the hook’s public return type stable. Prefer an explicit return type (or a result type alias) and returnerror: nulldirectly.
openmetadata-ui/src/main/resources/ui/src/utils/loadConnectionSchema.ts:51
- The path validation can be bypassed by percent-encoded traversal sequences (e.g.
%2e%2e/) because it only checks the raw string for... Since this helper is explicitly meant as a defense-in-depth guard, it should decode + normalize the path, reject./..segments, and also block?/#injection to ensure the fetch URL cannot be rewritten.
| const cache = new Map(); | ||
|
|
||
| const loadConnectionSchema = (relativePath) => { | ||
| if (cache.has(relativePath)) { | ||
| return cache.get(relativePath); | ||
| } | ||
| const fullPath = path.resolve(CONNECTION_SCHEMA_DIR, relativePath); | ||
| let pending; | ||
| try { | ||
| // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
| const data = require(fullPath); | ||
| pending = Promise.resolve(data); | ||
| } catch (error) { | ||
| pending = Promise.reject( | ||
| new Error(`Failed to load connection schema ${relativePath}: ${error.message}`) | ||
| ); | ||
| } | ||
| cache.set(relativePath, pending); | ||
|
|
||
| return pending; | ||
| }; |
There was a problem hiding this comment.
🔵 Needs a closer look
The new loadConnectionSchema path-sanitization guard should be hardened against percent-encoded traversal to fully meet the intended defense-in-depth security goal.
Review details
Suppressed comments (1)
openmetadata-ui/src/main/resources/ui/src/utils/loadConnectionSchema.ts:56
assertSafeRelativePathblocks obvious..traversal, but it can still be bypassed with percent-encoded segments (e.g.%2e%2e%2f) and it doesn’t reject backslashes within the path. Since this value is concatenated into a fetch URL, it’s worth hardening the guard to validate decoded segments and deny./../empty segments.
- Files reviewed: 28/224 changed files
- Comments generated: 0 new
- Review effort level: Lite
The mock kept a module-level `Map` of relativePath → Promise to dedupe loads. That trips `openmetadata-performance/no-unbounded-module-cache` (caches must declare a size cap + eviction path). In the test harness the cache added zero value — Node's `require.cache` already dedupes JSON resolution per test process, and Jest resets module state between test files, so a second Map wrapper only introduces unbounded growth. Remove the Map; every call goes directly through `require()`, which is already O(1) after the first resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
🚦 Removed from the merge queue —
|
Code Review 👍 Approved with suggestions 1 resolved / 3 findingsRolldown migration cuts build time from 10:28 to ~20 s (28× speedup) through parallel Rust bundler, SWC JSX transform, and removal of redundant brotli compression. Bundle size and runtime behaviour are unchanged; chunk count increases from 671 to 1237 due to Rolldown's lack of chunk merging, but this is acceptable for HTTP/2 and addresses noted in follow-up options. Two minor suggestions: forward trailing arguments in the 💡 Edge Case: process.nextTick stub drops extra arguments📄 openmetadata-ui/src/main/resources/ui/index.html:52 The real Node 💡 Quality: Misleading comment: this is an inline script, not a blank line📄 openmetadata-ui/src/main/resources/ui/index.html:40-42 The comment states "A blank line before any bundle loads is the cheapest place to guarantee a ✅ 1 resolved✅ Quality: glob mock hides real asset-resolution paths in all tests
🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Summary
yarn builddrops from ~628 s (10:28) to ~20 s — a ~28× speedup, ~50× on the Vite phase alone. All existing bundle-check budgets pass.Numbers
What changed
Build configuration
Static assets
Template-literal `import()` chunk fragmentation
Three call sites globbed into hundreds of chunks because Vite must emit one chunk per possible match of a template-literal `import()`:
Trade-offs & notes for reviewers
Rolldown is beta. `[email protected]`. Vue, Nuxt, and Storybook ship production builds on it. During this work I hit one intermittent Less plugin error on `EntityRightPanelVerticalNav.less` that cleared on `rm -rf node_modules/.vite` + rebuild; if CI hits it, that's the workaround until Rolldown stabilizes.
Brotli removal is a small transfer-size regression on raw servlet deployments — modern browsers get gzip instead of brotli, roughly 5–15 % larger transfer per JS/CSS asset. Behind a CDN/nginx with on-the-fly brotli it's invisible. Reintroducing pre-compressed brotli as a parallel post-step is a straightforward follow-up if the tighter transfer size is required for published artifacts.
Chunk count went from 671 to 1237. Rolldown emits one chunk at every dynamic-import boundary and stops — there is no `experimentalMinChunkSize` merger. The remaining ~566-chunk delta breaks down roughly as:
Runtime impact is small (HTTP/2 handles many small requests fine), byte size is at least equal to Rollup's output (no duplication), cacheability is arguably better (smaller chunks change less often). The main downside is the ratchet number in `check-bundle-chunks.mjs` output looks larger.
Follow-up options for closing the chunk-count gap (not blocking):
Test plan
🤖 Generated with Claude Code