Skip to content

[S8a] Extract private Python settings/default helpers - #155

Merged
Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
refactor/s8a-settings
Nov 17, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
refactor/s8a-settings

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Validation

Part 1 of #154. Keep the ToolServer facade, dictionary ownership, path normalization, and workspace/document routing unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91
@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code Cleanup, Refactorings and Repo health. Not feature related label Nov 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the settings-construction helper extraction.

No open issues 🎉

What changed in this PR

Implements S8a of #154 by extracting private settings-construction helpers while keeping ToolServer as the public facade. Workspace routing extraction remains deferred to S8b.

Changes:

  • Move default, workspace and fallback settings construction into stateless helpers.
  • Preserve shallow aliases, merge precedence and facade-owned updates and routing.
  • Add focused regressions for dictionary replacement, live configuration and fallback context, and document the ownership boundary.
File Description
python/​vscode_common_python_lsp/​server.py Delegate settings construction to private helpers.
python/​vscode_common_python_lsp/​_settings.py Add stateless helpers for fresh, shallow settings dictionaries.
python/​tests/​test_server.py Cover replacement maps, value aliases, live configuration and contextual precedence.
CONTRIBUTING.md Document responsibilities of the facade and private helpers.

Review effort: Balanced

@bschnurr

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@bschnurr

Copy link
Copy Markdown
Member

Reviewed commit: 0b0130e28c77ba94ae1f255fe05e6c222038a03b

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Program Files\RedHat\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "c2b598e801c17d388f4254c3771a8bc28e810bcb10126c42cde4e2d799c60047": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found

Test runs: none recorded.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 17, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit c951eb7 into main Nov 17, 2026
20 of 21 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the refactor/s8a-settings branch November 17, 2026 19:37
Eduardo Villalpando Mello (edvilme) added a commit that referenced this pull request Nov 17, 2026
## Summary

Part 2/2 of #154. **Depends on #155**; this upper layer intentionally
targets `refactor/s8a-settings`, not `main`.

- Move workspace settings registration and path/document selection into
private, stateless `_routing` functions behind the unchanged
`ToolServer` facade.
- Keep the facade's writable dictionaries, in-place updates, direct map
replacement/mutation, shallow value aliases, method overrides, and
existing `server` module imports/normalization and URI seams.
- Preserve nested-project selection, virtual/rootless paths,
symlink-normalization flags, terminal-parent handling, first-workspace
fallback, and the distinct per-document/CWD fallback construction. No
fallback or normalization unification.
- Add five focused regression cases in the existing server tests and
document the private boundary. Existing fixtures, identity checks, and
real stdio tests are unchanged.

No execution/CWD resolver, backend, process/lifecycle, wire settings,
dependency, TypeScript, or consumer-pin changes. The lower `_settings`
extraction remains unchanged.

## Validation

Native Windows / Python 3.13.14, worktree-local environments:

- Full shared Python tests through existing nox tooling: **358 passed, 2
skipped**. The two Windows symlink-privilege skips are unchanged from
S8a's **353 passed, 2 skipped** baseline.
- Existing nox lint session: **flake8, Black, and isort pass** for the
package and tests.
- Built the combined candidate wheel using `setuptools.build_meta`;
installed it noneditably in an isolated native virtual environment.
- **124 ToolServer facade tests pass against the installed wheel**,
using `python -I`, no `PYTHONPATH`, and pytest importlib mode. Verified
`_routing.py` in distribution metadata/RECORD, source/wheel/installed
bytes, and package origins in installed site-packages before and after
the tests; no checkout masking.
- AST comparison with exact lower head
`0b0130e28c77ba94ae1f255fe05e6c222038a03b`: extracted routing bodies
unchanged apart from the receiver name; public method
signatures/annotations, existing module imports, and all nonrouting
methods unchanged.
- `git diff --check` passes. Final validation environments have no
editable installations.

### Native consumer compatibility (combined stack)

All five consumers passed their complete, unchanged native `nox
--session install_bundled_libs tests` pipelines on Windows, with Python
3.13.14 test sessions. Each comparison kept the exact consumer commit
below and changed only the isolated worktree's shared-runtime gitlink
from baseline `664672c16ce7848f09442ce0e301279a199ceb08` to candidate
`77240b0977e15b112599df60a436f896a5e7ef37`.

| Consumer | Consumer commit | Python tests: baseline and candidate |
Build tests: baseline and candidate |
| --- | --- | --- | --- |
| Pylint | `d5eab2852f333ac9db363acd4939ea9bb95a1edb` | 122 passed | 20
passed |
| Black | `2a12315bb60ecbbe61c224e9a12ed86c043b02a6` | 70 passed, 1
unchanged skip | 20 passed |
| Flake8 | `a2c9d11e7cbc6933cfa8ea8db84b97a9ec0bebcc` | 114 passed | 23
passed |
| isort | `a120a1203e8c1d9d0af36a8f7de9ae0d67da4de3` | 79 passed | 20
passed |
| Mypy | `047b8a10df62ab0f43ae119bece1db3ae3721a1d` | 87 passed, 2
unchanged skips | 21 passed |

For every consumer, independently verified its native noneditable
bundled distribution, private identity/provenance, and bundled server
import origin. The complete installed Python filename set and contents
match pinned Git objects (14 baseline modules, 16 candidate modules;
universal-newline normalization only), including both new private
helpers. No consumer source, tests, fixtures, requirements, or tracked
artifacts were changed. Existing Windows file-descriptor cleanup
warnings remain nonfatal; no failures or additional skips.

Native stack verified: #155 -> #156, ultimate base `main`. No merge or
auto-merge was performed. Both PRs' hosted test/lint/build checks pass,
including Python 3.10-3.14 on Ubuntu and Windows. This is automated
compatibility evidence, not a manual VS Code smoke test.

Closes #154.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code Cleanup, Refactorings and Repo health. Not feature related review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants