cast/test
claude-hdb 6b363cb5be fix: apply creates the environment its resources name (#38)
POST /projects hands a new project Coolify's OWN default environment,
`production` — never ours. cast then created every resource with
`environment_name: <our --env>`, so the first apply against a project that
did not exist yet 404'd on its first resource ("Environment not found") and
left the project behind, created and empty.

Two comments in the source already asserted the behaviour as though it were
implemented (cli.ts:716, :808), and the README says it outright — the route
existed in the vendored 4.1.2 spec, cast just never called it. It went unseen
because every environment cast had touched until now was hand-built in a UI
and adopted, so it already existed under whatever name someone typed. The
genuinely-from-nothing apply is the one path nobody had run.

apply now reconciles project + environment once per run, before the first
create. Read-before-write: an environment that already exists is never written
to, so adoption is untouched and this cannot regress an apply that works today.
A 409 is read as "present" (the race between our read and our write).

Coolify's default environment is LEFT ALONE, per apply-never-deletes — deleting
it would be the first delete cast ever performs. An empty `production` beside
the environment everything lives in is reported, the same courtesy an orphan
gets, and removed by hand or not at all.

The regression test drives the real failure, not a call count: the fake Coolify
404s a create whose environment_name it does not carry, exactly as a live box
does — against the old executor it reproduces the reported error verbatim.
2026-07-14 16:43:12 +00:00
..
fixtures feat: place a resource on a destination — and a state file that can say which (#21) 2026-07-13 19:31:02 +00:00
apply.test.ts feat: cast — the Coolify executor, extracted from the infra state repo 2026-07-11 12:25:44 +00:00
bindings.test.ts fix: smoke resolves its target inside the project it was declared under (#29) 2026-07-13 20:08:35 +00:00
capture-cli.test.ts feat: cast capture — adopt a hand-built Coolify into the age secret store (#15) 2026-07-13 16:51:43 +00:00
capture.test.ts feat: cast capture — adopt a hand-built Coolify into the age secret store (#15) 2026-07-13 16:51:43 +00:00
cli.test.ts fix: smoke resolves its target inside the project it was declared under (#29) 2026-07-13 20:08:35 +00:00
config.test.ts feat: select the Coolify instance by name instead of editing .coolify.env (#14) 2026-07-13 16:42:45 +00:00
coolify.test.ts feat: assert the token's team before touching Coolify (fail-closed) 2026-07-12 20:55:04 +00:00
diff.test.ts feat: place a resource on a destination — and a state file that can say which (#21) 2026-07-13 19:31:02 +00:00
draft-cli.test.ts feat: emit a draft of what a box holds — a proposal, never desired state (#27) 2026-07-13 20:32:25 +00:00
draft.test.ts feat: emit a draft of what a box holds — a proposal, never desired state (#27) 2026-07-13 20:32:25 +00:00
envtemplate.test.ts feat: cast — the Coolify executor, extracted from the infra state repo 2026-07-11 12:25:44 +00:00
fleet-cli.test.ts feat: --all — every project in an environment, and a report that says so (#26) 2026-07-13 20:23:23 +00:00
fleet.test.ts feat: --all — every project in an environment, and a report that says so (#26) 2026-07-13 20:23:23 +00:00
inventory.test.ts feat: read-side coordinates (#17, #18) + cast inventory (#19) 2026-07-13 18:20:53 +00:00
live-lookup.test.ts fix: diff refuses an absent target instead of reporting it as empty (#11, #6) 2026-07-13 14:52:38 +00:00
manifest.test.ts feat: assert the token's team before touching Coolify (fail-closed) 2026-07-12 20:55:04 +00:00
placement-cli.test.ts feat: place a resource on a destination — and a state file that can say which (#21) 2026-07-13 19:31:02 +00:00
read-side-cli.test.ts feat: --resource, the third name a hand-built box does not share with you 2026-07-13 18:50:06 +00:00
resolve.test.ts fix: authenticate clones via gh / token, never fall into git's prompt (#13) 2026-07-13 16:30:04 +00:00
secrets.test.ts fix: hand the age identity to age on stdin — fd paths resolve only in cast's process 2026-07-13 22:43:00 +00:00
smoke-cli.test.ts fix: smoke resolves its target inside the project it was declared under (#29) 2026-07-13 20:08:35 +00:00
smoke.test.ts feat: cast — the Coolify executor, extracted from the infra state repo 2026-07-11 12:25:44 +00:00
sweep-cli.test.ts feat: inventory sweeps the instance — a discovery verb that needed you to have discovered 2026-07-13 19:07:17 +00:00
team.test.ts feat: assert the token's team before touching Coolify (fail-closed) 2026-07-12 20:55:04 +00:00
wire.test.ts fix: apply creates the environment its resources name (#38) 2026-07-14 16:43:12 +00:00