Skip to content

air: reject code_source include_paths entries that match no files - #7639

Draft
dimk0 wants to merge 2 commits into
databricks:mainfrom
dimk0:air-include-paths-unmatched
Draft

dimk0 wants to merge 2 commits into
databricks:mainfrom
dimk0:air-include-paths-unmatched

Conversation

@dimk0

@dimk0 dimk0 commented Nov 15, 2026

Copy link
Copy Markdown
Member

Changes

  • air run: for a working-tree snapshot (no code_source.git), reject code_source.include_paths entries that select no files, and name them, before packaging. Commit-pinned snapshots already reject missing include paths. Entries with glob characters are left to git, since it matches them as patterns.
  • The existing all-entries-empty error from air: refuse to upload an empty code_source snapshot #7570 is unchanged and still fires first.

Why

git ls-files ignores a pathspec that matches nothing, so a mistyped or stale entry was dropped from the snapshot without a warning, --dry-run passed, and the run failed on the node after compute was provisioned. A realistic case is the AI Runtime cookbook's getting-started Ray recipes, which list the shared bootstrap and the recipe directory in include_paths: include_paths: [ray_bootstrap.sh, my_job] for a my-job directory uploaded only ray_bootstrap.sh.

Tests

  • TestSnapshotFiles_RejectsIncludePathMatchingNothingAlongsideOthers: one valid and one mistyped entry; the error names only the mistyped one.
  • TestSnapshotFiles_RejectsIncludePathWhoseFilesAreIgnored: an entry whose files are all git-ignored is rejected with the check-ignore hint.
  • TestSnapshotFiles_AcceptsIncludePathForms: ./src/, a file, and a glob are accepted and select the expected files.
  • The two rejection tests fail without the change. go test ./cmd/air/... and go test ./acceptance -run TestAccept/air pass; golangci-lint run ./cmd/air/... reports no issues.
  • Locally TestLogsCommandRepeatsRunLinkAfterStreaming fails on main too when DATABRICKS_WORKSPACE_ID is exported in the shell (it adds ?o=<id> to the expected link); it passes with the variable unset.

This pull request and its description were written by Isaac.

For a working-tree snapshot, git ls-files silently ignores a pathspec that
matches nothing, so a mistyped or stale include_paths entry was left out of
the snapshot. The run then failed on the node after compute was provisioned.
Commit-pinned snapshots already reject missing include_paths; working-tree
snapshots now do the same before packaging.

Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 15, 2026
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution! This pull request was opened from a fork.

If you're a member of the Databricks organization, please request access to the cli-contrib team and open your pull request from a branch in this repository instead of a fork — fork PRs don't run integration tests automatically and have reduced CI access.

If you're an external contributor, no action is needed; a maintainer will review your pull request.

@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 7639
  • Commit SHA: 68db1468b41d3bfae73f8eb5fa5c08193d3375d1

Checks will be approved automatically on success.

This branch has not been deployed

No deployments
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.

1 participant