$ the-wire · showcase
Context propagation fix, cloud-cli env var overhaul
By RepoJournal · Filed · About Laravel
Laravel framework propagates context to concurrent processes, and cloud-cli replaces a dead env var action, fixes several broken commands, and adds monorepo support.
Laravel 13.x will propagate application context to concurrent processes [1]. `Concurrency::run()` and `Concurrency::defer()` spawn child processes that don't inherit context, so `Context::get('tenantId')` returned null inside tasks; this made context unreliable for request and trace IDs. The fix ensures context is inherited, restoring the intended behavior.
The framework also added `assertSentOnce()`, `assertQueuedOnce()`, and notification equivalents to the mail and notification fakes [2]. These used to require the `...Times()` variants with an explicit count of 1, like `Mail::assertSentTimes(OrderShipped::class, 1)`; they now read as `Mail::assertSentOnce(OrderShipped::class)`, matching the `once` assertions already in the event and bus fakes. Separately, higher order proxy generic types were improved by porting Larastan generics, giving IDEs better return values and method discovery [3], and a test-suite cleanup deduped byte-identical fixtures [4].
The cloud-cli replaced the dead `environment:variables --action=replace`, which called a PUT endpoint the API removed [5]. `--action=delete` now takes its place, uses an atomic `POST /variables/delete`, and requires `--force` in non-interactive mode after going through `confirmDestructive()`. It also fixed `database-snapshot:get` and `:delete`, which hit a 404 because they called the nested snapshot route; show and destroy now use `/database-snapshots/{snapshot}` [6]. The bucket key secret is now returned correctly because the DTO read the wrong field name, and `bucket-key:create` and `bucket-key:get` print credentials masked unless you pass `--show-sensitive` [7]. `application:create` and `ship` gained `--root-directory` support, letting monorepo users create apps from the CLI rather than the dashboard [8]. The CLI was also prepared for release with Bosun [9].
Action items
- → Test concurrent tasks that rely on context when you upgrade to the next Laravel 13.x release laravel/framework [monitor]
- → Update cloud-cli scripts that use the removed environment variable replace action laravel/cloud-cli [immediate]
- → Take advantage of the new once assertions in your mail and notification tests laravel/framework [plan]
- → Use the new --root-directory flag for monorepo deployments laravel/cloud-cli [plan]
References
- [1] [13.x] Fix context not being propagated to concurrent processes ↗ laravel/framework
- [2] [13.x] Add `once` assertions to the mail and notification fakes ↗ laravel/framework
- [3] [13.x] feat: improve higher order proxy generic types ↗ laravel/framework
- [4] Dedupe common test fixtures ↗ laravel/framework
- [5] Replace the dead env var replace action with delete ↗ laravel/cloud-cli
- [6] Fix database-snapshot:get and :delete hitting a 404 ↗ laravel/cloud-cli
- [7] Fix bucket key secret never being returned ↗ laravel/cloud-cli
- [8] Add --root-directory support to application:create and ship ↗ laravel/cloud-cli
- [9] Prepare CLI to be released with Bosun ↗ laravel/cloud-cli