Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions .agents/skills/onboard-team-area/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
---
name: onboard-team-area
description: "Onboard a new team or reserve a new code area in the Databricks CLI: add the team to .github/OWNERTEAMS, reserve experimental/<area>/ and acceptance/experimental/<area>/, and map both paths in .github/OWNERS so the maintainer-approval gate routes the area's PRs to the team. Use when the user says 'onboard a team', 'add an OWNERS team', 'reserve an experimental area', 'add a new team to the CLI', or wants a new owned directory wired into review."
description: "Use when onboarding a team, reserving an experimental area, or assigning code ownership in the Databricks CLI through native GitHub CODEOWNERS."
user-invocable: true
allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion
---

# Onboard a team / area into the CLI

How ownership works here: `.github/OWNERS` is CODEOWNERS-style and last-match-wins. `.github/OWNERTEAMS` maps `team:<name>` to an explicit `@member` list and is the source of truth, because the CI token cannot resolve GitHub org-team membership. The `maintainer-approval` workflow is a required check that blocks merge until every owned group a PR touches has at least one approval from one of its owners.
How ownership works here: `.github/CODEOWNERS` uses GitHub's native code-owner reviews. The last matching rule wins, and any owner on that line can approve. Include `@databricks/eng-deco-cli` on every rule so maintainers can approve changes across all areas. Team membership is maintained in GitHub.

Worked example: PR #5605 ("Add ai-training OWNERS team and reserve experimental/air") is exactly the steps below: +1 line in OWNERTEAMS, two `.gitkeep` files, +2 lines in OWNERS.
Enforcement requires "Require review from Code Owners" in the target branch's ruleset. Adding a CODEOWNERS file alone requests reviews but does not require them.

## Inputs (ask if missing)

- Team alias, e.g. `ai-training`, and the `@member` list.
- GitHub team slug, e.g. `eng-ai-custom-training`.
- Area/dir name, e.g. `air`.
- Experimental or stable? This decides where code lands (see the last section).

## Step 1 — Add the team to `.github/OWNERTEAMS`
## Step 1 — Identify the native GitHub team

Append one line, keeping the existing column alignment:
Use the team as `@databricks/<team>`. GitHub requires the team to be visible and have explicit write access to the repository for its approvals to count.

```
team:<name> @member1 @member2 ...
```

If the team has a GitHub team page, add its URL to the header comment block. Skip the URL if the team page does not exist yet; the validator only warns about a missing URL, it does not block.
Use the team slug supplied by the user when they are arranging team creation separately. Verify its access before enabling enforcement.

## Step 2 — Reserve the directories

Expand All @@ -36,29 +32,28 @@ experimental/<area>/.gitkeep
acceptance/experimental/<area>/.gitkeep
```

## Step 3 — Map the paths in `.github/OWNERS`
## Step 3 — Map the paths in `.github/CODEOWNERS`

Add rules under an `# <Area>` comment. Because last-match-wins, specific rules go after the `*` maintainer catch-all:
Add rules under an `# <Area>` comment. Specific rules go after the `*` maintainer catch-all and must repeat the maintainer team:

```
/experimental/<area>/ team:<name>
/acceptance/experimental/<area>/ team:<name>
/experimental/<area>/ @databricks/eng-deco-cli @databricks/<team>
/acceptance/experimental/<area>/ @databricks/eng-deco-cli @databricks/<team>
```

## Step 4 — Validate and open the PR

```bash
# OWNERS parser + approval-logic tests
node --test .github/scripts/owners.test.js .github/workflows/maintainer-approval.test.js
# OWNERS/OWNERTEAMS consistency: undefined teams, zero-owner rules, missing paths
node .github/scripts/owners.js validate
git diff --check
# Repo quick checks (no Go/Python/YAML changed, so the formatters have nothing to do)
./task checks
```

Check that the new paths exist and every new rule includes the maintainer team. Once the branch is pushed, inspect GitHub's CODEOWNERS diagnostics for invalid entries or team permissions.

No `.nextchanges/` entry; this is ownership/config only. Write the PR using the `.github/PULL_REQUEST_TEMPLATE.md` sections (Why / Changes / Tests).

## Experimental vs stable, and graduation

