Skip to content

Migrate ziputil from v1 to v2 - #265

Draft
godrei wants to merge 1 commit into
masterfrom
migrate-ziputil-to-v2
Draft

Migrate ziputil from v1 to v2#265
godrei wants to merge 1 commit into
masterfrom
migrate-ziputil-to-v2

Conversation

@godrei

@godrei godrei commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Migrates this step from the go-utils v1 ziputil package to the pure-Go v2 ziputil.ZipManager.

  • main.go constructs a ZipManager and passes it into collectFilesToDeploy and the pipeline-intermediate Collector (replacing the package-level ziputil.ZipDir).
  • Bumps go-utils/v2, which also re-vendors env, fileutil, and pathutil.
  • Adds integration tests for the collectFilesToDeploy compress path that run against a real ZipManager, covering symlink storage and archive contents.

Why it matters

v1 shelled out to /usr/bin/zip -rTy / /usr/bin/unzip. v2 reimplements zipping in Go (archive/zip) with its own symlink, permission, mtime, and zip-slip handling. The only production path this step exercises is ZipDir with isContentOnly=true.

Draft: blocked on the library

go.mod pins go-utils/v2 to a pseudo-version off an unmerged branch:
v2.0.0-alpha.36.0.20260612135825-fa80291d0871

Before this can leave draft:

  1. The ziputil library PR (bitrise-io/go-utils PR 231: Ziputil migration bitrise-io/go-utils#231) must merge and get a real alpha.NN tag.
  2. Repin go.mod to that tag and re-vendor.

Testing

  • go test ./... green (the test package's Test_ParseXctest3Results is a pre-existing local-timezone artifact; passes under TZ=UTC as CI runs it).
  • The ci workflow zips real IPA/APK dirs and .xcresult intermediates end-to-end, which is the real check that the Go reimplementation matches the old /usr/bin/zip output.

Swap go-utils v1 ziputil (which shelled out to /usr/bin/zip) for the
pure-Go go-utils/v2 ziputil ZipManager. A ZipManager is constructed in
main and passed into collectFilesToDeploy and the pipeline-intermediate
collector. Bumping go-utils/v2 also re-vendors env, fileutil and pathutil.

Add integration tests for the collectFilesToDeploy compress path that run
against a real ZipManager, covering symlink storage and archive contents.
@godrei
godrei force-pushed the migrate-ziputil-to-v2 branch from 6a0602b to 2b7f418 Compare July 3, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant