Skip to content

Use ureq instead of reqwest#8

Merged
artob merged 8 commits into
masterfrom
alex/gofer_ureq
Jul 12, 2025
Merged

Use ureq instead of reqwest#8
artob merged 8 commits into
masterfrom
alex/gofer_ureq

Conversation

@oleksandrvoyager
Copy link
Copy Markdown
Collaborator

No description provided.

@oleksandrvoyager oleksandrvoyager requested a review from artob July 1, 2025 21:10
@oleksandrvoyager oleksandrvoyager added the enhancement New feature or request label Jul 1, 2025
@artob artob requested a review from Copilot July 1, 2025 21:11

This comment was marked as outdated.

Comment thread lib/gofer/src/schemes/utils.rs Outdated
@oleksandrvoyager oleksandrvoyager requested a review from artob July 2, 2025 00:40
@artob artob requested a review from Copilot July 2, 2025 16:13
@artob
Copy link
Copy Markdown
Contributor

artob commented Jul 2, 2025

@race-of-sloths score 8

@race-of-sloths
Copy link
Copy Markdown

race-of-sloths commented Jul 2, 2025

@oleksandrvoyager Thank you for your contribution! Your pull request is now a part of the Race of Sloths!

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@artob 8

Your contribution is much appreciated with a final score of 8!
You have received 80 Sloth points for this contribution

@artob received 25 Sloth Points for reviewing and scoring this pull request.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

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 replaces reqwest with ureq across HTTP, HTTPS, IPFS, and Git schemes and introduces a unified request abstraction with customizable headers.

  • Introduce schemes/request.rs to centralize ureq agent creation and fetching logic.
  • Refactor http.rs, https, ipfs.rs, and git.rs to use the new request module and support RequestConfig.
  • Add RequestConfig in lib.rs and open_with_config in open.rs for passing custom headers to all schemes.

Reviewed Changes

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

Show a summary per file
File Description
lib/gofer/src/schemes/request.rs New ureq agent builder and fetch functions
lib/gofer/src/schemes/ipfs.rs IPFS open/open_with_config refactored to ureq
lib/gofer/src/schemes/http.rs HTTP/HTTPS open functions refactored to ureq
lib/gofer/src/schemes/git.rs Git open/open_with_config refactored to ureq
lib/gofer/src/schemes.rs Register new request module under relevant features
lib/gofer/src/open.rs Added open_with_config dispatch across schemes
lib/gofer/src/lib.rs Defined RequestConfig type and methods
lib/gofer/src/error.rs Switched error conversions from reqwest to ureq
lib/gofer/Cargo.toml Removed reqwest dependency, added optional ureq
Comments suppressed due to low confidence (2)

lib/gofer/src/schemes/request.rs:13

  • [nitpick] The parameter use_tls is semantically equivalent to secure used elsewhere; consider renaming it to secure for consistency across the API.
pub(crate) fn new_agent(use_tls: bool, tls_provider: Option<TlsProvider>) -> Agent {

lib/gofer/src/schemes/ipfs.rs:65

  • There are no tests covering map_ipfs_url_to_gateway_url; adding unit tests for valid and invalid IPFS URL mappings would help prevent regressions.
fn map_ipfs_url_to_gateway_url(url_str: &str) -> Result<String> {

Comment thread lib/gofer/src/schemes/ipfs.rs
Comment thread lib/gofer/src/open.rs
@artob artob changed the title Replace reqwest with ureq in git.rs, http.rs, ipfs.rs Replace reqwest with ureq Jul 3, 2025
@artob artob changed the title Replace reqwest with ureq Use ureq instead of reqwest Jul 3, 2025
@artob artob merged commit 12fc0a9 into master Jul 12, 2025
2 checks passed
@artob artob deleted the alex/gofer_ureq branch July 12, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

4 participants