feat(resolve): warn that apply cannot enable "Include Source Commit in Build" (#46) #54
No reviewers
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#54
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/source-commit-notice"
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 question
The answer: it cannot. Taking the second branch.
I have no Coolify credentials, so I could not run the live
curlprobe from the issue — but the probe was unnecessary, and a live probe would have been weaker evidence than what follows: it proves the answer for one box, whereas the source proves it for every box. I read the whole v4.1.2 tagged tree and verified each claim independently. Full write-up posted to the issue: #46 (comment) → https://github.com/heavy-duty/cast/issues/46#issuecomment-49745532761. The field is an application setting, defaulting to off.
app/Models/ApplicationSetting.phpl.19 (boolean cast), l.66 (fillable)database/migrations/2025_11_26_124200_…phpl.22 —->default(false), so every app cast creates has it off.2. It has zero API surface. A whole-tree grep (excluding
vendor/) forinclude_source_commit_in_build|includeSourceCommitInBuildreturns 17 hits, none underapp/Http/Controllers/Api/. The only writer in the entire codebase:A Livewire component — a human, in the Advanced tab.
3. And the API would reject it, not ignore it — this is what rules out "send it anyway and hope":
connect_to_docker_network— which is exactly why that create-time field works today (cli.ts:2054), and is the perfect control for this experiment.⚠️ #46's original premise was wrong — and #50 found the real cause
Worth stating loudly, because it changes what the warning should say. The toggle gates only the build-time arg:
At runtime
$forBuildTimeisfalse→ the condition short-circuits true regardless of the toggle. Coolify's runtime injection ofSOURCE_COMMITis unconditional. A service readingprocess.env.SOURCE_COMMITat request time — exactly what/versiondoes — never needed this toggle.So the toggle was not why a live box reported
{"sha":"unknown"}. The real cause is the very next line (:2950): Coolify skips its own injection if the app already carries an env var of that name, so an orphan (even empty) app-levelSOURCE_COMMITsuppresses it. That is #50, in flight in parallel. Not implemented here.Consequently I did not ship the line drafted in the issue (
…or /version will report sha "unknown") — that sentence is false, and baking a wrong premise into the tool's own permanent output would mislead every operator who later reads it. The shipped wording states only what the source proves.What changed
Three files, small diff.
src/resolve.ts—desiredFromManifestnow warns once perdockercomposeapplication, using the same mechanism and voice as the existing umami service-domains warning:The invariant is pinned in a comment placed exactly where a future reader would otherwise "fix" this by adding
include_source_commit_in_buildtofields— which would 422 every apply, since the allowlist rejects unknown keys. The comment says so, and says whyconnect_to_docker_networkis not a precedent for it.test/resolve.test.ts— two new tests: the warning fires for a dockercompose app (and names the app, the setting, and the UI), and does not fire for a non-compose app. Plus a regression guard thatinclude_source_commit_in_buildnever reachesfields. Also added aconsole.warnspy to the pre-existing dockercompose test to keep test output clean.docs/semantics.md— recorded under Known limitations, not defects, with the citations, theconnect_to_docker_networkcontrast, and the build-time/runtime distinction.Verification
npm run check && npm run build && npm test— 296/296 green (294 baseline + 2 new). Also drove the built artifact against a real dockercompose manifest to confirm the warning actually reaches stderr and that the unsettable field stays out of the payload.Noted, not fixed (staying in scope)
service_domainson every dockercompose app, so a compose app with no exposed HTTP service still has to declare one. Not touched.Closes #46.
🤖 Generated with Claude Code