fix(plugin/install): thread cmd through confirmPluginDepsInstall - #810
Open
ajalon1 wants to merge 1 commit into
Open
fix(plugin/install): thread cmd through confirmPluginDepsInstall#810ajalon1 wants to merge 1 commit into
ajalon1 wants to merge 1 commit into
Conversation
This was referenced Aug 20, 2026
ajalon1
force-pushed
the
aj/fix-plugin-install-yes-flag
branch
from
August 20, 2026 21:31
c0eb480 to
1d9d3b9
Compare
ajalon1
force-pushed
the
aj/fix-plugin-install-yes-flag
branch
2 times, most recently
from
August 21, 2026 06:01
7ff6c8c to
e3e5760
Compare
ajalon1
marked this pull request as ready for review
August 21, 2026 06:04
ajalon1
force-pushed
the
aj/fix-plugin-install-yes-flag
branch
from
August 21, 2026 16:17
e3e5760 to
25590f9
Compare
Replace the package-level yesFlag variable with proper cmd threading. confirmPluginDepsInstall now receives the real *cobra.Command and calls cli.IsNonInteractive(cmd) directly, which checks --yes via cmd.Flags(), the NON_INTERACTIVE env var, and viperx in priority order. Previously, passing nil to IsNonInteractive fell back to the weaker viperx-only path and the package-level yesFlag was shared state that could leak across successive Execute calls in the same process. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
ajalon1
force-pushed
the
aj/fix-plugin-install-yes-flag
branch
from
August 21, 2026 19:31
25590f9 to
beb8a68
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.
RATIONALE
Part of the RootFactory stack (#802, #803).
confirmPluginDepsInstallwas closing over a package-levelyesFlagvariable and passingniltocli.IsNonInteractive, bypassing the proper flag-read path.When
cmd == nil,IsNonInteractivefalls back to the weakerviperx.GetBool(YesFlagName)path instead of reading the flag directly from the command. The package-levelyesFlagis also shared state that leaks across successiveExecute()calls in tests or any harness that re-uses the same process.CHANGES
var yesFlag bool; re-register the flag viacmd.Flags().BoolP(no package-level binding)*cobra.Commandthrough:runInstall→runInstallFromRegistry/runInstallFromFile/runInstallFromURL→checkAndInstallPluginDeps→confirmPluginDepsInstallyesFlag || cli.IsNonInteractive(nil)withcli.IsNonInteractive(cmd), which checks--yesviacmd.Flags(), theNON_INTERACTIVEenv var, andviperxin priority ordermakeCmd(t, yes bool)helper, remove allorigYesFlag/defercleanup patternsNote
Low Risk
Small CLI plumbing refactor for non-interactive confirmation; no auth, install, or dependency-install logic changes beyond how
--yesis read.Overview
Stops plugin-install dep confirmation from using a package-level
yesFlagandcli.IsNonInteractive(nil), which skipped the real--yesflag path and leaked state acrossExecute()calls.--yesis now registered without a package binding.runInstallthreads*cobra.Commandthrough the file/URL/registry install paths intoconfirmPluginDepsInstall, which usescli.IsNonInteractive(cmd)so--yes, env, and viper are resolved in the intended order. Tests use amakeCmdhelper instead of mutating global flag state.Reviewed by Cursor Bugbot for commit e3e5760. Configure here.