Skip to content

Add remote venv import downloads#64

Open
Adam Driscoll (adamdriscoll) wants to merge 6 commits into
masterfrom
adamdriscoll-remote-venv-downloads
Open

Add remote venv import downloads#64
Adam Driscoll (adamdriscoll) wants to merge 6 commits into
masterfrom
adamdriscoll-remote-venv-downloads

Conversation

@adamdriscoll

@adamdriscoll Adam Driscoll (adamdriscoll) commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Remote virtual environment archives need to be importable by child multi-pwsh processes. This adds URL support to multi-pwsh venv import, with any one-time credentials supplied as part of the provided URL.

Summary

  • Allows multi-pwsh venv import <name> <archive.zip|url> to download http:// or https:// zip archives before importing.
  • Leaves authentication to the provided URL, such as a one-time JWT query-string parameter.
  • Caches remote archives that include an ETag, keyed by URL digest and ETag, under the existing cache root without persisting raw credential-bearing URLs.
  • Revalidates cached URL entries with If-None-Match and reuses the cached archive when the server returns 304 Not Modified.
  • Redacts query strings from successful import output.
  • Serializes remote cache metadata updates with a cache lock and publishes metadata atomically.
  • Avoids retry backoff delays for permanent 4xx responses while still retrying transport failures and transient HTTP statuses.
  • Uses finite connect/read timeouts for remote archive downloads.
  • Documents the remote import workflow using query-string credentials and ETag caching.

Validation

  • cargo test -p multi-pwsh remote_venv -- --nocapture passed.
  • cargo fmt --all --check passed.
  • git diff --check passed.
  • cargo clippy --workspace --all-targets passed with existing warnings in unrelated code.

Support importing virtual environment archives from HTTP URLs and attaching a bearer token from one-shot environment handoff values.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 20:38

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.

Pull request overview

Adds authenticated remote archive support to virtual-environment imports.

Changes:

  • Downloads HTTP(S) archives into temporary storage before import.
  • Supports one-shot bearer tokens via file or environment variable.
  • Documents remote imports and credential handoff.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
crates/multi-pwsh/src/main.rs Implements remote downloads, bearer authentication, cleanup, and tests.
docs/host-and-venv.md Documents URL imports and token variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/multi-pwsh/src/main.rs Outdated
Comment thread crates/multi-pwsh/src/main.rs Outdated
Comment thread crates/multi-pwsh/src/main.rs Outdated
Require HTTPS before sending venv bearer tokens, configure finite remote archive download timeouts, and add local HTTP server coverage for remote venv imports and HTTP failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove token-file handoff support for remote venv imports and keep the direct process environment token flow with cleanup after read.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop app-token environment handling for remote venv imports and rely on one-time credentials included in the provided URL query string.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Store ETag metadata for remote venv archive URLs, revalidate with If-None-Match, and reuse the cached archive when the server returns 304 Not Modified.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread crates/multi-pwsh/src/main.rs Outdated
Comment thread crates/multi-pwsh/src/main.rs Outdated
Comment thread crates/multi-pwsh/src/main.rs
Comment thread crates/multi-pwsh/src/main.rs
Store remote venv cache metadata by URL digest, redact query-string credentials from import output, serialize metadata updates with a lock and atomic write, and avoid retry delays for permanent 4xx responses.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants