Skip to content

fix: fail gracefully on invalid pyproject.toml (Fixes #411) - #1942

Merged
Stella Huang (StellaHuang95) merged 3 commits into
microsoft:mainfrom
StellaHuang95:stellahuang-microsoft-expert-tribble
Oct 21, 2026
Merged

Stella Huang (StellaHuang95) merged 3 commits into
microsoft:mainfrom
StellaHuang95:stellahuang-microsoft-expert-tribble

Conversation

@StellaHuang95

@StellaHuang95 Stella Huang (StellaHuang95) commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • preserve pyproject.toml read and parse failures instead of treating malformed files as empty
  • validate the project, build-system, dependency container, and optional-extra fields consumed during installation
  • preflight only the exact dependency files selected by configurable creation while Quick Create validates relevant workspace dependencies
  • apply validation-independent preferred-root eligibility before duplicate selection so sibling worktrees cannot block or replace the owning project
  • preserve exact owner/ancestor precedence even when malformed metadata cannot yet emit install arguments
  • stop before environment creation on Open, Cancel, or dismissal; Continue Anyway uses only the filtered owning installables

Validation

  • npm run lint
  • npm run compile-tests
  • npm run compile
  • npm run unittest — 3,334 passing, 9 pending
  • focused pyproject/creation suite — 179 passing
  • VS Code smoke tests — 31 passing, 1 pending
  • VS Code E2E tests — 4 passing
  • disposable VS Code integration workflows — syntax errors, schema errors, invalid extras, sibling worktrees in both directions, no .venv on rejection, and valid creation/removal all passed
  • broad integration suite — 60 passing, 8 pending; the existing system-manager creation fixture timed out waiting for interactive Python installation
  • final Copilot review — approval recommended, no open issues

Fixes #411

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 34d0c32e-e8b7-4711-a695-1b6f6e56503f
@StellaHuang95 Stella Huang (StellaHuang95) added the bug Issue identified by VS Code Team member as probable bug label Oct 21, 2026
@bschnurr

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Validation-dependent root filtering can silently omit the owning project’s dependencies.

1 open issue
What changed in this PR

Improves environment creation failure handling for invalid pyproject.toml files, addressing #411.

Changes:

  • Preserves read and parse failures and expands schema validation.
  • Validates selected dependencies before creation.
  • Adds coverage for cancellation, continuation, and sibling-worktree handling.
File Description
src/​test/​managers/​builtin/​venvUtils.createWithProgress.unit.test.ts Tests Quick Create validation outcomes.
src/​test/​managers/​builtin/​venvStepBasedFlow.unit.test.ts Tests step-based creation preflight.
src/​test/​managers/​builtin/​pipUtils.unit.test.ts Covers dependency selection and worktree filtering.
src/​test/​managers/​builtin/​helpers.validatePyproject.unit.test.ts Tests schema validation and prompt actions.
src/​managers/​common/​pickers.ts Returns selected dependency file URIs.
src/​managers/​builtin/​venvUtils.ts Applies Quick Create preflight.
src/​managers/​builtin/​venvStepBasedFlow.ts Stops creation when preflight is rejected.
src/​managers/​builtin/​pipUtils.ts Implements validation and dependency filtering.

Review effort: Balanced

Comment thread src/managers/builtin/pipUtils.ts Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 34d0c32e-e8b7-4711-a695-1b6f6e56503f

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Duplicate suppression can hide an invalid exact owner's validation error and install its ancestor without prompting.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread src/managers/builtin/pipUtils.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 34d0c32e-e8b7-4711-a695-1b6f6e56503f

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved blocking issues remain in the validation, selection, or creation-flow changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@bschnurr

Copy link
Copy Markdown
Member

Result: 🔴 could-not-verify

Verification details

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

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 "7ee19b971263b9544c6b9ded818192331c44eabfa5148387f694bde1bb7b0ae7": 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 Oct 21, 2026

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved via Review Center.

@StellaHuang95
Stella Huang (StellaHuang95) merged commit 897bc3b into microsoft:main Oct 21, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More gracefully fail on pyproject.toml error

5 participants