Skip to content

Download release assets as binaries, not as JSON metadata - #114

Merged
Jaifroid merged 2 commits into
mainfrom
Fix-corrupt-release-asset-uploads
Aug 6, 2026
Merged

Download release assets as binaries, not as JSON metadata#114
Jaifroid merged 2 commits into
mainfrom
Fix-corrupt-release-asset-uploads

Conversation

@Jaifroid

@Jaifroid Jaifroid commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #113.

The existing check only asked whether a file existed, so this always reported success. It now compares the downloaded size against the size the API reports, which is what would have caught this.

Verified against the v0.9 asset: 1644 bytes before, 3582068 bytes after, matching the API and opening as a valid archive.

Upload-KiwixRelease.ps1 fetched each asset from its API URL without an
Accept header, so GitHub returned the asset's JSON representation rather
than the binary. Those ~1.5KB JSON files were then uploaded to the download
server under a .zip name. Every published release there from 0.5 to 0.9 is
affected; the GitHub release assets themselves are intact.

The existing check only asked whether a file existed, so this always
reported success. It now compares the downloaded size against the size the
API reports, which is what would have caught this.

Verified against the v0.9 asset: 1644 bytes before, 3582068 bytes after,
matching the API and opening as a valid archive.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Jaifroid Jaifroid self-assigned this Aug 6, 2026
@Jaifroid Jaifroid added bug Something isn't working build Code relating to building or publishing assets labels Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The changes directly address the reported failure mode by forcing binary downloads and adding a reliable integrity check without introducing risky behavior.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Updates the Kiwix release upload PowerShell script to correctly download GitHub release assets as binary archives (instead of JSON metadata), aligning with the intent of Issue #113.

Changes:

  • Use browser_download_url for reporting the discovered asset URL.
  • Download assets via the GitHub API asset URL with Accept: application/octet-stream to force binary content.
  • Validate successful downloads by comparing the downloaded file size to the API-reported asset.size, and emit a more specific error when sizes differ.
File summaries
File Description
scripts/Upload-KiwixRelease.ps1 Fixes release asset downloading to retrieve binary archives and verifies correctness via size comparison.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@Jaifroid
Jaifroid merged commit 37b1557 into main Aug 6, 2026
3 checks passed
@Jaifroid
Jaifroid deleted the Fix-corrupt-release-asset-uploads branch August 6, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working build Code relating to building or publishing assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download release assets as binaries, not as JSON metadata

2 participants