Repository navigation
feat(init): infer the preset from .talm-preset.lock - #266
Asish (NopeCharon) wants to merge 1 commit into
Conversation
`talm init --update` without --preset resolved the preset only from Chart.yaml dependencies, which an init'd project does not record, so the bare form always failed and every remediation hint had to carry a literal `<preset>` placeholder. The preset pinned in .talm-preset.lock now serves as the last link of the inference chain: --preset flag, then Chart.yaml dependencies, then the lock. The fallback applies only when Chart.yaml is readable but names no preset; an unreadable or malformed Chart.yaml still errors, and a project without a lock keeps the previous error and hint. A locked preset unknown to the binary is rejected before any write, like an unknown Chart.yaml preset. CheckChartDrift reads the lock best-effort and substitutes the real preset name into its remediation hint, matching the preset-drift message. A missing, corrupt or preset-less lock leaves the placeholder and never fails the check. Docs (upgrading guide, manual test plan) describe the new chain. Closes cozystack#220 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Closes #220.
talm init --updatewithout--presetonly looked at Chart.yaml dependencies, which an init'd project does not record, so the bare form always failed. The preset pinned in.talm-preset.lockis now the last link of the chain:--preset→ Chart.yaml dependencies → lock.CheckChartDriftreads the lock best-effort and puts the real preset name in its remediation hint instead of<preset>. A missing, corrupt or preset-less lock keeps the placeholder and never fails the check.docs/operations/upgrading.mdand the manual test plan describe the new chain.Tests:
TestInitUpdate_PresetFromLock,TestInitUpdate_UnknownLockPreset_FailsBeforeWrites,TestCheckChartDrift_LockNamesPreset_HintCarriesPreset,TestCheckChartDrift_UnusableLock_HintKeepsPlaceholder.go test ./pkg/commands/passes.Summary by CodeRabbit
talm init --updatecan now use the preset recorded in the project’s lock file when no preset option or chart dependency is provided.