the environment has no read-side coordinate — so a legacy box gets to name OUR environments #17
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:apply
scope:capture
scope:coolify-api
scope:fleet
scope:manifest
scope:secrets
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/cast#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The gap
--projectexists because a hand-built Coolify project is "called whateversomeone typed", and cast must be pointed at the real name rather than guess.
The environment has exactly the same problem and no flag.
cast names the Coolify environment after
--env. But--envis our name forthe environment — it selects the manifest block, the
environments.yamlentry,the secret store path (
secrets/<repo>.<env>.env.age), and the age recipient.On a hand-built source box, the Coolify environment is called whatever Coolify
defaulted to — which is
production, notprod.So reading a legacy box forces a choice between two bad options:
you may not own, to satisfy a tool that is only reading it.
Option 2 is what actually happened here, and it is worth spelling out because it
looks harmless and isn't:
prodwas renamed toproductionacross the manifestand
environments.yaml— so a hand-built box that is being deleted next weekgot to name the environment of the brand-new box forever (cast names the
environment after
--env, soapplywould have created it asproduction), andit silently moved the secret store to
secrets/incubator.production.env.ageandinvalidated every
--env prodin the runbooks. It was reverted.The general shape of the bug: cast's own principle is that a live box never
gets to define desired state — but with no read-side coordinate for the
environment, the only way to read a legacy box is to let it define one.
Proposal
Add a read-side environment coordinate, exactly parallel to
--project:--envkeeps meaning our environment: manifest block,environments.yamlentry, store path, recipient, team assert.
--environmentmeans their name for it on the wire.--env, so nothing changes for boxes cast built.should now also name this flag in its message, the way the absent-project
refusal names
--project.Most valuable on
diffandcapture(the read verbs — the ones you point at abox you did not build). Harmless and consistent on
apply.Acceptance
cast capture <slug> --env prod --environment production --instance box-breads the source's
productionenvironment and writessecrets/<repo>.prod.env.age— our name on our side of the line, theirson theirs.
--environment, behavior is unchanged.--environmentas the fix.