Skip to content

Modular logistics and supply chain operating system (LSOS)

ci(api-contract): give the contract stack a working mail transport

Ronald A. Richardson86639af08262
diff --git a/.github/workflows/api-contract.yml b/.github/workflows/api-contract.yml
index a18d71e1..d283dd2f 100644
--- a/.github/workflows/api-contract.yml
+++ b/.github/workflows/api-contract.yml
@@ -195,6 +195,34 @@ jobs:
bash scripts/docker-install.sh --non-interactive
+ # The verification-code endpoints deliver by SMS and fall back to email. With
+ # no mail transport configured the fallback dies on a null from-address —
+ # "Email \"null\" does not comply with addr-spec of RFC 2822" — so
+ # Request Customer Creation Code, Request Customer Login SMS and Request Driver
+ # Login SMS all answered 400 for a reason that has nothing to do with the API.
+ # The log mailer writes the message to the Laravel log and delivers nothing, so
+ # nothing leaves the runner; the endpoints simply become exercisable.
+ set_env() {
+ if grep -q "^$1=" api/.env; then
+ sed -i "s|^$1=.*|$1=$2|" api/.env
+ else
+ echo "$1=$2" >> api/.env
+ fi
+ }
+ set_env MAIL_MAILER log
+ set_env MAIL_FROM_ADDRESS [email protected]
+ # Quoted in .env: an unquoted value with spaces is truncated at the first one.
+ set_env MAIL_FROM_NAME '"Fleetbase API Contract"'
+ echo "Mail transport: log (from [email protected])"
+ # After the installer, not before: docker-install.sh writes MAIL_* itself
+ # (MAIL_FROM_ADDRESS="") and would overwrite anything set earlier. The stack
+ # is already up by this point, so the config cache has to be dropped.
+ docker compose exec -T application php artisan config:clear >/dev/null 2>&1 || true
+ # Octane holds a booted application in each worker, so clearing the cached
+ # config file is not enough — the workers have to be recycled to re-read .env.
+ docker compose exec -T application php artisan octane:reload >/dev/null 2>&1 || true
+
+
- name: Wait for API health
run: |
set -uo pipefail