dragonflyoss / Dragonfly2

Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project.
https://d7y.io
Apache License 2.0
2.3k stars 293 forks source link

enhance: support syncpeers by service and optimize the merge logic #3637

Closed CormickKneey closed 2 days ago

CormickKneey commented 3 weeks ago

Description

still in progress

Related Issue

https://github.com/dragonflyoss/Dragonfly2/issues/3634

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 29.03226% with 154 lines in your changes missing coverage. Please review.

Project coverage is 35.46%. Comparing base (b83a4c9) to head (207a410). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
manager/job/sync_peers.go 28.57% 95 Missing :warning:
manager/service/job.go 0.00% 35 Missing :warning:
manager/handlers/job.go 8.33% 11 Missing :warning:
manager/service/mocks/service_mock.go 0.00% 9 Missing :warning:
manager/job/mocks/sync_peers_mock.go 0.00% 4 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637/graphs/tree.svg?width=650&height=150&src=pr&token=PUICJYSAT7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) ```diff @@ Coverage Diff @@ ## main #3637 +/- ## ========================================== + Coverage 35.41% 35.46% +0.04% ========================================== Files 335 336 +1 Lines 37531 37657 +126 ========================================== + Hits 13293 13355 +62 - Misses 23409 23471 +62 - Partials 829 831 +2 ``` | [Flag](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | `35.46% <29.03%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss) | Coverage Δ | | |---|---|---| | [manager/config/config.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fconfig%2Fconfig.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9jb25maWcvY29uZmlnLmdv) | `96.29% <100.00%> (+0.01%)` | :arrow_up: | | [manager/service/service.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fservice%2Fservice.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9zZXJ2aWNlL3NlcnZpY2UuZ28=) | `0.00% <ø> (ø)` | | | [pkg/container/slice/slice.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=pkg%2Fcontainer%2Fslice%2Fslice.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-cGtnL2NvbnRhaW5lci9zbGljZS9zbGljZS5nbw==) | `100.00% <100.00%> (ø)` | | | [scheduler/resource/standard/host.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=scheduler%2Fresource%2Fstandard%2Fhost.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-c2NoZWR1bGVyL3Jlc291cmNlL3N0YW5kYXJkL2hvc3QuZ28=) | `88.23% <100.00%> (ø)` | | | [manager/job/mocks/sync\_peers\_mock.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fjob%2Fmocks%2Fsync_peers_mock.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9qb2IvbW9ja3Mvc3luY19wZWVyc19tb2NrLmdv) | `0.00% <0.00%> (ø)` | | | [manager/service/mocks/service\_mock.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fservice%2Fmocks%2Fservice_mock.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9zZXJ2aWNlL21vY2tzL3NlcnZpY2VfbW9jay5nbw==) | `95.40% <0.00%> (-1.15%)` | :arrow_down: | | [manager/handlers/job.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fhandlers%2Fjob.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9oYW5kbGVycy9qb2IuZ28=) | `50.00% <8.33%> (-5.56%)` | :arrow_down: | | [manager/service/job.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fservice%2Fjob.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9zZXJ2aWNlL2pvYi5nbw==) | `0.00% <0.00%> (ø)` | | | [manager/job/sync\_peers.go](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637?src=pr&el=tree&filepath=manager%2Fjob%2Fsync_peers.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss#diff-bWFuYWdlci9qb2Ivc3luY19wZWVycy5nbw==) | `18.71% <28.57%> (+18.71%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/dragonflyoss/Dragonfly2/pull/3637/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dragonflyoss)