Skip to content

Improve AIR run log guidance - #6417

Merged
ben-hansen-db merged 7 commits into
mainfrom
ben-hansen/air-run-log-guidance
Aug 31, 2026
Merged

Improve AIR run log guidance#6417
ben-hansen-db merged 7 commits into
mainfrom
ben-hansen/air-run-log-guidance

Conversation

@ben-hansen-db

@ben-hansen-db ben-hansen-db commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Print a copyable air logs command after submission.
  • Preserve the selected profile in generated commands.
  • Print a resumable logs command when air run --watch is interrupted.

Why

Make it obvious how to start or resume log streaming without making --watch the default.

Tests

  • go test ./experimental/air/cmd -run 'Test(RunSubmit|AirLogsCommand|HandleWatchResult|RunWatch)'
  • go test ./acceptance -run 'TestAccept/experimental/air/(run-submit|run-submit-deps)$' -timeout=10m
  • Focused golangci-lint for ./experimental/air/cmd

This PR was written with Codex.

Comment thread acceptance/experimental/air/run-submit-deps/output.txt Outdated
Comment thread experimental/air/cmd/run.go Outdated
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: b73708f

Run: 33222029253

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 1 1 274 1207 4:31
💚​ aws windows 1 1 276 1205 3:32
💚​ azure linux 1 1 273 1207 3:55
💚​ azure windows 1 1 275 1205 3:28
💚​ gcp linux 1 1 274 1207 4:27
💚​ gcp windows 1 1 276 1205 3:31
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:28 aws windows TestAccept
3:26 gcp windows TestAccept
3:24 azure windows TestAccept

@ben-hansen-db
ben-hansen-db force-pushed the ben-hansen/air-run-log-guidance branch from d70816d to 0219af1 Compare August 28, 2026 23:36
@ben-hansen-db
ben-hansen-db marked this pull request as ready for review August 31, 2026 02:47
Comment on lines +118 to +121
if downloadTo != "" || root.OutputType(cmd) == flags.OutputJSON {
return err
}
return handleWatchResult(cmd.OutOrStdout(), cmdctx.WorkspaceClient(ctx).Config.Profile, args[0], err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You need to catch ctrl c before this code block or else you dont actually hit handleWatchResult, something like:

streamCtx := ctx
if downloadTo == "" && root.OutputType(cmd) != flags.OutputJSON {
    var stop context.CancelFunc
    streamCtx, stop = signal.NotifyContext(ctx, os.Interrupt)
    defer stop()
}

err = <something>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch

Tip: use --watch to stream logs until the run completes.
Tip: use --watch when submitting a run to stream logs to your terminal.
Stream logs after submission using:
databricks experimental air logs 555

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dumb question. Let's say a user ctrl c, we catch it but hang, will the user be able to do a second ctrl c to force exit out? If not worth seeing if we can do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah that should be doable

`air logs` called runLogs with the plain context, so Ctrl-C killed the
process before handleWatchResult could print resume guidance — only
`air run --watch` installed a signal handler. Extract that handling into
a shared notifyInterrupt helper and use it on the logs streaming path
(not download/JSON, which keep default handling).

notifyInterrupt calls signal.Stop before cancel so the cancellation is
only observable once SIG_DFL is restored, letting a second Ctrl-C
terminate a hung teardown instead of being buffered and dropped.

Co-authored-by: Isaac <no-reply@databricks.com>
@ben-hansen-db
ben-hansen-db added this pull request to the merge queue Aug 31, 2026
Merged via the queue into main with commit c9c1ee3 Aug 31, 2026
27 checks passed
@ben-hansen-db
ben-hansen-db deleted the ben-hansen/air-run-log-guidance branch August 31, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants