IBX-11919: Build CI assets with yarn encore prod - #112
Closed
micszo wants to merge 2 commits into
Closed
Conversation
Browser-tests CI runs the app under APP_ENV=behat throughout the pipeline. ibexa:encore:compile decides between yarn encore dev/prod based on the ambient console --env option, which defaults to APP_ENV, so every composer run post-install-cmd call in this workflow was silently compiling assets in dev mode. Override APP_ENV=prod for just those composer run post-install-cmd exec calls (initial compatibility-layer setup, multirepository setup, and both test-setup phases), so asset compilation uses a production build while the app container keeps running under APP_ENV=behat for the actual Behat test execution.
Same fix as the companion ci-scripts change: 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 in all 11 call sites (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.
|
4 tasks
Contributor
Author
|
Closing, ibexa/ci-scripts#143 is sufficient. |
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/ci-scripts#143 — companion PR, handles the equivalent
composer run post-install-cmdcall inprepare_project_edition.shthat runs before this reusable workflow even starts, updated with the same two-step approach.Regression run: ibexa/oss#290
Description:
Browser-tests CI runs the app under
APP_ENV=behatfor the entire pipeline (required for FriendsOfBehat / Behat test execution).ibexa:encore:compile(seeIbexa\Bundle\AdminUi\Command\CompileAssetsCommand) only runsyarn encore prodwhen the console's ambient--envoption equalsprod; that option defaults toAPP_ENV. Since this workflow never setsAPP_ENV=prod, everycomposer run post-install-cmdcall here silently compiled assets withyarn encore dev, on every edition and version.Initial approach (superseded): overriding
APP_ENV=prodon each of thosecomposer run post-install-cmdexec calls. 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 at all 11 call sites (compatibility-layer setup, all three multirepository setup variants, and both test-setup phases), socache:clearkeeps booting under the existingbehatenv and the generatedvar/encore/*.jsmanifest stays correct. Immediately after each one, 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).For QA:
yarn 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).