Repository navigation
Conversation
Move mage's `Gobuild` target to a new mise task, `.mise/tasks/build/go`, as plain shell backed by shell/lib helpers (get_app_version, get_cgo_enabled, read_local_secret, get_box_field) -- the same pattern already used for the `version` and `docker-build` migrations. No Go code was needed for this migration, so `Gobuild` and the helpers only it used (readSecret, getAppVersion, getAppName, getLDFlagsStringFromMap) are removed from the mage codebase. `make gobuild` becomes a deprecation-warning wrapper around `mise run build:go`, matching the existing version/docker-build pattern; `make build` and `make devspace` call the mise task directly so they don't pay that warning's delay. The CircleCI cache-warming job now calls `mise run build:go` directly instead of through `make build`. CGO_ENABLED detection is deduplicated into a new shell/lib/bootstrap.sh helper, get_cgo_enabled, used by both shell/cgo-enabled.sh and the new task. Refs: DT-4635 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp
Match the convention used by other executable shell entrypoints (e.g. .mise/tasks/stencil/post/circleci-orb-sync) by sourcing shell/lib/shell.sh and calling ensure_bash_5_or_greater before running any logic. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp
mage gobuild to a mise task
|
Link to code coverage report (posted by coverbot 🤖) |
malept
marked this pull request as ready for review
October 2, 2026 01:56
marnagy
suggested changes
Oct 7, 2026
marnagy
left a comment
Contributor
There was a problem hiding this comment.
The Go changes only remove code, and go vet -tags mage on root/ passes with Go 1.25.7. The comments below are on the new shell task.
suggestion (non-blocking): Add a bats test for .mise/tasks/build/go.
The test should cover how the build path is selected and how the ldflags and env are assembled. At the moment, only the helper functions have tests.
praise: The dead mage helpers are fully removed, and the new get_cgo_enabled and read_local_secret helpers have tests.
- Generated using AI
- Restore plugin-over-cmd build path priority to match the old mage Gobuild behavior when a repo has both directories. - Fail loudly when box config has no org, instead of silently producing a malformed GOPRIVATE. - Propagate read_local_secret's real cat exit status, and stop swallowing stderr in the mise task so a real read error (e.g. permissions) isn't masked by the generic "missing secret" warning. - Add the devbase:sync dependency, matching the version/docker:build tasks. - Trim a comment that mostly repeated the code next to it. - Make shell/lib/box.sh's BOXPATH respect a pre-set override, like shell/lib/secrets.sh's OUTREACH_SECRETS_DIR, so tests that invoke a script in a fresh process can point it elsewhere. - Add a bats test for .mise/tasks/build/go covering build path selection and ldflags/env assembly. Addresses review comments from marnagy on #1223. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp
Addresses a further review comment from marnagy on #1223. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp
CI sets BASH_ENV to re-run `mise activate bash --shims` on every new bash process. Since each test invokes the task via `bash "$TASK"`, that re-activation re-prepended mise's real `go` shim ahead of the stub_command shim this test file put on PATH, so the tests exercised the real `go build` instead of the stub and failed with "directory prefix ... does not contain main module" in CI (this didn't reproduce locally, since my manual container runs never set BASH_ENV the way CircleCI's job setup does). Fixed by running the task via `env -u BASH_ENV bash "$TASK"`. Reproduced the CI failure locally by sourcing a BASH_ENV script that runs `mise activate bash --shims`, confirmed it fails the same way, and confirmed this fix resolves it both with and without that BASH_ENV set. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp
marnagy
approved these changes
Oct 8, 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.
What this PR does / why we need it
Moves
mage gobuildto a mise task so that building a service's binary no longer depends on mage. This is part of retiring mage in favor of mise tasks, continuing the same migration already done forversionanddocker-build.Jira ID
DT-4635
Notes for your reviewers
Gobuildturned out to be fully shell-portable, so no Go code was added;Gobuildand the helpers only it used (readSecret,getAppVersion,getAppName,getLDFlagsStringFromMap) are removed from the mage codebase.make gobuildbecomes a deprecation-warning wrapper aroundmise run build:go, matching the existingversion/docker-buildpattern.make buildandmake devspacecall the mise task directly so they don't pay that warning's delay.mise run build:godirectly instead of throughmake build. This means that job no longer runs a repository'spre-build::hooks (e.g. codegen); that's acceptable since the job only exists to warm the Go build/module cache, not to produce a real build.get_cgo_enabledhelper inshell/lib/bootstrap.sh, used by bothshell/cgo-enabled.shand the new task, so it computes a correct default even for callers (like the CircleCI job above) that bypass the Makefile.honeycomb/apiKey,telefork/api-keys/default) are best-effort, matching the old mage behavior: a warning is logged and the build continues if either is missing.get_app_version(same as theversiontask), which doesn't fall back to the commit SHA the way the oldgetAppVersion()did withgit describe --always. A repo with no version tags now embedsv0.0.0-devinstead of the SHA.~/.outreach/<app>/...) now comes fromservice.yaml'snamefield (viaget_app_name), not the current directory's basename. This also matchesdevconfig.sh, which already writes those secrets underget_app_name's value, so it's an alignment fix for repos checked out under a different directory name.cmd/devbasevia the new task, ran the resulting binary, and confirmed the embedded version/ldflags are correct with no stray output leaking into them.🤖 Generated with Claude Code
https://claude.ai/code/session_014x7tHL2QpGrPgZDfzLKXyp