IBX-11919: Build CI assets with yarn encore prod - #143
Open
micszo wants to merge 2 commits into
Open
Conversation
Browser-tests CI runs the whole app under APP_ENV=behat, and ibexa:encore:compile picks yarn encore dev/prod based on the ambient --env, which defaults to APP_ENV. As a result every CI asset build was silently compiled in dev mode, never prod, regardless of edition. Override APP_ENV=prod for just the composer run post-install-cmd exec call that triggers ibexa:encore:compile, so encore compiles a production build while the app itself still runs under APP_ENV=behat for the actual Behat test execution.
Overriding APP_ENV=prod for the whole `composer run post-install-cmd` call also switches the Symfony kernel env used by cache:clear, which excludes IbexaBehatBundle (registered only for 'behat') from kernel.bundles_metadata. That silently drops ibexa/behat's encore config (transition-listener.js) from var/encore/*.js, so the compiled admin-ui bundle never adds the ibexa-selenium-transition-* marker classes Behat's transition-wait conditions poll for. Run post-install-cmd unmodified (still under the behat env, so the generated var/encore manifest stays correct), then rebuild assets in production mode via a separate, plain `yarn encore prod` call that never touches the Symfony kernel/env.
|
This was referenced Sep 2, 2026
micszo
marked this pull request as ready for review
September 9, 2026 13:10
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.



Related PRs:
ibexa/gh-workflows#112 — companion PR, updates the equivalent
composer run post-install-cmdcall sites in the sharedbrowser-tests.ymlreusable workflow with the same two-step approach.Regression run: ibexa/oss#290
Description:
Browser-tests CI (used by ibexa/oss, ibexa/headless, ibexa/experience, ibexa/commerce via
ibexa/gh-workflows) runs the whole app underAPP_ENV=behat.ibexa:encore:compile(seeIbexa\Bundle\AdminUi\Command\CompileAssetsCommand) only runsyarn encore prodwhen the console's ambient--envoption equalsprod; that option defaults toAPP_ENV. Since CI never setsAPP_ENV=prod, every asset build triggered bycomposer run post-install-cmdon CI silently compiled withyarn encore dev, on every edition and version.Initial approach (superseded): overriding
APP_ENV=prodon the wholecomposer run post-install-cmdexec call. A regression run (ibexa/oss#290) caught that this breaks Behat:composer run post-install-cmdalso runscache:clearfirst (via@auto-scripts), and forcing that to boot the Symfony kernel underprodexcludesIbexaBehatBundle(registered only for thebehatenv inconfig/bundles.php) fromkernel.bundles_metadata. That silently dropsibexa/behat's encore config (transition-listener.js) from the generatedvar/encore/*.jsmanifest, so the compiled admin-ui bundle never adds theibexa-selenium-transition-*marker classes that Behat's transition-wait conditions poll for — every scenario usingElementTransitionHasEndedCondition(e.g.IbexaDropdown::verifyIsLoaded()) then fails withTimeoutException: Transition has not started at all.Current approach: leave
composer run post-install-cmdunmodified, socache:clearkeeps booting under the existingbehatenv and the generatedvar/encore/*.jsmanifest stays correct (includesibexa/behat's contribution). Immediately after, run the production asset build as a separate, plainyarn encore prod --config-name app && yarn encore prodcall — this never boots the Symfony kernel, so it can't re-trigger the bundle-discovery bug, while still producing a genuineyarn encore prodbuild (mirrors the exact two-stepibexa:encore:compile --config-name app+ibexa:encore:compilesequence composer's@auto-scriptsalready runs).Scoped to the currently active version scripts:
4.6.x-dev,5.0.x-dev,6.0.x-dev,stable. Left4.0.x-devthrough4.5.x-devand^3.3.x-devuntouched (EOL).For QA:
ci-scriptsref and confirm assets are built withyarn encore prod(notdev).-e APP_ENV=prodapproach) failed withisIbexaDropdownVisible/ibexa-dropdown-popovertransition timeouts across every job — root-caused to theIbexaBehatBundle/var/encoreissue above.regression-oss-setup3— PHP 8.4/Node 22/MySQL 8.4/Solr 8/Redis latest — in oss#290) against the updated two-step approach and confirm Behat tests pass with prod-built assets.APP_ENV=behatis unaffected at runtime (unchanged from the original approach).