Skip to content

Expose why Laravel Cloud started a deployment - #314

Open
joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/deployments
Open

joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/deployments

Conversation

@joetannenbaum

Copy link
Copy Markdown
Collaborator

Exposes why Laravel Cloud started a deployment, which the live Cloud API spec now returns on every deployment.

Findings

Field What the spec says What the CLI did
DeploymentResource.attributes.trigger New, required, DeploymentTrigger | null. patch means Laravel Cloud redeployed the environment's current code on an image patched for a security vulnerability (no build, no deploy commands). Null when a person or their automation started the deployment. Dropped it: App\Dto\Deployment had no property for it, so --json and --fields couldn't surface it.
DeploymentResource.attributes.trigger_reference New, required, string | null: what a Cloud-started deployment addresses, such as the CVE a patch fixes. Null when trigger is null. Dropped it, same as above.

What changed

  • Deployment::$trigger and Deployment::$triggerReference (?string), mapped from trigger / trigger_reference. trigger is a plain string rather than an enum so a value the API adds later doesn't fail the cast.
  • tests/Unit/DeploymentDtoTest.php covers both a person-started deployment (both null) and a patch deployment.

Human output (deployment:get's detail list) is unchanged; showing the trigger there is a separate decision. No interactive prompt changed, so there's no demo.

Checks

  • vendor/bin/pest: 853 passed (PromptFallbackTest skipped locally, it hangs in the sandbox; RepoConfigTest run separately without a token, 14 passed).
  • vendor/bin/phpstan analyse: no errors.
  • vendor/bin/pint: passed.

Generated by Claude Code

The API now returns `trigger` and `trigger_reference` on every deployment:
`patch` (and the CVE it fixes) when Laravel Cloud redeployed the current
code on a patched image, null when a person or automation started it. The
Deployment DTO dropped both, so `--json` and `--fields` couldn't surface them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4WiUrLvGeKw2bhP3DT
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