Skip to content

Fix Quick Create package installation failure handling with retry flow #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 25, 2025

Quick Create was failing completely when package installation encountered conflicts (e.g., multiple requirements files with incompatible versions), even though the virtual environment was successfully created. Users were left uncertain about the state and had no clear path forward.

Problem

The original issue occurred when Quick Create attempted to install packages from multiple requirements files that had conflicting dependencies:

Failed to run python -m pip install -r requirements1.txt -r requirements2.txt ...
configuration error: `project.name` must be pep508-identifier

The environment would be created successfully, but the entire operation was reported as "failed" with no indication that the environment existed or what the user's options were.

Solution

Implemented a comprehensive retry flow that separates environment creation from package installation:

1. Enhanced Error Handling

  • Modified createWithProgress to separate environment creation from package installation
  • Added CreateEnvironmentResult interface to track success/failure state of each step independently
  • Environment creation and package installation are now handled as separate operations with distinct error reporting

2. User-Friendly Retry Notifications

When Quick Create encounters issues, users now see appropriate notifications:

Package Installation Failure (environment created successfully):

  • Shows: "Environment was created successfully, but package installation failed. Would you like to select packages to install?"
  • Button: "Select Packages" → Opens package selection UI (shown in image)

Environment Creation Failure (complete failure):

  • Shows: "Failed to create virtual environment. Would you like to try again?"
  • Button: "Retry" → Restarts the entire Quick Create flow

3. Package Selection Retry Flow

When users click "Select Packages", they get the same package selection interface used in custom environment creation, allowing them to:

  • Choose which requirements files to install
  • Select individual packages from common PyPI packages
  • Skip package installation entirely

Testing

  • Added comprehensive unit tests for the new CreateEnvironmentResult interface
  • Verified retry flow logic with multiple scenarios
  • All existing 121 tests continue to pass
  • Code compiles and lints successfully

Impact

  • Quick Create no longer fails silently when package conflicts occur
  • Users get clear feedback about what succeeded vs what failed
  • Provides actionable next steps through retry notifications
  • Maintains backward compatibility with existing functionality

Fixes #367.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Quick Create fails to install packages Fix Quick Create package installation failure handling with retry flow Jun 25, 2025
@Copilot Copilot AI requested a review from eleanorjboyd June 25, 2025 16:47
Copilot finished work on behalf of eleanorjboyd June 25, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants