feat(settings): Phase 2 — migrate to mountainash-settings.profiles + auth - #75
Merged
Conversation
Replace the fat local ConnectionProfile/registry/descriptor/auth stack with thin wrappers over mountainash_settings.profiles primitives. Deletes the local descriptor.py (BackendDescriptor, ParameterSpec, MISSING) and the entire auth/ sub-package; those now live in the upstream mountainash-settings library. Introduces DATABASES_REGISTRY (Registry instance) and updates register/ get_descriptor/get_settings_class to delegate to it. Adds a _RegistryDictView backwards-compat alias for existing REGISTRY imports. Intentionally breaks imports across the 12 per-backend files — Task 3 fixes them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… auth - Adapter files: `from mountainash_data.core.settings.auth import` → `from mountainash_settings.auth import`; rename `_default_driver_kwargs()` → `_default_kwargs()` and `_auth_to_driver_kwargs()` → `_auth_kwargs()` across 7 adapter files. - Create `settings/descriptor.py` with typed `BackendDescriptor` subclass (extends `ProfileDescriptor` with `default_port`, `connection_string_scheme`, `ibis_dialect`, `rides_on` fields) so per-backend files keep typed field access. - Per-backend files: import now routes through `.descriptor` → `mountainash_settings.profiles`. - `settings/auth/` compatibility shim package: re-exports all auth primitives from `mountainash_settings.auth` so existing `from mountainash_data.core.settings.auth import X` call sites continue to work. - `registry.py`: expose `_snapshot_for_tests` / `_reset_for_tests` module-level wrappers delegating to `DATABASES_REGISTRY`. - `settings/__init__.py`: auth re-exports now pull from `mountainash_settings.auth` directly. Result: 234 passed, 1 skipped (test_adapter_replaces_pipeline_output uses old `_default_driver_kwargs()` name in test adapter — Task 7 territory). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove test_auth.py and test_auth_dispatch.py (coverage moved to mountainash-settings). Rewrite descriptor/profile/registry tests to cover only data-specific behaviour (BackendDescriptor fields, to_driver_kwargs(), to_connection_string(), DATABASES_REGISTRY wrapper). Fixes 1 failing test that called the removed _default_driver_kwargs(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…otion Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #75 +/- ##
===========================================
- Coverage 58.24% 54.48% -3.77%
===========================================
Files 61 52 -9
Lines 2867 2641 -226
Branches 308 289 -19
===========================================
- Hits 1670 1439 -231
- Misses 1085 1093 +8
+ Partials 112 109 -3 ☔ View full report in Codecov by Sentry. |
This was referenced Apr 17, 2026
Merged
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.



Summary
Phase 2 of the profiles-promotion initiative:
mountainash-datanow consumes the descriptor/registry/auth primitives promoted tomountainash-settingsin Phase 1 (shipped as v26.4.0) rather than maintaining its own copy.ConnectionProfileshrinks to a thin subclass ofmountainash_settings.profiles.DescriptorProfilethat adds the database-flavored output methods only. A typedBackendDescriptor(ProfileDescriptor)subclass retains the database-specific fields (default_port,connection_string_scheme,ibis_dialect,rides_on). ADATABASES_REGISTRY = Registry("databases")replaces the module-level dict.External API byte-identical — every previously-exported name from
mountainash_data.core.settingsstill resolves from the same import path;DATABASES_REGISTRYis the only addition.Spec mapping
mountainash-settings/docs/superpowers/specs/2026-04-16-profiles-promotion-design.mddocs/superpowers/plans/2026-04-16-profiles-migration-data.md(9 tasks)What shipped
6 commits:
f166679refactor(settings): thin ConnectionProfile + DATABASES_REGISTRY wrapper3b707d4refactor(settings): rewire imports to mountainash-settings.profiles + auth (bundles T3+T4 —ProfileDescriptorraisesTypeErroron unknown kwargs, so T3 couldn't stand alone without typedBackendDescriptor)ca61558chore(settings): add DATABASES_REGISTRY to public re-exports0521ebbtest(settings): switch to shared descriptor_invariants_for helper050c5d2test(settings): trim tests to data-specific cases; delete duplicates3a14977docs: update CLAUDE.md settings section for mountainash-settings promotionFiles touched
Rewritten:
src/mountainash_data/core/settings/profile.py— ~200 → ~90 lines. Keeps onlyto_driver_kwargs()/to_connection_string().src/mountainash_data/core/settings/registry.py— wrapsRegistry("databases"); preservesREGISTRYas a_RegistryDictView(Mapping)for back-compat (inherits.get()via ABC).New:
src/mountainash_data/core/settings/descriptor.py—BackendDescriptor(ProfileDescriptor)with 4 typed database-specific fields.src/mountainash_data/core/settings/auth/— compatibility shim re-exporting frommountainash_settings.auth(not in original plan; preserves ~18 test imports offrom mountainash_data.core.settings.auth import X. Can be deleted once no downstream uses the deep path).Mechanical rewrites:
.descriptor/.auth→mountainash_settings.profiles/.auth)._default_driver_kwargs→_default_kwargs,_auth_to_driver_kwargs→_auth_kwargs) per upstream API.Tests:
test_auth.py+test_auth_dispatch.pydeleted (coverage now in mountainash-settings).test_descriptor.py/test_profile.py/test_registry.pytrimmed to database-specific behaviour.test_descriptors_invariants.pynow uses shareddescriptor_invariants_for(DATABASES_REGISTRY)helper — 108 parametric cases (12 backends × 9 invariants).Deviations from plan (pragmatic)
ProfileDescriptorraisesTypeError(notAttributeError) on unknown kwargs, so backends couldn't instantiate their descriptors without the typed subclass.auth/compatibility shim — not in plan, added to preserve ~18 test imports without rewriting them. Small, limited surface._snapshot_for_tests,_reset_for_testsas module-level wrappers) — delegates to upstreamRegistryinstance methods.All three cleared in final code review as well-bounded and principled.
Test plan
hatch run test:test tests/test_unit/— 427 passed, 5 skipped, 0 failures__all__preservation against origin/developDependency
Requires
mountainash-settings >= 26.4.0(released). Sibling-path dep inhatch.tomlis unchanged.🤖 Generated with Claude Code