Skip to content

aitools: add --scope flag, deprecate --project/--global#5234

Open
jamesbroadhead wants to merge 3 commits into
jbroadhead/aitools-publicfrom
jb/aitools-interface
Open

aitools: add --scope flag, deprecate --project/--global#5234
jamesbroadhead wants to merge 3 commits into
jbroadhead/aitools-publicfrom
jb/aitools-interface

Conversation

@jamesbroadhead
Copy link
Copy Markdown

Summary

Split out from #4917. While that PR keeps responsibility for moving the aitools skills-management surface out of experimental/, this PR makes the user-facing interface changes that should land at the same moment:

  • New --scope=project|global flag on install/update/uninstall/list, with --scope=both accepted by update and list.
  • --project and --global are marked deprecated via cobra's Deprecated property: hidden from --help, emit a stderr deprecation warning when used, continue to function so existing scripts don't break. They're slated for removal in a later release.
  • --scope combined with --project/--global is rejected up front with an actionable error.
  • install's --help now documents the non-interactive --agents auto-detect contract so callers know what gets picked.

Stacked on #4917. Base will rebase to main once that lands. Splitting because (a) #4917 is otherwise a pure file move and reviewers asked to keep it that way, and (b) the interface change has its own product question (boolean pair vs. enum) worth landing as a discrete unit.

Why land this with the rename

aitools is being declared a stable top-level surface in #4917. This is the cheapest moment to fix the two-boolean shape before external scripts depend on it. An enum is also better for agent-driven invocations than two booleans with implicit precedence: --scope=project|global|both is one flag with valid values, not two flags with order-dependent semantics.

Surface

databricks aitools install   --scope=project|global             (--scope=both rejected)
databricks aitools uninstall --scope=project|global             (--scope=both rejected)
databricks aitools update    --scope=project|global|both
databricks aitools list      --scope=project|global|both        (default: both)

databricks aitools install --project    # warns: use --scope=project
databricks aitools install --global     # warns: use --scope=global

Test plan

  • databricks aitools install --scope=project and --scope=global go to the right destination
  • databricks aitools install --scope=both errors with a clear message
  • databricks aitools install --project still works and prints the deprecation warning to stderr
  • databricks aitools install --scope=global --project errors with the conflict message
  • databricks aitools list --scope=both shows both scopes (equivalent to no flag)
  • databricks aitools install --help no longer shows --project/--global; --scope is documented; --agents auto-detect behavior is described
  • Unit: TestParseScopeFlag (table-driven on the translation), TestInstallScopeFlag, TestListScopeFlag — all green

This pull request was AI-assisted by Isaac.

Replace the two-boolean --project/--global pair on install/update/uninstall/list
with --scope=project|global (and --scope=both on update/list). The old booleans
keep working with a cobra deprecation warning so existing scripts continue to
run; they'll be removed in a later release.

Why now: aitools just left experimental in this PR, so this is the cheapest
moment to fix the interface before external scripts start to depend on the
two-boolean shape. An enum is friendlier for agent-driven invocations than a
pair of booleans with implicit precedence.

Co-authored-by: Isaac
Pin down the contract for non-interactive callers (CI, agents) by
documenting that an unset --agents flag means "install for every detected
agent" outside a TTY. The selected list is already logged to stderr via
PrintInstallingFor before the install runs, so callers can verify what
was picked.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown
Contributor

Approval status: pending

/aitools/ - needs approval

8 files changed
Eligible: @fjakobs, @Shridhad, @atilafassina, @keugenek, @arsenyinfo, @igrekun, @pkosiec, @MarioCadenas, @pffigueiredo, @ditadi, @calvarjorge, @lennartkats-db

General files (require maintainer)

Files: NEXT_CHANGELOG.md
Based on git history:

  • @simonfaltum -- recent work in aitools/cmd/, ./

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Prior run reported "Report generation failed" — known recurring flake
on databricks/cli's deco-tests bridge (PRs #5227, #5228, #5229 all
merged with the same red check on their head). Retriggering via empty
commit to see whether this run lands clean.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant