Skip to content

[AIR] CNXT-2679: warn in dry-run when command uses a path relative to code_source - #7865

Open
vinchenzo-db wants to merge 8 commits into
mainfrom
vinchenzo-db/cnxt-2679
Open

vinchenzo-db wants to merge 8 commits into
mainfrom
vinchenzo-db/cnxt-2679

Conversation

@vinchenzo-db

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

Copy link
Copy Markdown
Contributor

Changes

databricks air run --dry-run now prints a warning when command (or a container's command) refers to a snapshot file by a path relative to code_source.root_path, for example python train.py when train.py is in the snapshot. The warning suggests $CODE_SOURCE_PATH/<file> and links the command section of the YAML config reference, per cloud, from the same configDocsBases that air run -h config uses:

Warning: command refers to "train.py", a path relative to code_source.root_path. Consider "$CODE_SOURCE_PATH/train.py" instead. See how command paths and $CODE_SOURCE_PATH work:
  AWS:   https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/cli/yaml-config#command
  Azure: https://learn.microsoft.com/azure/databricks/machine-learning/ai-runtime/connecting/cli/yaml-config#command

The check is local and dry-run only, and runs after the snapshot file selection succeeds. It matches command words against the files the snapshot would actually package (working tree or pinned commit, after include_paths), so it only suggests a path for a file that is actually packaged. Words that reference $CODE_SOURCE_PATH, absolute paths and NAME=value assignments are skipped; --flag=value is checked by its value; scanning stops at cd / pushd. Runs are submitted unchanged. The snapshot counting helper used by the dry run now returns the file list (listSnapshotFiles), and the count is its length.

Why

Fixes CNXT-2679: at runtime the workload command runs from the job's working directory, not from the extracted code snapshot, so python train.py passes --dry-run and the workspace-side config:validate but fails with "No such file or directory" only after the run has waited for a GPU (11.6 min wall time for 0 s of user code in the CUJ PE64 runthrough). Catching the relative path locally, before submission, saves that cycle. This mirrors the existing local torch-import warning in cmd/air/torchcheck.go.

Tests

  • Unit tests in cmd/air/scriptpathcheck_test.go cover bare, ./-prefixed, quoted and nested paths, --flag=value and --flag value, $CODE_SOURCE_PATH usage, absolute paths, environment assignments, files outside include_paths or the snapshot, ../ paths, directories, cd / (cd / pushd forms, and container commands.
  • TestListFilesAtCommit (renamed from the count test) checks the listed paths for the repo root, a root_path subtree and include_paths.
  • New acceptance case in acceptance/air/run (relative-script.yaml) showing the warning in dry-run output; torch-standard.yaml already covers the no-warning path for $CODE_SOURCE_PATH. The non-git-subdir.yaml fixture uses the $CODE_SOURCE_PATH form so its output stays about what it tests.
  • go test ./cmd/air/ ./acceptance -run 'TestAccept/air/', task lint-q and task ws pass locally.

Hard-coded values

~/loop/bin/cli-check is clean. The warning no longer states how the runtime behaves (an earlier version said the runtime working directory is not the code directory). It now says only what the CLI can see locally (the command names a path relative to code_source.root_path), suggests $CODE_SOURCE_PATH, and links the public docs, which own the runtime behavior ("Paths in the command refer to remote file paths in the workload container. When code_source is set, $CODE_SOURCE_PATH contains the absolute path to the extracted code."). How the command string is split into words is the CLI's own local parsing.

Review notes

  • review-oss-bot round 1 asked to skip the token after a --flag; declined at the time because a relative flag value fails the same way at runtime. Round 2 asked for --flag=value and --flag value to behave the same, which is now the case: both are checked by their value.
  • review-oss-bot round 3 asked whether scanning should also stop after a directory flag whose value references $CODE_SOURCE_PATH (env -C, uv run --directory, --chdir, --cwd). Not applied: that adds a tool-specific flag list to maintain for an advisory line, and cd / pushd cover the documented way to change directory. A false warning in those forms costs one line of output.
  • review-oss-bot question: why dry-run only, when the torch warning fires on every run. Intentional for this fix: the ticket asks for --dry-run to catch this locally, and the change deliberately leaves the submission path untouched.

This pull request and its description were written by Isaac.

… code_source

`air run --dry-run` now warns when `command` refers to a file by a path
relative to `code_source.root_path` (for example `python train.py`). At
runtime the working directory is not the extracted code directory, so such
a run only fails after waiting for a GPU. The warning suggests
`$CODE_SOURCE_PATH/<file>` instead. Runs are submitted unchanged.

Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db
vinchenzo-db requested review from a team as code owners November 21, 2026 03:46
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
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 1d783c39e | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (1ea5591) latest (v1.27.0)
TestAccept/air/run ✅ ❌ ❌
TestAccept/air/run: branch ✅ | main (1ea5591) ❌ | latest (v1.27.0) ❌

main (1ea5591):

acceptance_test.go:1402: Diff:
        --- air/run/output.txt
        +++ /tmp/TestAcceptairrun3844446276/002/output.txt
        @@ -117,9 +117,6 @@
         === a script path relative to root_path warns to use CODE_SOURCE_PATH
         
         >>> [CLI] air run -f relative-script.yaml --dry-run
        -Warning: command refers to "train.py", a path relative to code_source.root_path. Consider "$CODE_SOURCE_PATH/train.py" instead. See how command paths and $CODE_SOURCE_PATH work:
        -  AWS:   https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/cli/yaml-config#command
        -  Azure: https://learn.microsoft.com/azure/databricks/machine-learning/ai-runtime/connecting/cli/yaml-config#command
         Dry run: code_source snapshot would include 1 file(s).
         Dry run: configuration for "smoke-test" is valid; not submitting.
         
        
FAIL

latest (v1.27.0):

acceptance_test.go:1402: Diff:
        --- air/run/output.txt
        +++ /tmp/TestAcceptairrun1321247010/002/output.txt
        @@ -66,17 +66,11 @@
         === include_paths entry that selects no files is rejected (json)
         
         >>> [CLI] air run -f include-unmatched.yaml --dry-run -o json
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "INVALID_ARGS",
        -    "kind": "PERMANENT",
        -    "message": "code_source include_paths select no files under [TEST_TMP_DIR]: data. Check that these paths exist under root_path and hold files git does not ignore (`git check-ignore -v \u003cfile\u003e` shows the rule for a file); empty directories, nested git repositories and submodules add no files",
        -    "retryable": false
        -  }
        -}
        +Error: code_source include_paths select no files under [TEST_TMP_DIR]: data. Check that these paths exist under root_path and hold files git does not ignore (`git check-ignore -v <file>` shows the rule for a file); empty directories, nested git repositories and submodules add no files
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === include_paths pathspec that selects files outside root_path is rejected
         
         >>> [CLI] air run -f include-outside-root.yaml --dry-run
        @@ -117,9 +110,6 @@
         === a script path relative to root_path warns to use CODE_SOURCE_PATH
         
         >>> [CLI] air run -f relative-script.yaml --dry-run
        -Warning: command refers to "train.py", a path relative to code_source.root_path. Consider "$CODE_SOURCE_PATH/train.py" instead. See how command paths and $CODE_SOURCE_PATH work:
        -  AWS:   https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/cli/yaml-config#command
        -  Azure: https://learn.microsoft.com/azure/databricks/machine-learning/ai-runtime/connecting/cli/yaml-config#command
         Dry run: code_source snapshot would include 1 file(s).
         Dry run: configuration for "smoke-test" is valid; not submitting.
         
        @@ -146,31 +136,19 @@
         === invalid config is rejected (json)
         
         >>> [CLI] air run -f invalid.yaml --dry-run -o json
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "INVALID_ARGS",
        -    "kind": "PERMANENT",
        -    "message": "invalid experiment_name \"bad.name\": only alphanumeric characters, hyphens (-), and underscores (_) are allowed",
        -    "retryable": false
        -  }
        -}
        +Error: invalid experiment_name "bad.name": only alphanumeric characters, hyphens (-), and underscores (_) are allowed
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === dry-run without credentials reports an authentication error (json)
         
         >>> env -u DATABRICKS_HOST -u DATABRICKS_TOKEN [CLI] air run -f valid.yaml --dry-run -o json
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "UNAUTHENTICATED",
        -    "kind": "PERMANENT",
        -    "message": "no default profile is set: pass --profile (-p) or configure a default profile in your .databrickscfg",
        -    "retryable": false
        -  }
        -}
        +Error: default auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method. Config: databricks_cli_path=[CLI]. Env: DATABRICKS_CLI_PATH
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === dry-run without credentials keeps the original error in text mode
         
         >>> env -u DATABRICKS_HOST -u DATABRICKS_TOKEN [CLI] air run -f valid.yaml --dry-run
        @@ -182,45 +155,24 @@
         === submit without credentials reports an authentication error (json)
         
         >>> env -u DATABRICKS_HOST -u DATABRICKS_TOKEN [CLI] air run -f valid.yaml -o json
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "UNAUTHENTICATED",
        -    "kind": "PERMANENT",
        -    "message": "no default profile is set: pass --profile (-p) or configure a default profile in your .databrickscfg",
        -    "retryable": false
        -  }
        -}
        +Error: default auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method. Config: databricks_cli_path=[CLI]. Env: DATABRICKS_CLI_PATH
         
         === dry-run reports an over-long idempotency key before missing credentials (json)
         
         >>> env -u DATABRICKS_HOST -u DATABRICKS_TOKEN [CLI] air run -f valid.yaml --dry-run -o json --idempotency-key aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "INVALID_ARGS",
        -    "kind": "PERMANENT",
        -    "message": "idempotency token must be 64 characters or less, got 65",
        -    "retryable": false
        -  }
        -}
        +Error: idempotency token must be 64 characters or less, got 65
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === dry-run with an unknown profile is a permanent config error (json)
         
         >>> env -u DATABRICKS_HOST -u DATABRICKS_TOKEN DATABRICKS_CONFIG_FILE=profiles.databrickscfg [CLI] air run -f valid.yaml --dry-run -o json -p does-not-exist
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "INVALID_ARGS",
        -    "kind": "PERMANENT",
        -    "message": "resolve: profiles.databrickscfg has no does-not-exist profile configured. Config: profile=does-not-exist, config_file=profiles.databrickscfg, databricks_cli_path=[CLI]. Env: DATABRICKS_CONFIG_FILE, DATABRICKS_CLI_PATH",
        -    "retryable": false
        -  }
        -}
        +Error: resolve: profiles.databrickscfg has no does-not-exist profile configured. Config: profile=does-not-exist, config_file=profiles.databrickscfg, databricks_cli_path=[CLI]. Env: DATABRICKS_CONFIG_FILE, DATABRICKS_CLI_PATH
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === bundle diagnostics are reported once (json)
         
         >>> [CLI] air run -f ../valid.yaml --dry-run -o json
        @@ -244,17 +187,11 @@
         >>> [CLI] air run -f ../valid.yaml --dry-run -o json --idempotency-key aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
         Error: multiple targets are marked as default ([TARGETS])
         
        -{
        -  "v": 1,
        -  "ts": "[TIMESTAMP]",
        -  "error": {
        -    "code": "INVALID_ARGS",
        -    "kind": "PERMANENT",
        -    "message": "idempotency token must be 64 characters or less, got 65",
        -    "retryable": false
        -  }
        -}
        +Error: idempotency token must be 64 characters or less, got 65
         
        +Tip: use the --debug flag to see more details and a trace of this error:
        +  databricks --debug air run …
        +
         === unknown field suggests the near match
         
         >>> [CLI] air run -f unknown-field.yaml --dry-run
        @@ -282,23 +218,8 @@
         === removed pool field is rejected
         
         >>> [CLI] air run -f removed-pool.yaml --dry-run
        -Error: invalid config removed-pool.yaml: line 6: unknown field "compute.pool_id"; did you mean "accelerator_pool_id"? Run "databricks air run -h config.compute" for the list of fields
        +Dry run: configuration for "smoke-test" is valid; not submitting.
         
        -Tip: use the --debug flag to see more details and a trace of this error:
        -  databricks --debug air run …
        +Unexpected success
         
        -=== unsupported priority is rejected
        -
        ->>> [CLI] air run -f invalid-priority.yaml --dry-run
        -Error: compute.priority_class: invalid priority_class "HIGH": valid values are: NORMAL
        -
        -Tip: use the --debug flag to see more details and a trace of this error:
        -  databricks --debug air run …
        -
        -=== priority without a pool is rejected
        -
        ->>> [CLI] air run -f priority-without-pool.yaml --dry-run
        -Error: compute.priority_class requires compute.accelerator_pool_id — priority applies only within a GPU Pool
        -
        -Tip: use the --debug flag to see more details and a trace of this error:
        -  databricks --debug air run …
        +Exit code: 1
        
