feat: perform partial zip reads for extracting version and release date#472
Merged
feat: perform partial zip reads for extracting version and release date#472
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a partial ZIP reader to extract version/release-date from an IPA via HTTP range requests, and updates GetVersionMetadata to use the IPA’s Info.plist rather than relying on response metadata.
Changes:
- Introduces an HTTP
io.ReaderAtimplementation backed byRangerequests and uses it withzip.NewReaderto locate/readPayload/*.app/Info.plist. - Updates
GetVersionMetadatato read display version + release date from the IPA instead ofitem.Metadata. - Expands tests with a range-capable
httptestserver to validate partial reads (no full GET) and error handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/appstore/appstore_partial_zip.go | Implements partial ZIP reading over HTTP ranges and parses version metadata from Info.plist. |
| pkg/appstore/appstore_get_version_metadata.go | Switches GetVersionMetadata to extract metadata from the IPA URL. |
| pkg/appstore/appstore_get_version_metadata_test.go | Adds range-server helpers and updates assertions to validate partial reads and new parsing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f60eb12 to
4c1cb7a
Compare
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Refactors core version extraction logic using new partial ZIP reading over HTTP. This is a significant logic change in a core path and requires human validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how version metadata (specifically, display version and release date) is extracted from App Store IPA files. Instead of relying on metadata from the download API response, it now reads this information directly from the IPA's embedded
Info.plistusing partial HTTP range requests, improving accuracy and robustness. Comprehensive tests are added to verify the new extraction logic and its efficiency.Key changes:
Core logic update:
GetVersionMetadatainappstore_get_version_metadata.goto extract version information by downloading and parsing the IPA'sInfo.plist, using the newreadVersionMetadataFromIPAmethod, rather than trusting the API's metadata fields.New implementation for partial ZIP reading:
appstore_partial_zip.gowhich implements a partial ZIP reader that fetches only necessary parts of the IPA file over HTTP, efficiently extractingDisplayVersionandReleaseDatefromInfo.plist. It handles various date formats and fallback logic.Testing improvements:
appstore_get_version_metadata_test.go:Dependency injection:
httpClientis properly initialized for use by the new partial ZIP logic.Summary by cubic
Read version metadata directly from the remote IPA using HTTP Range requests to partially read the ZIP. Avoids full downloads and surfaces errors instead of falling back to API metadata.
httpRangeReaderAtto read ZIP segments viaRangerequests and detect file size fromContent-Range.Info.plistusingCFBundleShortVersionString/bundleShortVersionStringandreleaseDatevariants; supports strings, numbers, andtime.Time, trims whitespace, and falls back to the file’s modified time.GetVersionMetadatato always use IPA-derived metadata (no fallback toitem.Metadata); errors are returned if IPA parsing fails.howett.net/plist.Written for commit 4c1cb7a. Summary will update on new commits.
Closes #471.