feat(manifest): declare auto_upgrade so it can be set #27
No reviewers
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle!27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "declare-auto-upgrade-config"
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?
Fixes the error from trying to enable auto-upgrade on celilo-mgr:
Why it failed
I had this half right in #26 and want to correct the record. The read path is unrestricted —
resolveAutoUpgradecallsgetModuleConfigValue(moduleId, 'auto_upgrade'), a plain(moduleId, key)lookup against the config DB with no manifest involvement. But the write path validates:module-config.ts:56-74looks upmanifest.variables.owns[]from the installed module row and rejects any key not declared there. So the key celilo reads was one no operator could set.Declaring the variable closes that gap. After this,
auto_upgradejoins the settable list:type: booleanandsource: userare both valid perVariableTypeSchema/VariableSourceSchema.No default, deliberately
Reads fall back to
false(pickAutoUpgradeendsreturn fromManifest ?? false). I left the declaration defaultless rather than shippingdefault: true, because a module that turns on unattended production deploys for everyone who installs it is making a posture decision that belongs to the operator. The flip stays explicit and per-install.⚠️ This does not take effect on merge
module config setreadsmanifestDataoff the installed module row, not the repo. So the declaration has to reach the host before the key becomes settable. Sequence:.netappcarrying the declaration.celilo module deployto get that manifest onto celilo-mgr.sudo celilo module config set lunacycle auto_upgrade true— now accepted.Step 2 is unavoidable: it's the last manual deploy, and it's what makes the manual deploys stop.
That assumes the registry-poll subscription is executing by then — it currently isn't (
timer.tick.15mfires, noregistry-pollever runs), which is being chased separately in the celilo repo. This PR makes lunacycle's side ready; it doesn't make the poll work.Verified
Manifest parses, and
auto_upgradeappears in the filtered settable-key list — the same computation whose output the error message prints. Unit suite green (58 passed). I could not runcelilo module config setagainst it, since that needs the manifest installed on a host.`celilo module config set` validates the key against the installed manifest's `variables.owns[]`, so the opt-in celilo's registry-poll CD reads was unreachable: $ sudo celilo module config set lunacycle auto_upgrade true Error: Invalid config key 'auto_upgrade' for module lunacycle. Valid keys: hostname, app_port, domain, idp_base_url, ... resolveAutoUpgrade (celilo module-upgrade.ts) reads that exact key back via getModuleConfigValue, which is a plain config-DB lookup — the write path was the only thing blocking it. Declaring the variable closes the gap. No default. Reads fall back to false, so turning on unattended production deploys stays an explicit per-install operator action rather than something this module enables for everyone who installs it. Note this only takes effect once a version carrying it has been published AND deployed: `module config set` reads manifestData off the installed module row, so the declaration has to land on the host before the key becomes settable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>