Skip to content

IBX-11919: Build CI assets with yarn encore prod - #143

Draft
micszo wants to merge 1 commit into
mainfrom
IBX-11919-encore-prod-on-ci
Draft

IBX-11919: Build CI assets with yarn encore prod#143
micszo wants to merge 1 commit into
mainfrom
IBX-11919-encore-prod-on-ci

Conversation

@micszo

@micszo micszo commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Browser-tests CI (used by ibexa/oss, ibexa/headless, ibexa/experience, ibexa/commerce via ibexa/gh-workflows) runs the whole app under APP_ENV=behat.
  • ibexa:encore:compile (see Ibexa\Bundle\AdminUi\Command\CompileAssetsCommand) only runs yarn encore prod when the consoles ambient --env option equals prod; that option defaults to APP_ENV. Since CI never sets APP_ENV=prod, every asset build triggered by composer run post-install-cmd on CI silently compiled with yarn encore dev, on every edition and version.
  • This overrides APP_ENV=prod for just the composer run post-install-cmd exec call in each bin/<version>/prepare_project_edition.sh, so ibexa:encore:compile builds a production bundle while the app container keeps running under APP_ENV=behat for the actual Behat test execution (nothing else changes).
  • Scoped to the currently active version scripts: 4.6.x-dev, 5.0.x-dev, 6.0.x-dev, stable. Left 4.0.x-dev through 4.5.x-dev and ^3.3.x-dev untouched (EOL).

Companion PR in ibexa/gh-workflows handles the equivalent composer run post-install-cmd calls that happen mid-pipeline (multirepository setup, test-setup phases) in the shared browser-tests.yml reusable workflow.

Test plan

  • Trigger a browser-tests run (any edition) against this branchs ci-scripts ref and confirm the "Clear cache & generate assets" step logs a prod encore build instead of dev.
  • Confirm Behat tests still pass (i.e. APP_ENV=behat is unaffected at runtime).

Ref: https://ibexa.atlassian.net/browse/IBX-11919

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.
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant