Skip to content

[AIR] CNXT-2669: offer --output-dir to git-pinned code below the repository top level - #7866

Merged
vinchenzo-db merged 2 commits into
mainfrom
vinchenzo-db/cnxt-2669
Nov 21, 2026
Merged

vinchenzo-db merged 2 commits into
mainfrom
vinchenzo-db/cnxt-2669

Conversation

@vinchenzo-db

@vinchenzo-db vinchenzo-db commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Changes

databricks air convert-to-dabs now offers --output-dir <parent> for a git-pinned code_source whose directory is inside a repository but not its top level. Before, every git-pinned snapshot with code outside the bundle (or with root_path: .) was told only to "move the code inside the bundle directory", although converting with --output-dir pointing at the parent works.

A new predicate, parentOutputDirWorks, is shared by both error paths (codeOutsideBundleError and the root_path: . rejection in codeArtifactFor): a working-tree snapshot can always use the parent; a git snapshot can when git rev-parse --show-prefix is non-empty, since the parent is then still inside the repository. A git-pinned directory at the repository's top level keeps the old message.

Fixes CNXT-2669, found in review of #7644.

Why

The getting-started Ray layout keeps the workload in ray/core with root_path: .. and a git-pinned snapshot. From the bundle directory the conversion failed with an impossible remedy (the code directory can't be moved inside its own subdirectory), while --output-dir .. succeeded. The restriction only ever guarded the case where the code directory is the repository root, so the parent would sit outside the repository.

Tests

  • TestConvertToDabsGitPinOutsideBundleSuggestsOutputDirInRepoSubdir (new): git-pinned ray/ in a repo, workload in ray/core, the error names the parent as --output-dir, and converting there emits the git-pinned artifact.
  • TestConvertToDabsGitPinOutsideBundleDoesNotSuggestOutputDir: the code directory is now a repository top level, and still gets no parent.
  • TestConvertToDabsDotRootPathRejected: adds git-repo-subdir (bundle dir below the repo root, gets the hint) next to git-no-repo (no hint).
  • go test ./cmd/air/ and go test ./acceptance -run TestAccept/air/convert-to-dabs pass locally (two unrelated get/logs tests fail identically on main in this environment); task lint-q is clean.

This pull request and its description were written by Isaac.

…evel

convert-to-dabs refused to name the code directory's parent as an --output-dir
for any git-pinned snapshot, on the assumption that the parent may be outside
the repository. That only holds when the code directory is the repository's
top level; for the getting-started layout (ray/core inside ray/) the error
offered only "move the code inside the bundle directory", although converting
with --output-dir <parent> works.

Add parentOutputDirWorks, one predicate shared by codeOutsideBundleError and
codeArtifactFor: a working-tree snapshot can always use the parent, and a git
snapshot can when `git rev-parse --show-prefix` is non-empty.

Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db
vinchenzo-db requested review from a team as code owners November 21, 2026 03:56
Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 21, 2026

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at b5a217a. Each finding was verified against the code.

No blocking issues found.

This PR adds a parentOutputDirWorks predicate that checks (via git rev-parse --show-prefix) whether a git-pinned code directory is below its repository's top level, and uses that to offer --output-dir with the parent in both the dot-root-path and code-outside-bundle error paths. The logic is correct: both call sites pass the right directory, the subprocess runs only on error paths, and the fallback when git is missing or returns an error is the conservative no-hint behavior. New tests cover the added cases (repo-subdir hint, repo-root no-hint). No correctness issues found.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: b5a217a

Run: 44863738440

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 273 19 3:56
✅​ aws-windows-latest-4core-16gb 275 17 4:07
✅​ azure linux-2core-8gb 272 19 3:41
✅​ azure-windows-latest-4core-16gb 274 17 3:14
✅​ gcp linux-2core-8gb 273 19 3:42
✅​ gcp-windows-latest-4core-16gb 275 17 3:26
Top 3 slowest tests (at least 2 minutes):
duration env testname
4:05 aws-windows-latest-4core-16gb TestAccept
3:24 gcp-windows-latest-4core-16gb TestAccept
3:12 azure-windows-latest-4core-16gb TestAccept

@vinchenzo-db
vinchenzo-db added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit a4388d7 Nov 21, 2026
28 checks passed
@vinchenzo-db
vinchenzo-db deleted the vinchenzo-db/cnxt-2669 branch November 21, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIR Databricks AI Runtime CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants