find url and retri for multiple sps by client address#16
Merged
CodeWarriorr merged 3 commits intomainfrom Jul 14, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for fetching URLs and retrievability metrics by client address, enhances the job model to record multiple provider results, and refactors job handling to emit and store those results.
- Introduce a new
/url/client/:clientroute and handler for client-based lookups. - Extend the
Jobstruct and repository to accumulate multipleProviderResultentries. - Refactor
job_handlerto return, log, and persist multiple success/error outcomes.
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes.rs | Added a route for handle_find_client |
| src/repository/job_repo.rs | Changed Job to hold results: Vec<ProviderResult> and updated methods (add_success_result, add_error_result, set_status) |
| src/lotus_rpc.rs | Inserted a debug log for peer ID requests |
| src/deal_service.rs | Introduced get_distinct_providers_by_client |
| src/deal_repo.rs | Implemented get_distinct_providers_by_client SQL query |
| src/background/job_handler.rs | Refactored to use JobHandlerResult enum with detailed result structs and handle multiple results |
| src/api/responses.rs | Added new ErrorCode variants (NoProviderOrClient, NoProvidersFound) |
| src/api/get_job.rs | Populates working_url and retrievability from first results element for FE compatibility |
| src/api/find_client.rs | New handler handle_find_client for client-based URL retrieval |
| src/api/create_job.rs | Made provider optional, improved validation, and updated docs |
| src/api/api_doc.rs | Updated API documentation to include the new client endpoint |
Files not reviewed (3)
- .sqlx/query-072675ef78b55b473101ad5e556529177403872c30a9f1f95829fcfe03a3cc68.json: Language not supported
- .sqlx/query-7ef60661a9826e8e3e00158e7d018c465227cff3b07498d8793f310cf78135ef.json: Language not supported
- .sqlx/query-e130ef133dc7185f8dc726e7a08b14a1d39191f9c64ec351eeec3683a808228b.json: Language not supported
kacperzuk-neti
approved these changes
Jul 10, 2025
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.