FAIL

@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 0d006ee. Each finding was verified against the code.

No blocking issues found. 1 non-blocking comment(s) and 1 question(s) below.

This PR adds a dry-run warning when command refers to a file by a path relative to code_source.root_path, helping users avoid a "No such file or directory" failure after waiting for a GPU. The implementation is a clean heuristic in scriptpathcheck.go with good unit and acceptance test coverage. One minor gap in the token-level flag-value detection could produce a false-positive warning for the space-separated flag form, and two reviewers independently questioned why the warning is scoped to --dry-run only when the analogous torch check fires unconditionally.

Questions

  1. The warning fires only during --dry-run (line 174, inside the if dryRun block), while the analogous missingTorchWarning (line 168) fires unconditionally for every run. Both checks are local and credential-free. Should relativeScriptWarning also fire on actual submissions, so a user who runs air run -f workload.yaml without --dry-run still sees the warning before waiting for a GPU? (non-blocking)

Comment thread cmd/air/scriptpathcheck.go Resolved
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 1d783c3

Run: 45273523817

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 20 14:08
💚​ aws-windows-latest-4core-16gb 1 274 18 9:54
💚​ azure linux-2core-8gb 1 271 20 13:21
💚​ azure-windows-latest-4core-16gb 1 273 18 6:46
💚​ gcp linux-2core-8gb 1 272 20 11:23
💚​ gcp-windows-latest-4core-16gb 1 274 18 10:48
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 24 slowest tests (at least 2 minutes):
duration env testname
6:30 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
4:43 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
4:17 gcp-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
4:06 aws linux-2core-8gb TestAccept
4:04 aws-windows-latest-4core-16gb TestAccept
3:45 azure-windows-latest-4core-16gb TestAccept
3:38 gcp-windows-latest-4core-16gb TestAccept
3:33 aws linux-2core-8gb TestFilerReadWrite/workspace_files
3:26 gcp linux-2core-8gb TestAccept
3:25 azure linux-2core-8gb TestLock
3:22 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
3:22 azure linux-2core-8gb TestAccept
3:11 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files
2:52 aws-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:52 gcp linux-2core-8gb TestImportDirDoesNotOverwrite
2:46 gcp linux-2core-8gb TestFilerWorkspaceNotebook/scalaNb.scala
2:41 azure linux-2core-8gb TestFilerRecursiveDelete/workspace_files
2:39 azure linux-2core-8gb TestImportDirWithOverwriteFlag
2:30 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
2:14 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:13 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
2:08 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsStat
2:07 gcp-windows-latest-4core-16gb TestFilerWorkspaceNotebook/rJupyterNb.ipynb
2:06 aws linux-2core-8gb TestLock

Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck.go Resolved
Scanning stops at a `cd` word, so `cd "$CODE_SOURCE_PATH" && python train.py`
no longer warns. Container commands get the same check, since each container
receives the same code source.

Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 89bbf70. Each finding was verified against the code.

