Skip to content

[Studio] Ship frontend build as a committed archive (extracted at cache warmup) - #690

Merged
ValeriaMaltseva merged 5 commits into
2026.2from
ci/studio-packaged-frontend-build
Sep 9, 2026
Merged

[Studio] Ship frontend build as a committed archive (extracted at cache warmup)#690
ValeriaMaltseva merged 5 commits into
2026.2from
ci/studio-packaged-frontend-build

Conversation

@ValeriaMaltseva

@ValeriaMaltseva ValeriaMaltseva commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopts the same packaged frontend-build approach used by studio-ui-bundle (2026.x) and pimcore-agent-bundle#92, as tracked in platform-version#247.

Instead of committing the expanded src/Resources/public/studio/build/ tree, we now commit a single content-addressed build-dist/build-<id>.zip and let studio-ui-bundle's BuildArchiveExtractionTrait reconstruct src/Resources/public/studio/build/ at cache warmup. This removes the per-build file churn and merge conflicts the "Automatic frontend build" commits used to cause.

What changed

  • WebpackEntryPointProvider now implements BuildArchiveProviderInterface via the shared BuildArchiveExtractionTrait — no new logic, it just points at build-dist/build*.zip.
  • rsbuild.config.ts uses studio-ui-bundle's getBuildGroupId + pluginWriteBuildId for a deterministic, content-derived build id (identical source → identical archive), replacing the random uuid-based id. The old "clean old builds" step is kept, but scoped to remove every dir except the current build id — needed because studio-package-build picks the lexicographically greatest .build-id it finds on disk, not the one just built, so a leftover stale dir could otherwise get archived instead.
  • package.json gained a package-build script (studio-package-build) that packages the build into build-dist/.
  • CI switched to the shared reusable-studio-frontend-build-packaged.yaml workflow (pinned to a commit SHA, since it runs with contents: write), watching build-dist/** instead of the expanded build path.
  • .gitignore drops the expanded tree; .gitattributes marks the archive binary + linguist-generated. It does not use merge=ours — that names a custom Git merge driver that isn't registered anywhere in this org, so it would have been a silent no-op. A forward-merge conflict on the archive is instead resolved manually (keep the target branch's copy, e.g. git checkout --ours -- build-dist/); CI regenerates it on the next real source change. This is documented in the .gitattributes comment.
  • composer.json already required pimcore/studio-ui-bundle": "^2026.2.6", past the ^2026.2.1 minimum that ships the Build/* classes — no version bump needed.

Test plan

  • Ran npm run build followed by npm run package-build locally against the new rsbuild.config.ts / package.json — produced build-dist/build-<id>.zip from a single build-id'd output directory as expected.
  • Verified the stale-build-dir fix directly: seeded a fake dir with a lexicographically-greater .build-id, ran the build, confirmed it was removed and the packaged archive matched the fresh build, not the stale one.
  • npx tsc --noEmit — no new type errors introduced (pre-existing, unrelated antd-token errors only).
  • Could not run php -l / the PHP test suite locally (no PHP binary in this environment) — relying on CI (Codeception / static analysis) to validate WebpackEntryPointProvider.
  • CI's "Studio Frontend Build" workflow should produce and commit the packaged archive on this branch.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…he warmup)

Adopts the packaged-build approach used in studio-ui-bundle and
pimcore-agent-bundle: instead of committing the expanded
src/Resources/public/studio/build/ tree, we commit a single
content-addressed build-dist/build-<id>.zip and let studio-ui-bundle
reconstruct the build directory at cache warmup. This removes the
per-build file churn and merge conflicts the "Automatic frontend
build" commits used to cause.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 8, 2026 14:35

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.

🟡 Changes recommended

Pin the write-enabled workflow to a SHA and correct or configure the archive merge strategy.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Replaces committed expanded Studio frontend assets with a content-addressed archive extracted during cache warmup.

Changes:

  • Adds deterministic build IDs and archive packaging.
  • Integrates archive extraction into the entry-point provider.
  • Updates CI and removes expanded generated assets.
File summaries
File Description
src/Webpack/WebpackEntryPointProvider.php Provides and extracts the build archive.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/remoteEntry.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/main.35725457.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/745.56a11b0d.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/67.8469aaea.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/67.8469aaea.js Removes generated JavaScript.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/668.1ae87f0f.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/658.b1390ae9.js Removes generated JavaScript.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/359.ef7a6289.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/272.5aa86da5.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/272.5aa86da5.js Removes generated JavaScript.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/132.c328628b.js Removes generated JavaScript.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/async/__federation_expose_default_export.619777ef.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/static/js/109.4563ef16.js.LICENSE.txt Removes generated license output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/mf-stats.json Removes federation statistics.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/mf-manifest.json Removes the federation manifest.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/manifest.json Removes the expanded asset manifest.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/main.html Removes expanded HTML output.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/exposeRemote.js Removes the expanded remote bootstrap.
src/Resources/public/studio/build/405a7c51-e8c7-4dda-81a4-aca2bbebbe7f/entrypoints.json Removes expanded entry-point metadata.
src/Resources/public/studio/.gitkeep Retains the extraction parent directory.
assets/studio/rsbuild.config.ts Generates deterministic build IDs.
assets/studio/package.json Adds the archive-packaging command.
.gitignore Ignores extracted build output.
.github/workflows/studio-frontend-build.yaml Uses packaged-build CI; critically, its write-enabled reusable workflow must be pinned to a commit SHA.
.gitattributes Marks archives as binary; moderately, merge=ours is not portable without driver configuration.
Review details
  • Files reviewed: 26/34 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/studio-frontend-build.yaml Outdated
Comment thread .gitattributes Outdated
@ValeriaMaltseva ValeriaMaltseva added this to the 2026.2.6 milestone Sep 8, 2026
ValeriaMaltseva and others added 3 commits September 9, 2026 09:23
@main is mutable and this caller grants contents: write, so a compromised
or accidental upstream branch update could execute with write access to
this repository. Pin to the current revision of
reusable-studio-frontend-build-packaged.yaml, keeping main as an update
comment.

Co-Authored-By: Claude <noreply@anthropic.com>
merge=ours names a custom Git merge driver that isn't built in and isn't
registered anywhere in this org (no repo configures merge.ours.driver), so
the attribute was silently a no-op rather than actually preventing merge
conflicts on the archive. Document the manual resolution instead: on a
forward-merge conflict, keep the target branch's archive and let CI
regenerate it on the next real source change.

Co-Authored-By: Claude <noreply@anthropic.com>

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.

🟡 Changes recommended

Packaging can select a stale build directory and retain an outdated archive.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 26/34 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread assets/studio/rsbuild.config.ts Outdated
Comment thread .gitattributes
studio-package-build selects the lexicographically greatest .build-id it
finds on disk, not the one produced by the current run. Without cleanup, a
directory left over from an earlier source state could sort higher than a
fresh rebuild's id and get archived instead of it. This bundle has a single
build target (no SDK/app pair sharing a build-id group like studio-ui-bundle
itself has), so it's safe to remove every other build dir before building.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

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.

🟢 Approved

The reviewed archive migration has no unresolved approval-blocking issues.

Review details
  • Files reviewed: 26/34 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@ValeriaMaltseva
ValeriaMaltseva merged commit 6e26811 into 2026.2 Sep 9, 2026
26 checks passed
@ValeriaMaltseva
ValeriaMaltseva deleted the ci/studio-packaged-frontend-build branch September 9, 2026 08:56
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants