Uh oh!
There was an error while loading. Please reload this page.
List the binary file paths that cannot be preserved in the SDK patch - #183
Merged
Conversation
The 'update sdk' warning only reported a count of binary files, and the general modified-files list is capped at 20 entries, so the files that must be restored by hand could be invisible in the output. Replace countBinaryFiles with binaryModifiedFiles and print the paths (up to 10, with an overflow line) directly under the warning.
Visibility into what the patch cannot preserve is the point, so drop the 10-entry cap and print every binary file. Whether to back them up is the user's call, so recommend it rather than demanding it.
The message passed an argument to fmt.Sprintf with no formatting directive, which go vet rejects and which would print an %!(EXTRA int=N) suffix at runtime. The count is redundant now that every binary file is listed, so drop the argument. Also fix an 'any' / 'and' typo and phrase the backup step as the user's choice.
Only one line should introduce the list, so drop the forward reference from the first line. Use 'cannot' rather than a contraction to match the surrounding output, and say 'these files' and 'your changes' since the modifications are detected, not hypothetical.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Problem
metaplay update sdkwarns that binary files cannot be included in the patch, but it only reported a count. The paths were not reliably visible anywhere:(binary), but it is capped at 20 entries, so binaries beyond the cutoff are collapsed into... and N more file(s).Binary files differmarker.So the files that need manual attention were exactly the ones the output could hide.
Change
countBinaryFileswithbinaryModifiedFiles, which returns the filtered slice instead of just a count. Callers uselen()where they need the number.The general list keeps its own cap of 20, so the binaries are always shown regardless of where they fall in that list.
Output now looks like:
Verification
go build ./...,go vet ./cmd/,go test ./cmd/all pass.gofmt -l ./cmdclean,go mod tidyproduces no changes.Follow-ups (not in this PR)
filepath.WalkDirinDetectSdkModificationsWithPatchdoes not skip.git, so a nested checkout or submodule underMetaplaySDK/would report every object blob as an added binary file.patchContentis empty and no patch file is written, yet the output still prints the patch path andpatch -p1 < ...re-apply instructions.