Skip to content

Conversation

@jensens
Copy link
Member

@jensens jensens commented Oct 22, 2025

Summary

Fixes #35: Prevents credential prompts from overlapping when using HTTPS URLs in parallel VCS operations.

Problem

When mxdev processes multiple HTTPS packages in parallel (default: 4 threads), git credential prompts get mixed with output from other threads, making it confusing for users to enter credentials.

Solution: Smart Threading

Added a new configuration option (enabled by default) that uses a two-phase approach:

Phase 1: Process HTTPS packages serially (threads=1)

  • Clean, visible credential prompts
  • Git caches credentials after first prompt

Phase 2: Process remaining packages in parallel (threads=N)

  • SSH and local packages processed at full speed
  • No credential prompts expected

Configuration

[settings]
# Enable intelligent threading (default: true)
smart-threading = true

Set to false if you have credential helpers configured and never see prompts.

Implementation Details

  • Applied to both checkout() and update() methods
  • Automatically detects HTTPS URLs (url.startswith('https://'))
  • No new dependencies - pure stdlib
  • Backward compatible - no config changes required

Changes

  • config.py: Added smart-threading setting with default true
  • vcs/common.py:
    • Added smart_threading parameter to WorkingCopies.__init__()
    • Added _separate_https_packages() helper method
    • Refactored checkout() to use two-phase processing
    • Refactored update() to use two-phase processing
  • processing.py: Pass smart_threading to WorkingCopies
  • CHANGES.md: Documented new feature

Testing

  • ✅ All existing tests pass
  • ✅ Linting passes
  • Manual testing needed for credential prompt scenarios

Test Plan

# Test with HTTPS packages requiring credentials
# Verify prompts are clean and sequential
pytest tests/test_git.py -v

cc @jensens

…prompts

- Add smart-threading configuration option (default: true)
- Process HTTPS packages serially to avoid prompt conflicts
- Then process SSH/local packages in parallel for speed
- Applied to both checkout() and update() methods
- CHANGES.md: Document new smart-threading feature
@jensens jensens marked this pull request as ready for review October 22, 2025 11:13
- README.md: Document smart-threading in Behavior Settings table
- README.md: Add Smart Threading subsection with explanation
- CLAUDE.md: Add mandatory documentation check to Pre-Push Checklist
@jensens jensens merged commit 300c3b0 into main Oct 22, 2025
23 checks passed
@jensens jensens deleted the fix/35-parallel-credential-prompts branch October 22, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with credentials prompt

2 participants