No blocking issues found. 5 non-blocking comment(s) below.

This PR adds a local check to air run --dry-run that warns when command names a file relative to code_source.root_path and suggests $CODE_SOURCE_PATH/<file>. The idea is sound, but the check looks at the local working tree rather than at the snapshot that gets uploaded, so it can suggest a path that will also fail. The word-by-word matching also produces false warnings for some cd forms, behaves differently on Windows, and treats --flag=value differently from --flag value. None of these break existing behavior, since the output is only a warning.

Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/run.go Resolved
The warning now matches command words against the files the snapshot would
package (working tree or pinned commit, after include_paths), so it fires only
when `$CODE_SOURCE_PATH/<file>` will exist, and runs after snapshot selection
succeeds. It also checks `--flag=value` values, skips `NAME=value` assignments,
stops at `pushd` and `(cd`, and treats a leading `/` as absolute on every OS.

Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 af65bcd. Each finding was verified against the code.

No blocking issues found. 3 non-blocking comment(s) below.

This PR makes air run --dry-run warn when command or a container command names a snapshot file by a path relative to code_source.root_path, and suggests $CODE_SOURCE_PATH/<file>. To feed the check, the snapshot count helpers now return file lists. The approach is reasonable. One edge case changed in the pinned-commit path: when ls-tree prints nothing, the dry run now reports 1 file where it used to report 0. The heuristic also warns on a few commands that change directory without cd.

