fix: key checksums by filename to include windows_amd64#956
Conversation
Signed-off-by: cotishq <tanishqp101204@gmail.com>
f44f597 to
84877ea
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
=========================================
- Coverage 10.99% 9.27% -1.72%
=========================================
Files 173 290 +117
Lines 8671 14597 +5926
=========================================
+ Hits 953 1354 +401
- Misses 7612 13117 +5505
- Partials 106 126 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@NucleoFusion would appreciate your review on this |
|
But why we got duplicate hash values in the first place tho? |
|
I will review this in a while but I'm curious t know what the issue was |
so the duplicate hash occurs because the two Windows archives (windows_amd64.zip and windows_arm64.zip) can produce identical SHA256 values when they contain the same binary content - for example if the cross-compiled binaries for both targets are functionally identical at that release. The original code used the hash as the map key, so the second entry silently overwrote the first. Keying by filename instead ensures both entries are always written regardless of hash collision. |
the issue was like the checksums were keyed by hash value in a map, so when both the zips( amd64 and arm64 ) produced the same sha256, the second entry overwrote the first before being written to checksums.txt. |
yeah that makes sense |
|
I see, that was kinda stupid on my part then lol |
|
hey @NucleoFusion , can you tell me like is it a valid fix or i have to still iterate it ? |

Description
Scoop autoupdate reads hashes from
checksums.txtby artifact filename. On v0.0.20,harbor-cli_*_windows_amd64.zipwas missing from that file because duplicate SHA256 values overwrote each other when checksums were keyed by hash.Type of Change
Please select the relevant type.
Changes
.dagger/checksum.goinstead of by hashchecksums.txtwith filenames sorted alphabeticallywindows_amd64andwindows_arm64archives now appear inchecksums.txtwhen their hashes collideTest plan
dagger call build->archive->nfpm-build->apk->checksumgrep windows dist/checksums.txtshows bothwindows_amd64.zipandwindows_arm64.zipsha256sumondist/archive/*_windows_*.zipmatcheschecksums.txt