Skip to content

Do not fail if downloaded file has good checksum but incorrect size. #2739

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Oct 28, 2024

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Oct 28, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

As requested in #2332

Do not error if the downloaded file size doesn't match the size value in the index.
🙂 Users will no longer suffer when package developers fail to correctly set a size value.

What is the current behavior?

If a downloaded file has an incorrect size written in the index (but a correct checksum), it will fail to download.

What is the new behavior?

If a downloaded file has an incorrect size written in the index (but a correct checksum), it will download successfully.

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

No

Other information

Fix #2332

@cmaglie cmaglie self-assigned this Oct 28, 2024
@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 28, 2024
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 67.63%. Comparing base (2dcee40) to head (ea7391f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/arduino/resources/checksums.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2739      +/-   ##
==========================================
- Coverage   67.63%   67.63%   -0.01%     
==========================================
  Files         237      237              
  Lines       22356    22354       -2     
==========================================
- Hits        15121    15119       -2     
  Misses       6046     6046              
  Partials     1189     1189              
Flag Coverage Δ
unit 67.63% <50.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie merged commit 7ee4cf7 into arduino:master Oct 28, 2024
98 checks passed
@cmaglie cmaglie deleted the no-fail-on-incorrect-download-size branch October 28, 2024 15:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't fail installation on mismatch with size fields of index
2 participants