Skip to content

Add http.RoundTripper to remotefs FS via curl/PowerShell#322

Merged
kke merged 5 commits intomainfrom
http-roundtripper
Apr 30, 2026
Merged

Add http.RoundTripper to remotefs FS via curl/PowerShell#322
kke merged 5 commits intomainfrom
http-roundtripper

Conversation

@kke
Copy link
Copy Markdown
Contributor

@kke kke commented Apr 24, 2026

Implements http.RoundTripper on PosixFS (curl) and WinFS (Invoke-WebRequest), moves DownloadURL into the new HTTPTransport interface embedded in FS, and replaces the HTTPStatus method.

Part of the rig v2 last mile effort. Breaking API is not a problem as rig v2 has not been released yet.

@kke kke added the enhancement New feature or request label Apr 24, 2026
@kke kke requested a review from Copilot April 24, 2026 10:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an HTTP proxying capability to remotefs by introducing an HTTPTransport interface (with RoundTrip) implemented by both PosixFS (via curl) and WinFS (via Invoke-WebRequest), and refactors HTTP status probing into a free function that operates on that transport.

Changes:

  • Introduces HTTPTransport (including RoundTrip) and embeds it into remotefs.FS; moves DownloadURL into the new transport interface.
  • Implements http.RoundTripper on PosixFS (curl) and WinFS (PowerShell Invoke-WebRequest) by returning a parsed raw HTTP/1.1 response.
  • Adds unit tests for RoundTrip behavior and the new HTTPStatus helper.

Reviewed changes

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

Show a summary per file
File Description
remotefs/http.go Adds HTTPTransport, HTTPStatus, and raw HTTP response parsing helper.
remotefs/http_test.go Adds unit tests for RoundTrip on Posix/Windows and for HTTPStatus.
remotefs/types.go Embeds HTTPTransport into FS and removes DownloadURL from OS.
remotefs/posixfs.go Implements RoundTrip using curl on the remote host.
remotefs/winfs.go Implements RoundTrip using PowerShell Invoke-WebRequest on the remote host.
remotefs/hostinfo_test.go Adds tests covering HTTPStatus for both Posix and Windows implementations.
remotefs/upload_test.go Updates the upload FS test stub to satisfy the expanded FS interface.

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

Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/upload_test.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 6 comments.


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

Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/posixfs.go
Comment thread remotefs/posixfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/http.go
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 4 comments.


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

Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/http.go Outdated
Comment thread remotefs/posixfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

Comment thread remotefs/http.go
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

Comment thread remotefs/posixfs.go Outdated
@kke kke requested a review from Copilot April 28, 2026 09:56
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 2 comments.


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

Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go
Comment thread remotefs/winfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 2 comments.


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

Comment thread remotefs/winfs.go Outdated
Comment thread remotefs/http_test.go Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 3 comments.


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

Comment thread remotefs/posixfs.go
Comment thread remotefs/posixfs.go Outdated
Comment thread remotefs/winfs.go
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

Comment thread remotefs/posixfs.go Outdated
Implements http.RoundTripper on PosixFS (curl) and WinFS (Invoke-WebRequest),
moves DownloadURL into the new HTTPTransport interface embedded in FS, and
replaces the HTTPStatus method on OS with a free function taking HTTPTransport.

Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 2 comments.


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

Comment thread remotefs/http.go
Comment thread remotefs/posixfs.go
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

Comment thread remotefs/posixfs.go
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 2 comments.


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

Comment thread remotefs/posixfs.go
Comment thread remotefs/winfs.go
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

Comment thread remotefs/http.go Outdated
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated no new comments.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants