Promote aitools from experimental to top-level command#4917
Open
jamesbroadhead wants to merge 11 commits intomainfrom
Open
Promote aitools from experimental to top-level command#4917jamesbroadhead wants to merge 11 commits intomainfrom
jamesbroadhead wants to merge 11 commits intomainfrom
Conversation
The aitools command is feature-complete after the 5-PR series (#4810-#4814) that added state tracking, install/update/uninstall/list/version commands, and project scope support. Move it to a top-level `databricks aitools` command so it is discoverable without knowing the `experimental` prefix. The old `databricks experimental aitools` path is preserved as a hidden deprecated alias for backward compatibility. Co-authored-by: Isaac
Add the new top-level aitools entry to the expected help output. Co-authored-by: Isaac
Approval status: pending
|
Member
|
I think we should move the code itself (the files) out of experimental as part of this as well. |
- cobra's Deprecated only fires on the executed leaf command, so running
'databricks experimental aitools install' or any other subcommand under
the alias produced no warning. Set a PersistentPreRunE on the alias
root that prints to stderr; that hook is inherited by every subcommand.
- After promoting aitools to a top-level command, every user-facing tip
("Run 'databricks experimental aitools install' to get started", etc.)
was steering people back to the deprecated path. Update version.go,
installer.go, update.go, uninstall.go, recommend.go, the per-command
Examples in discover_schema.go/query.go/get_default_warehouse.go, and
the README to use the canonical 'databricks aitools' form. Update
recommend_test.go and update_test.go assertions to match.
Co-authored-by: Isaac
The null-count SQL interpolated DESCRIBE-reported column names directly into a backtick-quoted identifier. A column whose name contained a backtick (rare in real catalogs but legal under Spark's identifier syntax) could break out of the identifier and inject SQL when this command was run against an attacker-controllable schema. Extract the loop into buildNullCountExprs so it can be unit-tested, double every backtick before interpolation per Spark's identifier-quote escape rule, and add a regression test that covers plain, single-tick, and double-tick column names. Co-authored-by: Isaac
…blic # Conflicts: # cmd/experimental/experimental.go # experimental/aitools/README.md # experimental/aitools/cmd/discover_schema.go # experimental/aitools/cmd/discover_schema_test.go # experimental/aitools/cmd/query.go
Per Simon's review on #4917, the source files should live outside experimental/ now that aitools is a top-level command. Renames the directory from experimental/aitools/ to aitools/ and updates all import paths, examples, and tooling references (Makefile, OWNERS, testmask, pr-checklist). The experimental/aitools alias still routes to the same package via its new import path, so 'databricks experimental aitools' continues to work as a deprecated entry point. Co-authored-by: Isaac
Defining PersistentPreRunE on the deprecated aitools alias shadowed the root command's hook (cobra's default EnableTraverseRunHooks=false walks up and stops at the first one). Subcommands of 'databricks experimental aitools' lost their cmdio/log/user-agent init and panicked with "no cmdIO found in the context". Chain to the root hook explicitly so the deprecation warning still prints and the rest of CLI initialization runs. Reproducer (before): 'databricks experimental aitools version' panics. After: prints warning, then version output. Co-authored-by: Isaac
3 tasks
…blic # Conflicts: # .agent/skills/pr-checklist/SKILL.md # Makefile # tools/testmask/targets.go
Co-authored-by: Isaac
The skills-management surface (install/update/uninstall/list/version/skills)
graduates to top-level `databricks aitools`. The `tools` subtree
(query/discover-schema/get-default-warehouse/statement) keeps its
"no stability guarantees" disclaimer per `tools.go`, so it stays under
`databricks experimental aitools tools` for now.
The deprecation warning under `experimental aitools` fires for the skills
surface (which has a top-level replacement) but NOT for `tools` subcommands
(no top-level alternative exists). Cobra picks the nearest ancestor's
PersistentPreRunE, so attaching tools with its own non-warning hook
overrides the alias's warning hook for tools-rooted invocations.
- aitools/cmd/aitools.go: drop tools wiring; export NewToolsCmd
- cmd/experimental/experimental.go: attach tools to alias with non-warning
PreRunE that still chains to root
- aitools/cmd/{query,discover_schema,get_default_warehouse,statement_*}.go:
revert example strings back to `experimental aitools tools …`
- aitools/README.md: split into stable (skills) and experimental (tools)
sections
- NEXT_CHANGELOG.md: clarify which surface graduates
Co-authored-by: Isaac
This was referenced Apr 29, 2026
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.
Summary
databricks aitools:install,update,uninstall,list,version, and the (hidden)skillsalias groupHidden: truefrom those commands so they show up underdatabricks --helpdatabricks experimental aitools <skill-cmd>as a hidden, deprecated alias that prints a warning pointing users at the new pathdatabricks experimental aitools tools(query, discover-schema, get-default-warehouse, statement) under experimental for now — that subtree's own help text says "There are no stability guarantees for these tools," so it shouldn't graduate yettoolssubcommands (which don't)The aitools skills-management surface is feature-complete after the 5-PR series (#4810–#4814) that added state tracking, lifecycle commands (install/update/uninstall/list/version), and project scope support. The
toolssubtree is functionally useful but its shape is still in flux, so promoting only the stable half.Command shape after this PR
Implementation note for reviewers: cobra picks the nearest ancestor's
PersistentPreRunE, so attachingtoolsunder the experimental alias with its own non-warning hook overrides the alias's deprecation warning for tools-rooted invocations. Both hooks chain to the root'sPersistentPreRunEso IO/log/user-agent setup is preserved.Test plan
databricks aitools --helpshows install/update/uninstall/list/version (notools)databricks --helplistsaitoolsin the outputdatabricks experimental aitools installprints deprecation warning, runs, and the work happensdatabricks experimental aitools tools query …does NOT print the warningdatabricks experimental aitools tools --helplists query/discover-schema/get-default-warehouse/statementThis pull request was AI-assisted by Isaac.