Skip to content

experimental/air: open MLflow URLs via libs/browser instead of pkg/browser - #6752

Merged
pietern merged 1 commit into
mainfrom
air-browser-fix
Sep 21, 2026
Merged

pietern merged 1 commit into
mainfrom
air-browser-fix

Conversation

@pietern

@pietern pietern commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Changes

air list's TUI opened the selected run's MLflow URL with github.com/pkg/browser directly. Switch it to libs/browser.Open(ctx, url), threading the fetcher's context through to the call site.

Why

pkg/browser ignores the BROWSER env var, so BROWSER=none and custom browser commands break. libs/browser is the repo's required wrapper for opening URLs.

Tests

go build, go vet, go test ./experimental/air/cmd -run TestListModel (11/11), and the air acceptance suite pass.

This pull request and its description were written by Isaac.

… env var support

Replace direct usage of github.com/pkg/browser with github.com/databricks/cli/libs/browser
to properly respect the BROWSER environment variable. This allows BROWSER=none and custom
browser commands to work correctly.

- Convert openURL from a standalone function to a method on listModel to access the context
- Use browser.Open(ctx, url) with the proper context from the fetcher
- Extract context before creating the closure to avoid use-after-free (closure captures value, not receiver)
- Check for nil fetcher at call site, consistent with other interactive key handlers
- Preserve best-effort behavior by ignoring errors
Co-authored-by: Isaac <no-reply@databricks.com>
@pietern
pietern enabled auto-merge September 18, 2026 11:31
@pietern pietern added the AIR Databricks AI Runtime CLI label Sep 18, 2026
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 5bda4e5

Run: 35340060457

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 15 5:49
✅​ aws windows 278 13 4:16
✅​ azure linux 275 15 5:58
✅​ azure windows 277 13 4:06
✅​ gcp linux 276 15 7:24
✅​ gcp windows 278 13 4:04
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:54 aws windows TestAccept
3:51 azure windows TestAccept
3:41 gcp windows TestAccept

ctx := m.fetcher.ctx
return func() tea.Msg {
_ = browser.OpenURL(url)
_ = browser.Open(ctx, url)

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.

A data race occurs and is printed by pressing Enter twice quickly. Bubble Tea runs both browser commands concurrently, while openDefault mutates global browserpkg.Stderr. Please guard the save/set/open/restore sequence

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.

That is a preexisting issue.

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.

The change here exposes this potential race, but it is difficult to trigger or reproduce with a normal opener. will leave as non-blocking.

@pietern
pietern requested a review from caroline-db September 21, 2026 06:38
@pietern
pietern added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit 9237f8a Sep 21, 2026
40 checks passed
@pietern
pietern deleted the air-browser-fix branch September 21, 2026 13:24
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 9237f8a

Run: 35605478220

Env ❌​FAIL 🔄​flaky ✅​pass 🙈​skip Time
🔄​ aws linux 3 1642 1079 241:12
✅​ aws windows 1546 1104 253:00
❌​ azure linux 3 2 1453 1128 204:38
✅​ azure windows 1359 1153 215:09
✅​ gcp linux 1444 1132 232:12
🔄​ gcp windows 3 1342 1157 250:59
9 interesting tests: 6 flaky, 3 FAIL
Test Name aws linux azure linux gcp windows
❌​ TestAccept 🔄​f ❌​F 🔄​f
🔄​ TestAccept/bundle/config-remote-sync/target_override ✅​p 🔄​f 🙈​s
🔄​ TestAccept/bundle/config-remote-sync/target_override/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true ✅​p 🔄​f
🔄​ TestAccept/bundle/invariant/no_drift ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=vector_search_index.yml.tmpl/READPLAN=1 ✅​p ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate 🔄​f 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DATABRICKS_BUNDLE_ENGINE=terraform/DMS= 🔄​f
❌​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name ✅​p ❌​F ✅​p
❌​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name/DATABRICKS_BUNDLE_ENGINE=direct/DMS= ✅​p ❌​F ✅​p
Top 50 slowest tests (at least 2 minutes):
duration env testname
14:59 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
14:07 gcp windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
13:43 gcp linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
13:30 gcp linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
11:14 gcp windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
9:30 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
9:03 aws windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
8:56 aws linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
8:36 gcp linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
8:33 aws linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
8:18 gcp linux TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
8:08 azure linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
8:07 gcp linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
8:06 gcp linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:58 aws windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:46 azure windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:41 gcp linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
7:40 gcp linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:40 aws windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:34 gcp linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=
7:30 azure windows TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:28 azure linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:27 gcp linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
7:26 aws linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:16 azure linux TestAccept/bundle/resources/apps/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:14 gcp linux TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:08 gcp windows TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:06 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
7:02 azure linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
7:01 gcp windows TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
6:59 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
6:42 gcp linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
6:40 aws windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
6:33 gcp linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
6:30 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
6:24 azure windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
6:19 gcp linux TestAccept/bundle/config-remote-sync/multiple_resources/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
6:15 gcp windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
6:11 aws linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
6:00 azure linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
5:59 gcp linux TestAccept/bundle/resources/apps/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
5:58 aws linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
5:55 aws linux TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
5:55 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform/DMS=
5:43 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
5:42 gcp linux TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true
5:37 azure windows TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
5:32 azure linux TestAccept/bundle/resources/clusters/lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
5:29 gcp windows TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DATABRICKS_BUNDLE_ENGINE=direct/DMS=
5:26 gcp windows TestAccept/bundle/resources/apps/lifecycle-started-omitted/DATABRICKS_BUNDLE_ENGINE=direct/DMS=true

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