fix(retract): reliably push generated tag batches - #4885
Conversation
Empty base buckets emit one blank line from printf; mapfile then reads it as an empty element, inflating the total and creating bogus one-path orphan commits. Filter blank lines before dedup.
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability of publishing “retraction” tags used to clean up phantom module paths on the Go proxy, and adds helper scripts to verify versions and handle the two special-case phantom paths that contain ~ (invalid in git ref names).
Changes:
- Fix tag pushing in the retraction workflow by batching pushes with explicit numeric indexing and avoiding accidental arithmetic interpretation of refs.
- Add
retract-tilde.shto publish root retraction tags for the two tilde-containing phantom module paths. - Add
check-versions.shto rungo list -m -versionsacross the phantom module path list declared inretract-phantom.sh.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| retract-phantom.sh | Updates the tag batching/push logic to reliably publish generated tags in large runs. |
| retract-tilde.sh | Adds a dedicated script to publish root retraction tags for the two ~ phantom paths (invalid submodule tag refs). |
| check-versions.sh | Adds a helper to parse PHANTOM_PATHS from retract-phantom.sh and run go list -m -versions for verification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| printf '%-70s ' "$path" | ||
| go list -m -versions "$path" 2>/dev/null || printf '(no versions found)' | ||
| echo |
| content="module ${path} | ||
|
|
||
| go 1.24 | ||
|
|
||
| // Phantom path (tilde). The natural retraction tag $(basename "$path")/v1.18.2 | ||
| // is an invalid git ref name, so this retraction is published as the root tag | ||
| // ${tag} instead — which is how this path is already keyed (its versions are | ||
| // the repo's v1.x root tags). | ||
| retract [v0.0.0, ${RETRACT_MAX}] | ||
| " |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eba6e76685
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "go-micro.dev/v4/cmd/protoc-gen-micro~:v1.18.1" | ||
| "go-micro.dev/v4~:v1.18.2" |
There was a problem hiding this comment.
Do not publish the tilde retractions as root tags
When this script pushes these tags, v1.18.1 and v1.18.2 are unprefixed repository-root releases, not releases of either nested tilde module. Go resolves nested modules using tags prefixed by their repository subdirectory and reads go.mod from that subdirectory, so these tags cannot retract the intended paths; worse, each points to a commit whose root go.mod declares a tilde module, causing consumers resolving the root go-micro.dev module at these versions (including its new latest v1 version) to fail module-path validation.
Useful? React with 👍 / 👎.
| continue | ||
| fi | ||
| printf '%-70s ' "$path" | ||
| go list -m -versions "$path" 2>/dev/null || printf '(no versions found)' |
There was a problem hiding this comment.
Propagate version-query failures
When go list fails because of a proxy outage, authentication problem, unavailable toolchain, or another transient error, redirecting stderr and handling every nonzero status with printf reports (no versions found) and lets the script exit successfully. This makes an operational failure indistinguishable from the result the checker is meant to verify and can falsely certify every path during an outage; preserve the error and return a failing status instead.
Useful? React with 👍 / 👎.
Summary
retract-tilde.sh --pushto publish root tagsv1.18.1andv1.18.2This is a follow-up on top of #4884.
Testing
bash -n retract-phantom.sh./retract-phantom.sh --dry-run./retract-tilde.sh --dry-run./retract-phantom.sh --push./retract-tilde.sh --pushgo build ./...go test ./...(fails in existing network-dependent tests because the environment blocks loopback targets; AtlasCloud also returned 400)golangci-lint run ./...(cannot load configuration because installed golangci-lint was built with Go 1.24 while the module targets Go 1.25.12)Closes #4884