Skip to content

Conversation

@yordis
Copy link
Member

@yordis yordis commented Sep 30, 2025

Problem

The GoReleaser step in the CD workflow was failing with the error:

git tag v0.2.0 was not made against commit 46a7854006e0513f3cbd00f95e57b10ccfcd92be

Root Cause Analysis

The workflow was overriding GORELEASER_CURRENT_TAG with just the semantic version (v0.2.0), but the actual git tag created by release-please uses the full monorepo format (protoc-gen-elixir-grpc@v0.2.0).

When tested locally:

  • Setting GORELEASER_CURRENT_TAG=v0.2.0git tag v0.2.0 was not made against commit...
  • Setting GORELEASER_CURRENT_TAG=protoc-gen-elixir-grpc@v0.2.0failed to parse tag as semver: invalid semantic version
  • Removing GORELEASER_CURRENT_TAG entirely → GoReleaser auto-detects the full tag correctly, but semver validation fails ⚠️

Solution

  1. Remove GORELEASER_CURRENT_TAG - Let GoReleaser auto-detect the tag from git (it correctly finds protoc-gen-elixir-grpc@v0.2.0)
  2. Add --skip=validate flag - Bypass semver validation since our tags use component@version format

Local Validation

Dry-run test confirmed the fix works:

BUILD_COMPONENT="protoc-gen-elixir-grpc" goreleaser release --clean --skip=publish,validate

Results:

  • ✅ Auto-detected tag: protoc-gen-elixir-grpc@v0.2.0
  • ✅ Built all 6 binaries successfully (darwin/linux/windows, amd64/arm64)
  • ✅ Generated correct build artifacts with version protoc-gen-elixir-grpc@v0.2.0

Impact

This fix enables the release workflow to properly handle monorepo tags for both:

  • protoc-gen-elixir-grpc
  • protoc-gen-connect-go-servicestruct

Fixes: https://github.com/TrogonStack/protoc-gen/actions/runs/18118813863/job/51559613751

@coderabbitai
Copy link

coderabbitai bot commented Sep 30, 2025

Walkthrough

The workflow now extracts the full Git tag into a tag output and logs "Extracted full tag: ${TAG}". GoReleaser Snapshot and Release steps are updated to set GORELEASER_CURRENT_TAG from steps.version.outputs.tag. No other logic changes were made.

Changes

Cohort / File(s) Summary
CI/CD workflow tag propagation
.github/workflows/cd.yml
Added extraction of full tag into a workflow output named tag and logged "Extracted full tag: ${TAG}". Updated GoReleaser Snapshot and Release steps to set GORELEASER_CURRENT_TAG from steps.version.outputs.tag.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions (cd.yml)
  participant V as Version Step
  participant S as Snapshot Job
  participant R as Release Job

  Dev->>GH: Push tag / trigger workflow
  GH->>V: Run version extraction
  V-->>GH: Outputs `tag` (full TAG) + log "Extracted full tag: ${TAG}"
  GH->>S: Run snapshot path
  note over S: env GORELEASER_CURRENT_TAG = steps.version.outputs.tag
  GH->>R: Run release path
  note over R: env GORELEASER_CURRENT_TAG = steps.version.outputs.tag
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through YAML fields with cheer,
A shiny tag now crystal-clear.
I nudge GoReleaser, “use this one!”
Full tag in paw, the build is done.
Thump-thump—logs confirm my brag. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title clearly communicates the main intention of the change by specifying that the CD workflow fix enables GoReleaser to auto-detect monorepo tags and skip semver validation, which aligns with the PR objectives of handling full tags and bypassing version checks in a monorepo context.
Description Check ✅ Passed The pull request description thoroughly addresses the CD workflow issue by explaining the problem, root cause, proposed solution, local validation steps, and impact, and it is directly related to the changes in the workflow file.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/goreleaser-tag-mismatch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@yordis yordis force-pushed the fix/goreleaser-tag-mismatch branch 2 times, most recently from a51a0c2 to 62d06c0 Compare September 30, 2025 05:17
…lidation

GoReleaser was failing with 'git tag v0.2.0 was not made against commit...' because:
- The workflow was overriding GORELEASER_CURRENT_TAG with just the version (v0.2.0)
- But the actual git tag created by release-please is the full monorepo format (protoc-gen-elixir-grpc@v0.2.0)

Solution:
- Remove GORELEASER_CURRENT_TAG override to let GoReleaser auto-detect the full tag name
- Add --skip=validate flag to bypass semver parsing (since the tag format includes component prefix)

GoReleaser correctly auto-detects the full tag and proceeds with the release when validation is skipped.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis force-pushed the fix/goreleaser-tag-mismatch branch from 62d06c0 to b386f44 Compare September 30, 2025 05:19
@yordis yordis changed the title fix(cd): use full tag name for GoReleaser to match monorepo tag format fix(cd): allow GoReleaser to auto-detect monorepo tags and skip semver validation Sep 30, 2025
@yordis yordis merged commit 626a842 into main Sep 30, 2025
3 checks passed
@yordis yordis deleted the fix/goreleaser-tag-mismatch branch September 30, 2025 05:46
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.

2 participants