Comments outside the changed lines

  • [nice to have] cmd/air/scriptpathcheck.go:139: Scanning only stops at a bare cd/pushd, so commands that set the working directory another way still warn. Examples are env -C "$CODE_SOURCE_PATH" python train.py and uv run --directory "$CODE_SOURCE_PATH" python train.py: the $ word is skipped, train.py matches, and the user is told a run that works "may fail". Should scanning also stop after a directory flag whose value references $CODE_SOURCE_PATH (-C, --directory, --chdir, --cwd), or is that not worth it?

Comment thread cmd/air/snapshot_git.go Resolved
Comment thread cmd/air/snapshot_git_test.go Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 3acf5b9. Each finding was verified against the code.

No blocking issues found. 1 non-blocking comment(s) below.

This PR adds a dry-run warning when command (or a container's command) refers to a snapshot file by a path relative to code_source.root_path. To support it, the snapshot count helper now returns the file list. The listing refactor and the warning look right for the cases the tests cover. One gap: a quoted --flag="value" keeps its opening quote, so that form never warns.

Comment thread cmd/air/scriptpathcheck.go Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 d1d5274. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) below.

This PR adds a dry-run warning when command or a container command refers to a snapshot file by a path relative to code_source.root_path, and changes the snapshot counting helper so it returns the file list. The listing change and its tests look right. The word splitting in the new check gives false warnings on some common shell forms, including the &&cd form that the cd stop is supposed to handle. One unit test case is also mislabeled.

Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck_test.go Resolved
Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 52b1d5a. Each finding was verified against the code.