- **Experimental** — code under `experimental/<area>/`, tests under `acceptance/experimental/<area>/`. Register it under the hidden parent in `cmd/experimental/experimental.go`, or top-level in `cmd/cmd.go` with `Hidden: true` (as `ssh` does). Experimental commands still ship enabled in every release; `Hidden` only removes them from `--help`, it does not gate or compile them out. No `.nextchanges/` entries while experimental. To hand a build to testers, push a `bugbash-<topic>` branch (auto-builds a snapshot) and share the `internal/bugbash/exec.sh` one-liner.
- **Graduating to stable** — `git mv` the feature-complete commands to `cmd/<area>/` + `libs/<area>/`, register them top-level in `cmd/cmd.go`, keep the old `experimental` paths as deprecated cobra aliases (`sub.Hidden = true`, `sub.Deprecated = '...'`), add OWNERS rules for the new stable paths, and add a `.nextchanges/` entry. See `experimental/aitools` graduating to top-level `aitools` (PR #4917) as the worked example.
- **Graduating to stable** — `git mv` the feature-complete commands to `cmd/<area>/` + `libs/<area>/`, register them top-level in `cmd/cmd.go`, keep the old `experimental` paths as deprecated cobra aliases (`sub.Hidden = true`, `sub.Deprecated = '...'`), add CODEOWNERS rules for the new stable paths, and add a `.nextchanges/` entry. See `experimental/aitools` graduating to top-level `aitools` (PR #4917) as the worked example.
84 changes: 84 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Maintainers can approve any PR. Keep them on every rule because GitHub uses

@janniklasrose janniklasrose Sep 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File equivalent to old OWNERS but team: replaced with @databricks/.

Created:

  • databricks/eng-deco-cli
  • databricks/eng-deco-dabs
  • databricks/eng-deco-ax
  • databricks/eng-deco-platform

# only the last matching rule, and any owner on that line can approve.
* @databricks/eng-deco-cli

# Bundles
/bundle/ @databricks/eng-deco-cli @databricks/eng-deco-dabs
/cmd/bundle/ @databricks/eng-deco-cli @databricks/eng-deco-dabs
/acceptance/bundle/ @databricks/eng-deco-cli @databricks/eng-deco-dabs
/libs/template/ @databricks/eng-deco-cli @databricks/eng-deco-dabs

# Pipelines
/cmd/pipelines/ @databricks/eng-deco-cli @jefferycheng1 @kanterov @lennartkats-db
/acceptance/pipelines/ @databricks/eng-deco-cli @jefferycheng1 @kanterov @lennartkats-db

# Labs
/cmd/labs/ @databricks/eng-deco-cli @alexott @asnare

# Local environments / DB Connect
/libs/localenv/ @databricks/eng-deco-cli @databricks/eng-deco-ax
/cmd/environments/ @databricks/eng-deco-cli @databricks/eng-deco-ax
/acceptance/localenv/ @databricks/eng-deco-cli @databricks/eng-deco-ax

# Apps
/cmd/apps/ @databricks/eng-deco-cli @databricks/eng-apps-devex
/cmd/workspace/apps/ @databricks/eng-deco-cli @databricks/eng-apps-devex
/libs/apps/ @databricks/eng-deco-cli @databricks/eng-apps-devex
/acceptance/apps/ @databricks/eng-deco-cli @databricks/eng-apps-devex

# Sandbox
/cmd/sandbox/ @databricks/eng-deco-cli @databricks/eng-sandbox
/acceptance/cmd/sandbox/ @databricks/eng-deco-cli @databricks/eng-sandbox

# Auth
/cmd/auth/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/auth/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/acceptance/auth/ @databricks/eng-deco-cli @databricks/eng-deco-platform

# Filesystem & sync
/cmd/fs/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/sync/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/filer/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/sync/ @databricks/eng-deco-cli @databricks/eng-deco-platform

# Core CLI infrastructure
/cmd/root/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/version/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/completion/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/configure/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/cache/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/api/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/selftest/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/cmd/psql/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/psql/ @databricks/eng-deco-cli @databricks/eng-deco-platform

# Libs (general)
/libs/databrickscfg/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/env/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/flags/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/cmdio/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/log/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/telemetry/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/process/ @databricks/eng-deco-cli @databricks/eng-deco-platform
/libs/git/ @databricks/eng-deco-cli @databricks/eng-deco-platform

# Integration tests
/integration/ @databricks/eng-deco-cli @databricks/eng-deco-platform

/integration/cmd/environments/ @databricks/eng-deco-cli @databricks/eng-deco-ax

# Internal
/internal/ @databricks/eng-deco-cli @databricks/eng-deco-platform

# AI tools
/cmd/aitools/ @databricks/eng-deco-cli @databricks/eng-apps-devex @databricks/eng-deco-ax @lennartkats-db
/libs/aitools/ @databricks/eng-deco-cli @databricks/eng-apps-devex @databricks/eng-deco-ax @lennartkats-db

# CLI compatibility manifest
/internal/build/cli-compat.json @databricks/eng-deco-cli @databricks/eng-apps-devex @databricks/eng-deco-platform
/libs/clicompat/ @databricks/eng-deco-cli @databricks/eng-apps-devex @databricks/eng-deco-platform

# Experimental
/experimental/air/ @databricks/eng-deco-cli @databricks/eng-ai-custom-training
/acceptance/experimental/air/ @databricks/eng-deco-cli @databricks/eng-ai-custom-training
/experimental/aitools/ @databricks/eng-deco-cli @databricks/eng-apps-devex @lennartkats-db
83 changes: 0 additions & 83 deletions .github/OWNERS

This file was deleted.

20 changes: 0 additions & 20 deletions .github/OWNERTEAMS

This file was deleted.

Loading
Loading