Migrate ziputil from v1 to v2#276
Draft
godrei wants to merge 2 commits into
Draft
Conversation
Replace the v1 ziputil package (shells out to /usr/bin/zip) with the pure-Go v2 ziputil.ZipManager. - output: inject a minimal DirZipper interface into the exporter and call ZipManager.ZipDir instead of the package-level ziputil.ZipDir. - ExportSimulatorDiagnostics appends .zip to the destination explicitly. v1's /usr/bin/zip auto-appended .zip when the destination had no extension; the pure-Go v2 writer uses the exact path, so this keeps the produced artifact name unchanged. - Bump go-utils/v2 to the ziputil-v2 branch and re-vendor. This also extends fileutil.FileManager with CopyFileFS, so the generated mock gains that method. The go-utils/v2 pin points at an unmerged branch; it must be repinned to a released tag once bitrise-io/go-utils PR 231 merges.
Temporary verification pointer. Revert to master once the sample repo PRs merge: - sample-apps-ios-simple-objc-with-uitest#4 - sample-swift-project-with-parallel-ui-test#15
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.
What
Migrates this step from the go-utils v1
ziputilpackage to the pure-Go v2ziputil.ZipManager.outputinjects a minimalDirZipperinterface into theexporterand callsZipManager.ZipDirinstead of the package-levelziputil.ZipDir.main.goconstructs theZipManager(reusing the existingpathChecker) and wires it in.go-utils/v2and re-vendors.Why it matters
v1 shelled out to
/usr/bin/zip -rTy. v2 reimplements zipping in Go (archive/zip) with its own symlink, permission, mtime, and zip-slip handling. The only production path this step exercises isZipDirwithisContentOnly=true, viaExportSimulatorDiagnostics.Behavioral note
ExportSimulatorDiagnosticsnow appends.zipto the destination explicitly. v1's/usr/bin/zipauto-appended.zipwhen the destination had no extension; the pure-Go v2 writer uses the exact path given, so this keeps the produced artifact name (Simulator.zip) unchanged.Mock update
The go-utils/v2 bump extends
fileutil.FileManagerwithCopyFileFS, so the generatedmocks/FileManagergains that method.Draft: blocked on the library
go.modpins go-utils/v2 to a pseudo-version off an unmerged branch:v2.0.0-alpha.36.0.20260612135825-fa80291d0871Before this can leave draft:
alpha.NNtag.go.modto that tag and re-vendor.Testing
go build ./...,go vet ./...green.TZ=UTC go test ./...green.