Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Sync environments with the current API spec - #300

Merged
joetannenbaum merged 2 commits into
mainfrom
api-sync/environments
Nov 20, 2026
Merged

joetannenbaum merged 2 commits into
mainfrom
api-sync/environments

Conversation

@joetannenbaum

@joetannenbaum joetannenbaum commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

The Cloud API spec changed. This syncs the environment resource with it.

Findings fixed

Where What the spec says What the CLI did
UpdateEnvironmentRequest.uses_http_basic_auth, .http_basic_auth_password New. A boolean, plus a password that is "Required when uses_http_basic_auth is true, and prohibited otherwise". Never sent. environment:update now has --uses-http-basic-auth and --http-basic-auth-password. The password is a #[SensitiveParameter] and is masked in the change report.
UpdateEnvironmentRequest.post_deploy_command string | null, max 2000 characters. Never sent. environment:update now has --post-deploy-command.
EnvironmentResource.attributes.post_deploy_command, uses_http_basic_auth, internal_networking Returned on every environment. internal_networking is { enabled, hostname, access_level, environment_ids }. Not on the Environment DTO, so --json and --fields couldn't return them. The DTO now has postDeployCommand, usesHttpBasicAuth and internalNetworking, which uses a new EnvironmentInternalNetworking DTO.
GET /environments/{environment}/metrics, the cpu_usage and memory_usage y values Now number | null. Null means the instance reported no sample for that interval, which is not zero usage. MetricPoint cast null to 0.0, so a gap showed as 0% in the sparkline and in --json. MetricPoint::$value is now ?float. The sparkline already skips non-numbers. The trend line now starts and ends at the first and last intervals that have a sample, and a series with no samples reads "No data".

For review

  • Basic auth flow. The password field isn't in the interactive multiselect. Picking "HTTP basic auth" and answering yes prompts for the password. --uses-http-basic-auth=true without a password fails non-interactively with "Provide --http-basic-auth-password…" before anything is sent. --http-basic-auth-password on its own changes the password.
  • --json for a missing sample. It now sends null where it used to send 0.

Left alone (uncertain)

  • display_name: it would collide with Environment::displayName(), so it needs a naming decision.
  • deploy_hook_url: anyone holding it can trigger a deploy. Whether it should be masked is a decision.
  • pull_request: the spec types it only as null.
  • environment:create: no basic auth options yet. That's a design question.
  • POST/PATCH/DELETE /environments/{environment}/internal-networking: new endpoints, Private Cloud only. They need new commands, which is a proposal rather than a fix.

Tests

  • New feature tests cover the post-deploy command, basic auth on with a password, basic auth off, basic auth on without a password non-interactively, and the new DTO fields.
  • New unit tests cover null metric samples.
  • Run under PHP 8.4. The full suite ran with a dummy LARAVEL_CLOUD_TOKEN, so the auth middleware doesn't stall in a container with no stored token: 820 pass. The one failure was a RepoConfigTest case that the dummy token breaks; it fails the same way on main with that token set, and RepoConfigTest passes in full (14/14) without it. PromptFallbackTest was skipped because it hangs in this container. PHPStan and Pint are clean.

https://claude.ai/code/session_01T1Sq4Xyfgr8GKyqxCwmuSc


Generated by Claude Code

claude and others added 2 commits November 20, 2026 21:38
Publish the environment's post-deploy command, HTTP basic auth state
and internal networking settings; let environment:update set the
post-deploy command and HTTP basic auth; keep a metric interval with no
sample as null instead of zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Xyfgr8GKyqxCwmuSc
@joetannenbaum
joetannenbaum merged commit 4d91ecb into main Nov 20, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants