Skip to content

fix(python-setup): actionable error for E_MERGE on a [project]-less pyproject - #2180

Merged
rugpanov merged 2 commits into
mainfrom
setup-local-emerge-no-project-table
Sep 9, 2026
Merged

fix(python-setup): actionable error for E_MERGE on a [project]-less pyproject#2180
rugpanov merged 2 commits into
mainfrom
setup-local-emerge-no-project-table

Conversation

@rugpanov

@rugpanov rugpanov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Problem

Automated setup-local fails with E_MERGE / pyproject.toml has no [project] table to hold requires-python on a valid PEP 735 dependency-groups-only manifest — a pyproject.toml that deliberately has no [project] table (e.g. a Databricks Apps repo whose app runtime pip-installs requirements.txt). Reported in #2177.

The "no [project] table…" text comes from the CLI's merge phase (libs/localenv, MergeManagederrNoProjectTable), which refuses to write the runtime's requires-python when there is no [project] table to hold it. That is intentional CLI behaviour, but the extension surfaced it badly:

  • errorMessages.ts gave the generic, non-actionable "Failed to merge the runtime constraints…" copy.
  • reportSetupIssue.ts routed all E_MERGE to databricks/databricks-vscode as a reportable defect — so our own report flow auto-generated issue [setup-local] Unexpected E_MERGE in the merge phase #2177 for a valid, user-fixable manifest shape.

Fix

  • Add isMissingProjectTableFailure(result) — detects this E_MERGE variant by the CLI message (mirroring the existing isIndexUnreachableFailure), scoped to E_MERGE.
  • getPythonSetupErrorMessage returns actionable copy for it: add a minimal [project] table (name, version, requires-python), or set databricks.python.environmentSetup to manual. Generic E_MERGE keeps the neutral copy.
  • formatSetupFailureDetail spells out both fixes in the output channel so the guidance survives the notification being dismissed. No new button — the primary fix is a manual edit.
  • reportRepoForResult excludes this variant, so it no longer prompts a bug report. A generic E_MERGE stays report-worthy.

No new settings, state, telemetry, or commands. Purely presentational + report-routing; generic E_MERGE behaviour is unchanged.

Testing

  • New unit tests for the detector, the message mapping, the detail block, and the report-routing exclusion.
  • Full unit suite, tsc, eslint, and prettier clean on the changed files.

Fixes #2177

This pull request and its description were written by Isaac.

@rugpanov

rugpanov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ failed for b09e1908.
View run

@rugpanov
rugpanov force-pushed the setup-local-emerge-no-project-table branch from b09e190 to 7d8453e Compare September 8, 2026 13:34
@rugpanov

rugpanov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests running for 7d8453e0 — ⏳.
View run

…yproject

*Why*
A valid PEP 735 dependency-groups-only pyproject.toml (no [project] table)
makes the CLI's merge phase fail with E_MERGE / "no [project] table to hold
requires-python" (libs/localenv's errNoProjectTable). The extension surfaced
this as a generic "failed to merge" with no fix, and routed *all* E_MERGE to a
"report this bug" prompt — which is what auto-filed GitHub issue #2177 for a
user-fixable manifest shape.

*What*
- Add isMissingProjectTableFailure(result): detects this E_MERGE variant by the
  CLI message (mirroring isIndexUnreachableFailure), scoped to E_MERGE.
- getPythonSetupErrorMessage now returns actionable copy for it (add a [project]
  table, or switch to manual setup); generic E_MERGE keeps the neutral copy.
- formatSetupFailureDetail spells out both fixes in the output channel so the
  guidance survives the notification being dismissed. No new button (the primary
  fix is a manual edit).
- reportRepoForResult excludes this variant, so it no longer prompts a bug
  report; a generic E_MERGE stays report-worthy.

*Verification*
- New unit tests for the detector, message, detail block, and report-routing
  exclusion; full unit suite passes (the 2 packageJsonUtils pinned-version
  failures are a stale-bin worktree artifact, unrelated).
- tsc, eslint, and prettier clean on the changed files.

Co-authored-by: Isaac <no-reply@databricks.com>
@rugpanov
rugpanov force-pushed the setup-local-emerge-no-project-table branch from 7d8453e to 38d3342 Compare September 8, 2026 13:40
@rugpanov

rugpanov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ failed for 38d3342d.
View run

@rugpanov
rugpanov marked this pull request as ready for review September 8, 2026 15:41
@rugpanov
rugpanov enabled auto-merge (squash) September 9, 2026 16:01
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2180
  • Commit SHA: 009a8fb0773e25baf255be86123ccb06b36592b0

Checks will be approved automatically on success.

@rugpanov
rugpanov merged commit 685670e into main Sep 9, 2026
8 of 9 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 10, 2026
rugpanov added a commit that referenced this pull request Sep 10, 2026
Release **v2.17.0** of the Databricks VS Code extension.

## What's included

- Add a Python environment setup preset picker to choose a Full, DB
Connect, or Python-only environment (#2179)
- Recover from a dependency constraint conflict during Python setup by
offering to retry as a DB Connect environment (#2186)
-   Add recovery UX for Python download failures (#2164)
- Show an actionable error when Python setup hits a merge conflict on a
`pyproject.toml` without a `[project]` table (#2180)
-   Preserve script stdout when an Upload-and-Run file fails (#2171)
- Update Databricks CLI to v1.16.0 (#2175, #2183) — see the [CLI release
notes](https://github.com/databricks/cli/releases) for changes

Changelog curated from the generated output (stripped auto-close refs,
dropped internal telemetry/CI-only items). Tracking: DECO-28498.

---------

Co-authored-by: releasebot <noreply@github.com>
Co-authored-by: @rugpanov <gripanov@gmail.com>
Co-authored-by: Isaac <no-reply@databricks.com>
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.

[setup-local] Unexpected E_MERGE in the merge phase

2 participants