chore: create tags for go modules in subdirectories#28
Conversation
Signed-off-by: Philippe Martin <phmartin@redhat.com>
📝 WalkthroughWalkthroughThe release workflow's tag step is modified to create and push multiple git tags with different path-based prefixes (empty, Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release.yaml (1)
83-88: Go module tagging approach is correct.The prefixed tags (
cli/go/vX.Y.Z,workspace-configuration/go/vX.Y.Z) correctly match the module paths declared in their respectivego.modfiles, ensuring proper Go module proxy resolution.Optional: Quote variables and add error handling for robustness.
🛡️ Suggested improvements for shell robustness
for prefix in "" "cli/go/" "workspace-configuration/go/" do echo "Tagging with ${prefix}${NEW_GITHUB_TAG}" - git tag ${prefix}${NEW_GITHUB_TAG} - git push origin ${prefix}${NEW_GITHUB_TAG} + git tag "${prefix}${NEW_GITHUB_TAG}" + git push origin "${prefix}${NEW_GITHUB_TAG}" doneAdditionally, consider adding
set -eat the start of the script or explicit error checking to ensure partial failures don't leave the repository in an inconsistent state (e.g., some tags pushed but not others).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release.yaml around lines 83 - 88, The tag loop uses unquoted variables and lacks failure handling; update the script to quote ${NEW_GITHUB_TAG} and any expansions in echo, git tag and git push calls (refer to the loop that iterates prefixes and uses NEW_GITHUB_TAG) and add robust error handling such as enabling "set -e" at the top of the workflow or checking the exit status after each git tag/git push so the job fails fast if any tag or push fails, preventing partial tagging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/release.yaml:
- Around line 83-88: The tag loop uses unquoted variables and lacks failure
handling; update the script to quote ${NEW_GITHUB_TAG} and any expansions in
echo, git tag and git push calls (refer to the loop that iterates prefixes and
uses NEW_GITHUB_TAG) and add robust error handling such as enabling "set -e" at
the top of the workflow or checking the exit status after each git tag/git push
so the job fails fast if any tag or push fails, preventing partial tagging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f3332337-224e-44a3-8518-e705913ee056
📒 Files selected for processing (1)
.github/workflows/release.yaml
Go needs specific tags when modules are in subdirectories:
cli/go/vx.y.zandworkspace-configuration/go/vx.y.zFixes #27