Prompt re-login on setup-local session expiry instead of a hard error - #2163
Merged
Conversation
Contributor
Author
|
🤖 Integration tests ❌ 1 of 41 test jobs failed for |
rugpanov
had a problem deploying
to
test-trigger-is
August 31, 2026 14:35 — with
GitHub Actions
Error
rugpanov
force-pushed
the
rugpanov/setup-local-relogin-prompt
branch
from
September 1, 2026 08:10
cef25ac to
915168b
Compare
rugpanov
had a problem deploying
to
test-trigger-is
September 1, 2026 08:12 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests triggered for |
rugpanov
force-pushed
the
rugpanov/setup-local-relogin-prompt
branch
from
September 1, 2026 08:28
915168b to
0050a09
Compare
rugpanov
had a problem deploying
to
test-trigger-is
September 1, 2026 08:29 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests triggered for |
*Why* When `databricks environments setup-local` aborts because the active profile's session can no longer be refreshed, the extension surfaced the raw CLI text as a hard error with a "Report this problem" affordance and force-revealed the output channel. An expired session is an expected, self-service condition, not a defect worth reporting. *What* - Add `isReauthRequiredError`, a precision-tuned matcher for the CLI's reauthenticate signal: it requires the CLI's own `databricks auth login` remediation plus a matching cause (whitespace-normalized, hyphen-tolerant). - Use it as a positive gate in the setup-local spawn/parse catch: on a match, show a re-login prompt (a warning with a "Login" button that runs the extension's existing re-auth command) and record the run as not report-worthy (`not_started`, `reportOffered: false`). Anything else -- a genuine defect or a transient network failure -- falls through to the existing report path, so a false negative is never worse than today's behavior and a network error is never mislabeled as expiry. - No log reveal, no auto-retry -- the user re-runs setup after logging in. - A gateway-to-matcher integration test pins the CLI-stderr format the gate keys on, so a change to either side fails in tests, not in production. *Verification* - yarn build (tsc) passes; full unit suite passes (1034 passing), incl. the matcher (positive/negative/precision), the controller gate (reauth vs report-path), the deps prompt, and the gateway integration test; yarn test:lint clean (the lone MOCHA_GREP warning is pre-existing in runTest.ts). Co-authored-by: Isaac <no-reply@databricks.com>
rugpanov
force-pushed
the
rugpanov/setup-local-relogin-prompt
branch
from
September 1, 2026 08:34
0050a09 to
c2ddf84
Compare
rugpanov
had a problem deploying
to
test-trigger-is
September 1, 2026 08:34 — with
GitHub Actions
Error
Contributor
Author
|
🤖 Integration tests ✅ all 41 test jobs passed for |
rugpanov
marked this pull request as ready for review
September 1, 2026 09:13
misha-db
approved these changes
Sep 1, 2026
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
rugpanov
had a problem deploying
to
test-trigger-is
September 1, 2026 13:01 — with
GitHub Actions
Error
rugpanov
added a commit
that referenced
this pull request
Sep 2, 2026
…ray showError signature (#2165) ## Why `main` is red. Both **VSCode Extensions CI** and **Publish nightly release** fail at the packaging typecheck (`tsc --build --force`) at tip commit 3ebc920 (#2163) with: ``` PythonSetupEnvironmentSetup.test.ts(598,48): error TS2322: Type 'PythonSetupErrorAction[] | undefined' is not assignable to type 'PythonSetupErrorAction | undefined'. PythonSetupEnvironmentSetup.test.ts(629,33): error TS2322: (same) ``` #2163 changed `showError`'s third parameter from a single `PythonSetupErrorAction` to `PythonSetupErrorAction[]`. Every sibling test in the file was migrated to the plural `actions` / `actions?.[0]` form, but two tests were missed and still typed the parameter as a single `PythonSetupErrorAction`. It's a test-only, compile-time type mismatch — no product code is involved. ## What In the two lagging tests, adopt the exact array shape the rest of the file already uses: - *"prompts re-login (no report)…"* — `shownErrors` field `action?: PythonSetupErrorAction` → `actions?: PythonSetupErrorAction[]`; callback param `action` → `actions`. - *"reports a spawn/parse defect…"* — `shown` field likewise; callback param `action` → `actions`; assertion `shown[0].action?.label` → `shown[0].actions?.[0].label`. No product behaviour changes. ## Verification - `yarn build` (`tsc --build --force`) compiles clean — exit 0, no TS errors. - All 53 `PythonSetupEnvironmentSetup` unit tests pass in the VS Code test host, including both previously-failing tests. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When
databricks environments setup-localaborts because the active profile's session can no longer be refreshed, the extension surfaced the raw CLI text as a hard error notification (which VS Code decorates with "Report this problem") and force-revealed the setup output channel. An expired session is an expected, self-service condition — the user just needs to log in again — not a defect worth reporting.What
isReauthRequiredError, a precision-tuned matcher for the CLI's reauthenticate signal. It requires both the CLI's owndatabricks auth loginremediation and a matching cause (reauthenticate/re-authenticate/refresh token is invalid/access token could not be retrieved), with whitespace normalized so a cause split across lines still matches.catch: on a match, show a re-login prompt — a warning (not an error) with a Login button that runs the extension's existing re-auth flow (databricks.connection.configureLogin) — and record the run as not report-worthy (not_started,reportOffered: false). No log-channel reveal and no auto-retry: the user re-runs setup once connected.Testing
authErrorsmatcher: positive cases (verbatim CLI abort, hyphenated spelling, whitespace-split cause, case-insensitive) and precision negatives (generic parse error, network/host mention, index-fetch failure, cause-without-remediation, empty/non-string).not_started/reportOffered: false); a no-signal abort stays on the report path.yarn build, full unit suite (1034 passing), andyarn test:lintall pass.Note
An earlier revision of this branch used an SDK session probe; it was replaced with this positive-gate matcher after review flagged that a blind probe misclassifies transient network failures as an expired session.
This pull request and its description were written by Isaac.