Skip to content

Fix MOTD failure in CI by forcing APP_ENV=prod during composer install#345

Merged
escopecz merged 1 commit into
mautic:mainfrom
matbcvo:motd
Apr 14, 2026
Merged

Fix MOTD failure in CI by forcing APP_ENV=prod during composer install#345
escopecz merged 1 commit into
mautic:mainfrom
matbcvo:motd

Conversation

@matbcvo

@matbcvo matbcvo commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

This fixes a CI failure during composer install where mautic:motd was exiting with MOTD response was empty.

The issue was not the MOTD endpoint itself, but the environment the command was running in. Our CI .env sets APP_ENV=test, so when Composer runs its post-install scripts, bin/console mautic:motd is executed with Mautic’s test configuration. In app/config/config_test.php, the http_client service is replaced with Symfony\Component\HttpClient\MockHttpClient, so no real HTTP request is made and the command receives an empty response body.

The fix is to run composer install with APP_ENV=prod, so Composer lifecycle scripts execute with the normal service configuration and use the real HTTP client. The rest of the workflow (installation, cache warmup, PHPUnit) still runs explicitly with --env=test, so test behavior remains unchanged.

@matbcvo matbcvo requested a review from escopecz April 13, 2026 16:14

@escopecz escopecz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks!

@escopecz escopecz merged commit 3c8e071 into mautic:main Apr 14, 2026
2 checks passed
@matbcvo matbcvo deleted the motd branch April 14, 2026 06:58
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.

2 participants