arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.23k stars 370 forks source link

gRPC: allow cancellation of downloads #2609

Closed cmaglie closed 1 month ago

cmaglie commented 1 month ago

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

Allows the cancellation of a gRPC call involving a download.

What is the current behavior?

If a gRPC call is blocked in a slow download, it cannot be interrupted. Even if the gRPC call is canceled, the download will continue in the background.

What is the new behavior?

Closing a gRPC call will terminate the download process immediately.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Fix #2595

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 55.17241% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 70.26%. Comparing base (ba19a2d) to head (66a4f27).

Files Patch % Lines
internal/arduino/cores/packagemanager/profiles.go 33.33% 0 Missing and 4 partials :warning:
commands/instances.go 25.00% 0 Missing and 3 partials :warning:
commands/service_platform_download.go 33.33% 0 Missing and 2 partials :warning:
.../arduino/cores/packagemanager/install_uninstall.go 33.33% 0 Missing and 2 partials :warning:
commands/service_library_download.go 0.00% 0 Missing and 1 partial :warning:
internal/arduino/resources/index.go 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2609 +/- ## ========================================== - Coverage 70.30% 70.26% -0.05% ========================================== Files 222 222 Lines 21262 21262 ========================================== - Hits 14948 14939 -9 - Misses 5131 5147 +16 + Partials 1183 1176 -7 ``` | [Flag](https://app.codecov.io/gh/arduino/arduino-cli/pull/2609/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/arduino/arduino-cli/pull/2609/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | `70.26% <55.17%> (-0.05%)` | :arrow_down: | 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=arduino#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.