Skip to content

air: Skip purged runs in air list --all-status - #7525

Closed
abdulkareem-db wants to merge 2 commits into
databricks:mainfrom
abdulkareem-db:air-list-skip-purged-runs
Closed

abdulkareem-db wants to merge 2 commits into
databricks:mainfrom
abdulkareem-db:air-list-skip-purged-runs

Conversation

@abdulkareem-db

Copy link
Copy Markdown

Changes

databricks air list --all-status no longer fails when one of the listed runs has been purged. hydrateJobRuns now drops runs that runs/get reports as not existing, the same way it already drops runs the caller can't view (403) or that return 404. The error message for other per-run failures no longer repeats the "failed to get run" prefix.

Why

For a purged run, runs/get returns HTTP 400 INVALID_PARAMETER_VALUE "Run does not exist." rather than 404. The SDK already maps this response to apierr.ErrResourceDoesNotExist, but hydrateJobRuns only checked for 403/404 status codes. One purged run therefore failed the whole errgroup, so air list --all-status exited 1 with nothing listed:

Error: failed to get run 612963592602200: failed to get run 612963592602200: Run 612963592602200 does not exist.

The run ID in the error varied between attempts because whichever concurrent fetch failed first cancelled the batch. The prefix was doubled because fetchJobRun already wraps the error and hydrateJobRuns wrapped it again.

Other errors (auth, 5xx, other 400s) still fail the listing as before. The existing 403/404 status-code check is unchanged.

Tests

  • New unit tests in cmd/air/joblist_test.go against an httptest server, so the SDK's error mapping is exercised:
    • purged (400 "Run … does not exist."), 403 and 404 runs are dropped and the remaining runs keep their order;
    • a 500 and a 400 INVALID_PARAMETER_VALUE with a different message still fail, with a single "failed to get run" prefix.
      Both tests fail on main.
  • go test ./cmd/air/... and go test ./acceptance -run TestAccept/air/list pass.
  • Manually: against a workspace whose run history includes purged runs, v1.25.0 fails as above; this build lists the runs and exits 0.

This pull request and its description were written by Isaac.

abdulkareem-db and others added 2 commits November 11, 2026 22:11
runs/get reports a purged run as 400 INVALID_PARAMETER_VALUE "Run <id>
does not exist.", which the SDK maps to ErrResourceDoesNotExist.
hydrateJobRuns only dropped 403/404, so one purged run failed the whole
listing. Drop ErrResourceDoesNotExist too, and stop wrapping the error a
second time ("failed to get run X: failed to get run X: ...").

Fixes CNXT-2565.

Co-authored-by: Isaac <no-reply@databricks.com>
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: 7525
  • Commit SHA: d939850e725cb2555b809a126adc647db15207a7

Checks will be approved automatically on success.

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

Copy link
Copy Markdown
Author

Closing as a duplicate of #7523, which has the same change.

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