Conversation
Coverage Report
Per-file coverage (top 40 by missed lines)
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared HTTP client utility crate (safe-pkgs-registry-http) that consolidates HTTP request handling, retry logic, error mapping, and user-agent configuration across all registry clients (PyPI, npm, Cargo) and the OSV advisory client.
Changes:
- Created new
safe-pkgs-registry-httpcrate with utilities for HTTP client building, retry/backoff logic, error handling, and JSON parsing - Refactored PyPI, npm, Cargo, and OSV clients to use shared HTTP utilities instead of duplicated per-crate implementations
- Removed registry-specific user-agent constants and custom retry logic in favor of centralized implementations
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/http/src/lib.rs | New shared HTTP utilities crate with retry policy, client builder, error mappers, and JSON parser |
| crates/http/Cargo.toml | Cargo manifest for new HTTP utilities crate |
| crates/registry/pypi/src/registry.rs | Refactored to use shared HTTP utilities, removed PYPI_USER_AGENT constant |
| crates/registry/pypi/Cargo.toml | Added dependency on safe-pkgs-registry-http |
| crates/registry/npm/src/registry.rs | Refactored to use shared HTTP utilities, removed custom retry loop and NPM_DOWNLOAD_API_MAX_RETRY_ATTEMPTS constant |
| crates/registry/npm/Cargo.toml | Added dependency on safe-pkgs-registry-http |
| crates/registry/cargo/src/registry.rs | Refactored to use shared HTTP utilities, removed CRATES_IO_USER_AGENT constant |
| crates/registry/cargo/Cargo.toml | Added dependency on safe-pkgs-registry-http |
| crates/osv/src/lib.rs | Refactored to use shared HTTP utilities, updated test assertion for new error message format |
| crates/osv/Cargo.toml | Added dependency on safe-pkgs-registry-http |
| CONTRIBUTING.md | Added documentation for shared HTTP utilities usage guidelines |
| README.md | Removed completed roadmap item about shared HTTP utilities |
| Cargo.toml | Added crates/http to workspace members |
| Cargo.lock | Updated with new crate and dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.