Repository navigation
[AIR] CNXT-2669: offer --output-dir to git-pinned code below the repository top level - #7866
Merged
Merged
Conversation
…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>
Co-authored-by: Isaac <no-reply@databricks.com>
Contributor
Author
|
/review |
pardis-beikzadeh-db
approved these changes
Nov 21, 2026
There was a problem hiding this comment.
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.
Collaborator
✅ Integration test reportCommit: b5a217a
Top 3 slowest tests (at least 2 minutes):
|
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.
Changes
databricks air convert-to-dabsnow offers--output-dir <parent>for a git-pinnedcode_sourcewhose directory is inside a repository but not its top level. Before, every git-pinned snapshot with code outside the bundle (or withroot_path: .) was told only to "move the code inside the bundle directory", although converting with--output-dirpointing at the parent works.A new predicate,
parentOutputDirWorks, is shared by both error paths (codeOutsideBundleErrorand theroot_path: .rejection incodeArtifactFor): a working-tree snapshot can always use the parent; a git snapshot can whengit rev-parse --show-prefixis 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/corewithroot_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-pinnedray/in a repo, workload inray/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: addsgit-repo-subdir(bundle dir below the repo root, gets the hint) next togit-no-repo(no hint).go test ./cmd/air/andgo test ./acceptance -run TestAccept/air/convert-to-dabspass locally (two unrelatedget/logstests fail identically on main in this environment);task lint-qis clean.This pull request and its description were written by Isaac.