Repository navigation
aitools: mention databricks aitools install in version --check #7471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * `databricks version --check` now suggests `databricks aitools install` on stderr when a coding agent is detected without the Databricks plugin or skills. ([#7471](https://github.com/databricks/cli/pull/7471)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,18 +4,52 @@ import ( | |
| "context" | ||
|
|
||
| "github.com/databricks/cli/libs/cmdio" | ||
| "github.com/databricks/cli/libs/dbr" | ||
| "github.com/databricks/cli/libs/log" | ||
| "github.com/databricks/cli/libs/telemetry/protos" | ||
| "github.com/databricks/databricks-sdk-go/useragent" | ||
| ) | ||
|
|
||
| // skillsTipText is the tip printed by PrintSkillsTip and MaybeVersionCheckTip. | ||
| const skillsTipText = "Tip: coding agents detected without Databricks skills. Run 'databricks aitools install' to install them." | ||
|
|
||
| // PrintSkillsTip prints the non-interactive `apps init` tip to install skills | ||
| // and records that it was shown. Callers decide whether the tooling is missing | ||
| // (see HasDatabricksToolingInstalled). | ||
| func PrintSkillsTip(ctx context.Context) { | ||
| cmdio.LogString(ctx, "Tip: coding agents detected without Databricks skills. Run 'databricks aitools install' to install them.") | ||
| cmdio.LogString(ctx, skillsTipText) | ||
| logHintShown(ctx, protos.AitoolsHintKindAppsInitTip) | ||
| } | ||
|
|
||
| // MaybeVersionCheckTip prints skillsTipText after `databricks version --check` | ||
| // when a coding agent is detected without Databricks tooling. Claude Code | ||
| // callers are skipped because MaybeHint already covers them, with its | ||
| // per-session throttle. installedPlugins is a parameter because this package | ||
| // cannot import the installer; callers pass installer.InstalledTools. No | ||
| // telemetry is logged: `databricks version` never resolves auth, so the event | ||
| // would not be uploaded (see logHintShown). | ||
|
Comment on lines
+24
to
+30
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] This 18-line doc comment lists every early return, which
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shortened in 9dd6d21. The doc comment now covers only the three points you listed: Claude Code is skipped because |
||
| func MaybeVersionCheckTip(ctx context.Context, installedPlugins func(context.Context) []string) { | ||
| if useragent.AgentProvider() == claudeAgentProvider { | ||
| return | ||
| } | ||
| if dbr.HasDetection(ctx) && dbr.RunsOnRuntime(ctx) { | ||
| return | ||
| } | ||
| if HasDatabricksToolingInstalled(ctx) || len(installedPlugins(ctx)) > 0 { | ||
| return | ||
| } | ||
| // Recorded plugins are checked above, so DatabricksTooling only needs the | ||
| // agent's own manifest, its skills dir and the project dirs up to the | ||
| // repository root. | ||
| noRecordedPlugin := func() bool { return false } | ||
| for _, a := range Registry { | ||
| if a.DatabricksTooling(ctx, noRecordedPlugin) != ToolingNone { | ||
| return | ||
| } | ||
| } | ||
| cmdio.LogString(ctx, skillsTipText) | ||
| } | ||
|
|
||
| // RecommendSkillsInstall checks if coding agents are detected without Databricks tooling (skills | ||
| // or the databricks plugin) installed. | ||
| // In interactive mode, prompts the user to install now using installFn. In non-interactive mode, prints a hint. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]sethomechanges only HOME. Agent detection also readsCLAUDE_CONFIG_DIR,XDG_CONFIG_HOME,GEMINI_CLI_HOME,PI_CODING_AGENT_DIR,GOOSE_PATH_ROOTandAPPDATA. The harness clears only the agent signal variables, such asCLAUDECODE. So on a machine withCLAUDE_CONFIG_DIRset, this case and the one at line 7 can print a different stderr, and the golden file does not match. The script unsetsCLAUDE_CONFIG_DIRonly before the Claude Code case (line 27). Unset these variables at the top of the script.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 7cd9908. The script now unsets
CLAUDE_CONFIG_DIR,XDG_CONFIG_HOME,GEMINI_CLI_HOME,PI_CODING_AGENT_DIR,GOOSE_PATH_ROOTandAPPDATAat the top, so every case sees only the committed homes. This is the same listclearAgentDirOverridesuses in the installer tests. The separateunset CLAUDE_CONFIG_DIRbefore the Claude Code case is gone. Checked locally withCLAUDE_CONFIG_DIRandXDG_CONFIG_HOMEset on the host: the golden output still matches.