No blocking issues found. 2 non-blocking comment(s) below.

This PR adds a dry-run warning when command or a container's command names a snapshot file by a path relative to code_source.root_path. It also changes the snapshot counting helper so it returns the list of files. The plumbing through listSnapshotFiles / listFilesAtCommit looks correct. I have two notes on the tokenizer. A # comment ends the scan for the whole multi-line command, so a commented first line hides the warning entirely. The container label also doesn't match how validation names containers.

Comment thread cmd/air/scriptpathcheck.go Resolved
Comment thread cmd/air/scriptpathcheck.go Resolved
…ime behavior

Co-authored-by: Isaac <no-reply@databricks.com>
@vinchenzo-db

Copy link
Copy Markdown
Contributor Author

/review

@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 1d783c3. Each finding was verified against the code.

No blocking issues found.

This PR makes air run --dry-run warn when command (or a container's command) names a packaged snapshot file by a path relative to code_source.root_path, and suggests $CODE_SOURCE_PATH/<file>. To support that, the snapshot counting helpers now return the file list. I traced the word scan, the cd/pushd/comment handling, the git and working-tree listing paths, and the tests, and found nothing that should block the merge. The check runs only on dry runs and misses some directory-changing forms, but the description says both are deliberate, and it only ever adds an advisory line.

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.

3 participants