Repository navigation
[AECO-1834] fix(build-studio): show forwarded dr xp flags in help and add plugin-update progress spinner - #1097
Anton Bogatyrov (antonbogatyrov) wants to merge 3 commits into
Conversation
… plugin updates (AECO-1834) Two UX gaps in the released dr build-studio command: - `dr build-studio -h` only listed its own -y/--yes flag, hiding every flag forwarded to dr xp (feature flags, --port, …). The help now appends the installed xp plugin's --help output under a "Flags forwarded to dr xp:" section, or a `dr xp --help` hint when the plugin is not installed yet (it is never installed just for help). - Accepting the pre-launch plugin update prompt ran the whole backup → download → extract → validate cycle silently, so the terminal looked frozen while the archive downloaded. The prompt path now wraps RunPluginUpdate in tui.RunWithSpinner, matching `dr plugin update`. This also covers updates triggered by plain plugin passthrough runs such as `dr xp`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Matt Nitzken (mjnitz02)
left a comment
There was a problem hiding this comment.
So I ran this through a QA pipeline and heres the results:
QA failed on one test. Of 8 tests: 6 passed, 1 failed, 1 was flaky.
The failure (test 6). With the real xp plugin installed and no DataRobot login set up, dr build-studio --help opens the interactive login wizard instead of printing xp's flags.
- When the output goes through a pipe, it hangs on that hidden wizard.
- If you quit the wizard, it prints "Failed to configure the DataRobot URL" and still exits 0, with no xp help shown.
- Cause: xp's manifest has "authentication": true, and plugin.ExecutePlugin checks auth before it passes --help on (internal/plugin/exec.go:115). Plain dr xp --help already behaves this way. The new help path
is what exposes it in build-studio.
- The forwarding itself works. With dr --skip-auth build-studio --help, xp 2.5.0's real flags show up correctly.
- Likely fix: run xp's --help without the auth check, or show the "Run dr xp --help" hint when the user isn't logged in.
What passed:
- Help with no xp installed shows the "flags are forwarded" note, for both --help and -h.
- Help never installs the plugin.
- --port 9000 --help still shows the help.
- Accepting an update shows the new spinner (⣾ Updating xp from 2.4.0 to 2.5.0…) and then "✓ Updated xp to 2.5.0".
- Declining the update shows no spinner and leaves xp on 2.4.0.
So I think we need to fix the --help command when a user isn't logged in
…flight (AECO-1834) QA found that with xp installed but no DataRobot login configured, `dr build-studio --help` opened the interactive login wizard instead of printing xp's flags — and hung when the output was piped. The cause: xp's manifest sets "authentication": true, and ExecutePlugin runs the deps and auth preflight before forwarding --help. Add plugin.WithoutPreflight(), an ExecOption that skips both checks, and use it on the help-rendering path: help must never prompt. Covered by a test asserting the auth endpoint is never contacted when the preflight is skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the thorough QA run Matt Nitzken (@mjnitz02)! Fixed in 7b31419:
Note: plain |
Code OwnershipAgent Ecosystem
Agent Lifecycle
Review requested from the teams above. Labels will be removed automatically upon approval. |
Victor Borshak (victorborshak)
left a comment
There was a problem hiding this comment.
LGTM
There was a problem hiding this comment.
LGTM as well but Anton Bogatyrov (@antonbogatyrov) please add a tiny bit of docs re: what "preflight" means itself, I don't want to have to assume what it means reading the code.
Something in the plugin docs, a docstring on execOptions.withoutPreflight, maybe on the method itself.
Plugin preflight is the set of readiness checks ExecutePlugin runs before it launches the plugin subprocess. It makes sure the plugin's declared dependencies are installed (offering to install them, unless consent was pre-approved with WithDepsConsent or -y), and that the user is authenticated when the manifest sets authentication: true (unless skip_auth is set). Both checks can prompt interactively.
| err := tui.RunWithSpinner( | ||
| fmt.Sprintf("Updating %s from %s to %s…", | ||
| result.PluginName, result.InstalledVersion, result.LatestVersion.Version), | ||
| func() error { | ||
| return RunPluginUpdate( | ||
| result.PluginName, | ||
| result.InstalledVersion, | ||
| result.RegistryPlugin, | ||
| *result.LatestVersion, | ||
| result.BaseURL, | ||
| ) | ||
| }, |
| // WithoutPreflight skips the dependency and authentication checks before the | ||
| // plugin runs. Use it for non-functional invocations such as rendering the | ||
| // plugin's --help: those must never open an interactive prompt (login wizard, | ||
| // dependency install), which would hang when the output is piped. | ||
| func WithoutPreflight() ExecOption { | ||
| return func(o *execOptions) { o.skipPreflight = true } | ||
| } | ||
|
|
There was a problem hiding this comment.
Just a small nit, I think we should actually explain what "Preflight" is, in a non-negative sense.
Here, or as a docstring on execOptions.skipPreflight, and in dev docs.
"Plugin preflight
There was a problem hiding this comment.
Good call — added in ff415e6: WithoutPreflight's docstring now defines the preflight (deps check + auth check, both can prompt), execOptions.skipPreflight points at it, and docs/development/plugins.md got a Preflight section tying the term to the execution steps and the build-studio --help use case. Used your wording as the base, thanks for drafting it!
Review feedback on #1097: the term appeared only in WithoutPreflight's name. Its docstring now defines the preflight (deps check + auth check, both interactive), the skipPreflight field points at it, and docs/development/plugins.md gets a Preflight section tying it to the execution steps and the build-studio --help use case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RATIONALE
Follow-up to #1019 / #1074 (AECO-1834). Two UX gaps surfaced after releasing
dr build-studio:dr build-studio -honly showed the command's own-y/--yesflag, while every other flag is forwarded todr xp. Users had no way to discover the xp feature flags (--enable-assist,--enable-byo-mcp,--port, …) from build-studio's help.dr plugin updatealready wraps the sameRunPluginUpdatein a spinner — the prompt path incmd/plugin/shared/update.godid not.CHANGES
cmd/build-studio/cmd.go: after printing its own help, the command appends the installed xp plugin's--helpoutput under a "Flags forwarded to dr xp:" section. When xp is not installed yet, it prints a hint pointing atdr xp --helpinstead — the plugin is never installed just to render help.cmd/plugin/shared/update.go:performPluginUpdatenow wrapsRunPluginUpdateintui.RunWithSpinner("Updating <name> from X to Y…"), matchingdr plugin update. Since this prompt path is shared by all plugin passthrough commands, updates triggered by plaindr xpruns get the spinner too.NOTES
Verified locally:
go build,go test -raceon affected packages,golangci-lint(0 issues), and a manualdr build-studio -hrun showing the full xp flag list.PR Automation
Comment-Commands: Trigger CI by commenting on the PR:
/trigger-smoke-testor/trigger-test-smoke- Run smoke tests/trigger-install-testor/trigger-test-install- Run installation testsLabels: Apply labels to trigger workflows:
run-smoke-testsorgo- Run smoke tests on demand (only works for non-forked PRs)🤖 Generated with Claude Code