Skip to content

Strip ambient profile from host-scoped Databricks auth#92

Merged
AarushiShah-db merged 6 commits into
mainfrom
aarushi/fix-databricks-profile-shadowing
May 27, 2026
Merged

Strip ambient profile from host-scoped Databricks auth#92
AarushiShah-db merged 6 commits into
mainfrom
aarushi/fix-databricks-profile-shadowing

Conversation

@AarushiShah-db

@AarushiShah-db AarushiShah-db commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Issue:

  • ucode still keeps ambient DATABRICKS_CONFIG_PROFILE in build_databricks_cli_env().
  • Before ucode resolves a profile, has_valid_databricks_auth(workspace, profile=None) can call databricks auth token --host with
    DATABRICKS_CONFIG_PROFILE=other-workspace still set.
  • I reproduced that locally with a fake databricks binary: has_valid=True and the subprocess saw DATABRICKS_CONFIG_PROFILE=other-workspace.

Change:

  • Updated src/ucode/databricks.py so host-scoped Databricks CLI calls strip ambient DATABRICKS_CONFIG_PROFILE when no explicit profile is being passed.
  • Threaded the explicit profile through has_valid_databricks_auth, run_databricks_login, and get_databricks_token.
  • Added regression tests in tests/test_databricks.py for the stale profile shadowing case.

Validation:

  • uv run pytest tests/test_databricks.py -q → 60 passed
  • uv run ruff check src/ucode/databricks.py tests/test_databricks.py → passed
  • uv run pytest -q → 546 passed, 25 skipped
  • uv run ruff check . → passed

@AarushiShah-db AarushiShah-db requested a review from rohita5l May 26, 2026 21:19
@AarushiShah-db AarushiShah-db force-pushed the aarushi/fix-databricks-profile-shadowing branch 2 times, most recently from 4eb7bd3 to 35e6d92 Compare May 26, 2026 21:41

@rohita5l rohita5l left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@AarushiShah-db Changes in agents/databricks.py looks good but confused about changes in agents/codex.py

rohita5l
rohita5l previously approved these changes May 27, 2026
@rohita5l

Copy link
Copy Markdown
Collaborator

@AarushiShah-db approved the PR. but will need to resolve the merge conflicts

@AarushiShah-db AarushiShah-db force-pushed the aarushi/fix-databricks-profile-shadowing branch 2 times, most recently from e8e7fcc to 37be74d Compare May 27, 2026 19:00
@AarushiShah-db AarushiShah-db force-pushed the aarushi/fix-databricks-profile-shadowing branch from 37be74d to df992de Compare May 27, 2026 19:02
@AarushiShah-db AarushiShah-db merged commit a9916db into main May 27, 2026
2 checks passed
@AarushiShah-db AarushiShah-db deleted the aarushi/fix-databricks-profile-shadowing branch May 27, 2026 21:01
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.

2 participants