feat: migrate to v2 utility libraries (STEP-2447) - #131
Open
Badlazzor wants to merge 1 commit into
Open
Conversation
Drop direct v1 `go-utils` (command, errorutil, log, pathutil, retry) and `go-steputils/commandhelper` imports. Thread a `go-utils/v2` `log.Logger` through `runGradleTask`, `findArtifacts`, `findDeployPth`, `createDeployPth`, and `failf`. Use v2 `command.Factory` for gradle invocation, v2 `fileutil.FileManager` for artifact copies (Overwrite: true to match v1 `cp -f`), and v2 `pathutil.PathChecker` for existence probes. Replace `commandhelper.RunAndExportOutput` with an inline helper backed by `export.Exporter.ExportStringToFileOutputAndReturnLastNLines`. Inline the 10-attempt / 1s wait retry loop that v1 `retry.Times().Wait().Try()` provided. `errors.As(err, *command.ExitStatusError)` replaces `errorutil.IsExitStatusError`. Parent milestone: STEP-2381 Notes: - v1 `go-utils` remains `// indirect` — v2 `export` transitively pulls `ziputil` from it. - v1 `go-steputils` fully removed from `go.mod` — nothing depends on it anymore. - No new unit tests (Milestone 6, out of scope). Existing `Test_findArtifacts` and `TestResolveGradlewPath` continue to pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Badlazzor
marked this pull request as ready for review
July 24, 2026 13:50
ofalvai
approved these changes
Jul 27, 2026
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.
Summary
go-utils(command,errorutil,log,pathutil,retry) andgo-steputils/commandhelperimports from the step.go-utils/v2log.LoggerthroughrunGradleTask,findArtifacts,findDeployPth,createDeployPth, andfailf.command.Factoryfor the gradle invocation, v2fileutil.FileManagerfor artifact copies, and v2pathutil.PathCheckerfor existence probes.commandhelper.RunAndExportOutputwith an inline helper backed byexport.Exporter.ExportStringToFileOutputAndReturnLastNLines.retry.Times().Wait().Try()provided.errors.As(err, *command.ExitStatusError)replaceserrorutil.IsExitStatusError.Parent milestone: STEP-2381
Ticket: STEP-2447
Notes
go-utilsretained as// indirect: the v2exportpackage still transitively pullsziputilfrom v1go-utils. Directrequireblock is v2-only.go-steputilsfully removed fromgo.mod— nothing depends on it anymore now thatcommandhelperis gone.cmd.PrintableCommandArgs(): v1 exposed a package-levelcommand.PrintableCommandArgs(false, cmdSlice)we could call before building the cmd. v2 exposes it only as a method on the constructed command, so theDonef("$ %s", ...)log line moved to aftercmdFactory.Create(...). The output is what the wrap layer actually invokes — arguably more accurate.fileutil.CopyFileoverwrite semantics: v1command.CopyFileusescp -fbehind the scenes (always overwrites). Matched with&fileutil.CopyOptions{Overwrite: true}. In practicefindDeployPthalready avoids collisions.wrap.DetectParams.Logger: passing the logger enables optionalDebugfon skip paths insidewrap.Detect. No-op unless debug logging is enabled (this step has no verbose flag); kept for symmetry with the v2 pattern.Test_findArtifactsandTestResolveGradlewPathcontinue to pass.Test plan
go build ./...passes (verified locally).go test -race ./...passes (verified locally).go vet ./...clean (verified locally).go-utils/go-steputilsimports in step source (verified locally).go.mod: v2 libs only in the directrequireblock; v1go-utilsdemoted to// indirect; v1go-steputilsremoved.check,e2e) passes on Bitrise CI.🤖 Generated with Claude Code