Skip to content

Conversation

@fu220
Copy link

@fu220 fu220 commented Sep 25, 2025

Description

This pull request adds server-side support for handling resources related to the CacheTask type, to enable future integration and adaptation of CacheTask on the server side.

Related Issue

  • Added a new resource: standardcache, which is used to support CacheTask.
  • Added RPC calls for DownloadCacheTask.
  • Added a function to create CacheTask ID based on URL.

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

- Added a new resource: standardcache, which is used to support CacheTask.
- Added RPC calls for DownloadCacheTask.
- Added a function to create CacheTask ID based on URL.

Signed-off-by: fu220 <2863318196@qq.com>
client := &http.Client{
Timeout: 30 * time.Second,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

InsecureSkipVerify should not be used in production code.
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 50.54152% with 685 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.18%. Comparing base (02b719a) to head (0345f9f).

Files with missing lines Patch % Lines
scheduler/resource/standardcache/seed_peer.go 17.36% 137 Missing and 1 partial ⚠️
...eduler/resource/standardcache/host_manager_mock.go 3.92% 98 Missing ⚠️
scheduler/resource/standardcache/host_manager.go 53.33% 58 Missing and 5 partials ⚠️
scheduler/resource/standardcache/peer.go 72.64% 47 Missing and 11 partials ⚠️
scheduler/resource/standardcache/resource_mock.go 0.00% 54 Missing ⚠️
scheduler/resource/standardcache/task.go 80.00% 42 Missing and 11 partials ⚠️
...eduler/resource/standardcache/peer_manager_mock.go 7.14% 52 Missing ⚠️
...eduler/resource/standardcache/task_manager_mock.go 0.00% 50 Missing ⚠️
scheduler/resource/standardcache/seed_peer_mock.go 0.00% 49 Missing ⚠️
scheduler/resource/standardcache/peer_manager.go 75.22% 19 Missing and 8 partials ⚠️
... and 5 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4342      +/-   ##
==========================================
+ Coverage   33.54%   34.18%   +0.63%     
==========================================
  Files         351      365      +14     
  Lines       35255    36640    +1385     
==========================================
+ Hits        11826    12525     +699     
- Misses      22533    23181     +648     
- Partials      896      934      +38     
Flag Coverage Δ
unittests 34.18% <50.54%> (+0.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scheduler/resource/standardcache/piece.go 100.00% <100.00%> (ø)
scheduler/resource/standardcache/task_manager.go 88.57% <88.57%> (ø)
pkg/rpc/dfdaemon/client/client_v2.go 0.00% <0.00%> (ø)
scheduler/resource/standardcache/host.go 92.00% <92.00%> (ø)
pkg/idgen/task_id.go 67.92% <0.00%> (-13.90%) ⬇️
scheduler/resource/standardcache/resource.go 52.94% <52.94%> (ø)
scheduler/resource/standardcache/peer_manager.go 75.22% <75.22%> (ø)
scheduler/resource/standardcache/seed_peer_mock.go 0.00% <0.00%> (ø)
...eduler/resource/standardcache/task_manager_mock.go 0.00% <0.00%> (ø)
...eduler/resource/standardcache/peer_manager_mock.go 7.14% <7.14%> (ø)
... and 6 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants