fix(blocknode): honor --values plugins.names via "no override" preset#799
Open
alex-au wants to merge 1 commit into
Open
fix(blocknode): honor --values plugins.names via "no override" preset#799alex-au wants to merge 1 commit into
alex-au wants to merge 1 commit into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes interactive block-node installs/upgrades where an operator-provided --values file setting plugins.names could be silently overridden by the TUI plugin preset selection. It introduces a “no override” preset (none) and a values-file probe so that (when plugins.names is managed via --values) the prompt defaults to not injecting a preset-derived plugin list, preserving Helm values precedence.
Changes:
- Add a
PresetNone = "none"option to the plugin preset prompt that resolves to an empty plugin list (soinjectPluginsConfigbecomes a no-op). - Add
ValuesFileDefinesPlugins(path)and use it to smart-default the interactive preset to “none” when the--valuesfile definesplugins.names, and to guard upgrade re-resolution from state. - Update CLI/docs/model comments and add unit tests for the new preset contract + values-file detection.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/models/inputs.go | Document none as a “no override” plugin-preset value. |
| internal/ui/prompt/blocknode.go | Add valuesFile param and smart-default preset to none when the values file defines plugins.names. |
| internal/blocknode/values.go | Add ValuesFileDefinesPlugins helper used by prompt and upgrade guard. |
| internal/blocknode/blocknode_plugins.go | Add PresetNone, label, and ordered menu entry; keep it out of preset maps so it resolves to empty list. |
| internal/blocknode/blocknode_plugins_test.go | Add tests for PresetNone contract and ValuesFileDefinesPlugins. |
| cmd/cli/commands/block/node/init.go | Pass --values path into prompt; skip upgrade re-resolve when values file defines plugins. |
| cmd/cli/commands/common/flags_blocknode.go | Update --plugin-preset flag help text to include none. |
| docs/quickstart.md | Document --plugin-preset none semantics in quickstart flags table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a3b2ed2 to
34451eb
Compare
An interactive block-node install silently ignored a --values file that set
plugins.names: the TUI always pre-selected a preset (tier1-lfh) and offered no
"use my values file" option, so the resolved plugin list was never empty and
injectPluginsConfig overwrote the merged values-file list after the deep-merge.
Implement precedence flags/TUI (explicit) > values.yaml > chart default by
letting the resolution produce an empty plugin list when the operator did not
explicitly choose plugins:
- Add PresetNone ("none") that resolves to an empty list (deliberately not in
any Presets map, so IsKnownPreset is false and PluginListForPreset returns "").
An empty list makes injectPluginsConfig a no-op, so the merged
values-file/chart-default plugins.names survives. Its TUI label reads
"Use Values File / Chart Default (no override)", matching the wording issue
#731 itself proposes: outcome first (what gets deployed), mechanism second
(no preset override) — avoiding "override" as the headline, which read as
ambiguous (override by what, of what) during manual UAT.
- Smart-default the interactive prompt to PresetNone when the --values file
defines plugins.names, so the file wins unless the operator picks a preset.
- Guard the non-interactive upgrade state re-resolve so it does not clobber a
values-managed plugin list, while still applying the chart-version plugin
rename (0.35 s3-archive -> cloud-storage-*) when plugins are not values-managed.
ValuesFileDefinesPlugins treats the plugins.names key as "values-managed" the
moment it is present, regardless of its value: an explicit empty string, empty
list, or null all count. This matters because Helm's chartutil.CoalesceTables
treats an operator-set null as an instruction to delete the chart's default
plugins.names entirely, which is just as deliberate an operator choice as
setting a concrete list and must not be overwritten by a preset-derived one.
injectPluginsConfig and mergeValues are unchanged. --plugin-preset none is also
a valid scripted "no override" value.
Closes #731
Signed-off-by: alex-au <alex.w.aus@gmail.com>
34451eb to
a069145
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A block-node
--valuesfile that setsplugins.nameswas silently ignored on aninteractive install. The plugin-preset prompt always pre-selected a preset (default
tier1-lfh) and offered no "use my values file" option, so the resolved plugin list wasnever empty — and
injectPluginsConfigthen overwrote the values-fileplugins.namesafter the deep-merge (PR #703) had correctly let it win. Operators who set
plugins.namesin
--valuesgot the preset bundle deployed instead, a silent divergence between intentand what actually ran.
This PR implements the precedence flags/TUI (explicit) >
values.yaml> chart defaultby letting the resolution produce an empty plugin list when the operator did not
explicitly choose plugins. An empty list already makes
injectPluginsConfiga no-op, sothe merged values-file (or chart-default)
plugins.namessurvives untouched.injectPluginsConfigandmergeValuesare unchanged.Files changed
internal/blocknode/blocknode_plugins.goPresetNone = "none"+ label + menu entry; deliberately not in anyPresetsmap →IsKnownPreset("none")=false, resolves to""internal/blocknode/values.goValuesFileDefinesPlugins(path)(error-tolerant; scalar or YAML-sequenceplugins.names)internal/ui/prompt/blocknode.goRunPluginPresetPromptsgains avaluesFileparam; smart-defaults toPresetNonewhen the file definesplugins.namescmd/cli/commands/block/node/init.goflagValuesFileto the prompt; upgrade re-resolve guard now&& !ValuesFileDefinesPlugins(...)pkg/models/inputs.go,cmd/cli/commands/common/flags_blocknode.go,docs/quickstart.mdnoneonPluginPreset/ the--plugin-presetflaginternal/blocknode/blocknode_plugins_test.goPresetNoneregistry contract andValuesFileDefinesPluginsBehavior
-fdefiningplugins.names→ prompt now lists andpre-selects "Use Values File / Chart Default"; accepting it deploys the file's list.
--plugins/--plugin-presetstill suppress the prompt and win (flags beat the file).--plugin-preset noneis a valid scripted "no override" value.-fplugins / no explicit choice → unchanged (tier1-lfhdefault; scripted → chart default).upgrade: a values-managedplugins.namesis no longer clobbered by the saved-statere-resolve, while the chart-version plugin rename still applies when plugins are not
values-managed.
Review guide
Code-review checklist
PresetNoneis absent from everyblockNodePluginHistory[*].Presetsmap →IsKnownPreset("none")==false,PluginListForPreset("none",…)==""(
internal/blocknode/blocknode_plugins.go).PresetNoneleaves*flagPluginsempty — the existing Pass-2!= PresetCustomearly return handles it (internal/ui/prompt/blocknode.go).init.goresolution:PresetNone→pluginList=="", so neither the--plugins requirederror nor thecustompromotion triggers(
cmd/cli/commands/block/node/init.goresolve block).plugins; otherwise the
0.35 s3-archive → cloud-storage-*rename still applies.tier1-lfh/state default only when the values fileactually defines
plugins.names(common no--fcase unchanged).injectPluginsConfig/mergeValuesuntouched.Test commands
Manual UAT (VM) — verified end-to-end ✅
full
tier1-lfhlist minusbackfill:binary on
PATH, not./bin/...):sudo solo-provisioner install sudo solo-provisioner block node install -p local \ --namespace bn --release-name bn --chart-version 0.37.0 \ --base-path /opt/bn --historic-retention 0 --recent-retention 96000 \ -f /tmp/myvalues.yaml0.37.0is the newest chart version published toghcr.io/hiero-ledger/hiero-block-nodeat time of writing; pick whatever is current.)
option and pre-selects it:
--plugin-preset tier1-lfh(or--plugins a,b) — noprompt appears and the preset/flag list is deployed, overriding the file.
-ffile that has noplugins.names(or no-f) — the prompt defaults to Tier 1 — Local Full History as before.--force --plugin-preset none -f /tmp/myvalues.yamldeploysthe file's
plugins.nameswith no prompt.Risks / rollback
Low. The interactive default only changes when the
--valuesfile definesplugins.names;all other flows are unchanged, and
injectPluginsConfig/mergeValuesare untouched.Rollback = revert the
PresetNoneadditions, the prompt smart-default line, and theupgrade-guard clause.
Stacking note
Builds on merged PR #703 (deep-merge custom
--valuesover the embedded profile base),which is what lets a values-file
plugins.namessurvive the merge in the first place.Related Issues
plugins.namesfrom--valuesis ignored; honor precedence flags/TUI >values.yaml> chart default #731