environments setup-local: consolidate databricks-connect to a single managed pin - #6255
Open
rugpanov wants to merge 2 commits into
Open
environments setup-local: consolidate databricks-connect to a single managed pin#6255rugpanov wants to merge 2 commits into
rugpanov wants to merge 2 commits into
Conversation
…managed pin setup-local managed databricks-connect only in [dependency-groups].dev, so a databricks-connect requirement shipped by a template in [project].dependencies conflicted with the managed dev pin and left the project unresolvable — `uv sync` failed with an unsatisfiable-resolution error. In the install flow, databricks-connect is now fully owned by setup-local: after the managed pin lands in the dev group, every other databricks-connect pin is removed from [project].dependencies, each [project.optional-dependencies] extra, and every dependency group, so exactly one requirement survives. Each removed pin is surfaced with the new W_DBCONNECT_CONSOLIDATED warning. --constraints-only leaves databricks-connect untouched. parseClause now also models ==X.* prefix-match wildcards so a conflict between a wildcard user pin and the environment's constraint-dependencies is reported instead of silently missed. Co-authored-by: Isaac
Contributor
Approval status: pending
|
…log fragment Code review found that consolidation could silently delete an inline comment that belonged to a surviving element: splitTopLevelElements groups the text after a comma into the next element's token, so a trailing comment on the element before a removed databricks-connect pin was dropped with it, violating MergeManaged's comment-preservation contract. removeDbconnectFromArraySpan now carries those leading comment lines onto the next retained token so they stay on their line. Also drop the .nextchanges fragment: environments setup-local is still unreleased (its own fragment is pending), so this fix lands in the same release that introduces the command — a separate changelog entry would be redundant. Co-authored-by: Isaac
rugpanov
force-pushed
the
setup-local-dbconnect-reconcile
branch
from
August 12, 2026 14:45
403aed4 to
d528701
Compare
Collaborator
Integration test reportCommit: d528701
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 8 slowest tests (at least 2 minutes):
|
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.
Problem
databricks environments setup-localmanageddatabricks-connectonly inside[dependency-groups].dev. When a project (e.g. one generated from the data-engineering template) also pinsdatabricks-connectin[project].dependencies, setup-local set the dev pin to the compute-matched version but left the[project].dependenciespin untouched. uv then had to co-install two disjoint requirements (==15.1.*and>=16.0,<17) and failed with a cryptic unsatisfiable-resolution dump at theprovisionphase. A warning meant to catch this never fired (it couldn't parse==X.*wildcards), and warnings are advisory anyway.Change
In the install flow,
databricks-connectis now fully owned by setup-local:[dependency-groups].dev, a new consolidation pass (removeStrayDatabricksConnect) removes every otherdatabricks-connectpin — from[project].dependencies, each[project.optional-dependencies]extra, and every dependency group — so exactly one requirement survives. Each removed pin is surfaced with the newW_DBCONNECT_CONSOLIDATEDwarning (naming the location).--constraints-onlymode leavesdatabricks-connectcompletely untouched.parseClausenow models PEP 440==X.*prefix-match wildcards, so a conflict between a wildcard user pin and the environment'sconstraint-dependenciesis reported (W_DBCONNECT_PIN_DUPLICATED/W_USER_CONSTRAINT_CONFLICT) rather than silently missed.The consolidation preserves the file's other bytes: a comment on a surviving element (or the array's opening line) is kept when an adjacent
databricks-connectelement is removed. The line-based removal matches the same shapes the rewrite does (double-quoted elements under bare-key arrays). Rarer valid spellings it doesn't reach — single-quoted pins, quoted TOML keys, inline-table forms — are left in place but still surfaced asW_DBCONNECT_PIN_DUPLICATEDwhen their range is disjoint from the managed pin.No changelog fragment:
environments setup-localis not yet released (its own.nextchangesfragment is still pending), so this fix ships in the same release that introduces the command.Testing
libs/localenv/merge_test.goandwarnings_test.go(consolidation across all three location types, empty-array/trailing-comma handling, comment-preceded strays with comment preservation, idempotency, constraints-only no-op,==X.*wildcard disjoint math).merge-warnings/merge-warnings-json; addeddbconnect-consolidate-check,constraints-only-existing, andwildcard-constraint-conflict-check.uv syncnow resolves cleanly (the pre-existing conflict is gone).This pull request and its description were written by Isaac.