Repository navigation
fix: Union version codes across every compatibility entry in the list commands - #340
Closed
SysAdminDoc wants to merge 2 commits into
Closed
SysAdminDoc wants to merge 2 commits into
SysAdminDoc wants to merge 2 commits into
Conversation
… commands versionCodesFor read only the first target it found with codes for a version, so list-versions and list-patches would show a single accepted build's codes and silently drop the rest when a patch names the version through more than one compatibility entry, one per build. Union the codes per ABI across every matching target and patch instead. The GUI side (SupportedAppExtractor, PatchService) already merges this way; this brings the CLI listing helper in line with it.
Move the per-ABI version code union out of versionCodesFor and into Iterable<Compatibility>.unionVersionCodes in the engine package, so the CLI's list commands and the GUI's PatchService.toGuiPatch() call the same function instead of each doing their own union. Removes the duplicated groupBy/mapValues logic PatchService had for flattening codes per version.
Author
|
Done. The union now lives in one place: Added a test for the new function's own shape (a raw |
Contributor
|
I agree with the reasons listed in MorpheApp/morphe-manager#1052 (comment) If this change is made, it should be made to patcher first so CLI and Manager are in unison with the behavior. |
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.
A patch can name one package and version through several compatibility entries, one per accepted build, which is how a bundle handles apps that ship several arm64-only releases under a single version string.
versionCodesForinPatchExtensions.ktread only the first target it found with codes for that version, solist-versionsandlist-patcheswould print a single build's codes and quietly drop the rest.The GUI side already handles this correctly: both
PatchService.toGuiPatch()andSupportedAppExtractorunion build codes across every entry, with an entry that names no codes winning over anything already collected. This bringsversionCodesForin line with that, unioning per ABI across every matching target and, for theIterable<Patch<*>>overload, across every patch too. The return type moved fromMap<SupportedAbi, Int>toMap<SupportedAbi, Set<Int>>to hold more than one code per ABI, so I updated the twolist-versions/list-patchescall sites to print the codes for an ABI joined with a slash.Added
PatchExtensionsTestcovering the union across compatibility entries within one patch, across separate patches, and the plain "no codes declared" case.Ran:
All unit tests pass.