fix: fall back to tag_name when release name is empty in set-replaces-directive#314
fix: fall back to tag_name when release name is empty in set-replaces-directive#314thomasmaas wants to merge 2 commits into
Conversation
…-directive The set-replaces-directive target fetches the latest release name to build the OLM replaces directive. When a release has an empty name field (e.g. created without --title), jq returns an empty string, producing an invalid replaces value "authorino-operator." that fails bundle validation. Use jq's alternative operator (//) to fall back to tag_name when name is empty or null. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Thomas Maas <thomas@webtypes.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Makefile's set-replaces-directive now computes REPLACES_VERSION using ChangesMakefile change
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #314 +/- ##
=======================================
Coverage 57.20% 57.20%
=======================================
Files 13 13
Lines 1458 1458
=======================================
Hits 834 834
Misses 529 529
Partials 95 95
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Around line 367-369: The current REPLACES_VERSION assignment uses jq '.name //
.tag_name' which falls back only for null/false and yields an empty string when
"name": ""; update the jq expression used in the REPLACES_VERSION shell command
so it explicitly checks for null or empty name (e.g., use a conditional that
prefers .tag_name when .name is null or ""), ensuring REPLACES_VERSION is never
set to an empty string; modify the jq part referenced in the REPLACES_VERSION
assignment accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
jq's // operator only catches null/false, not empty string "".
The original bug was an empty name (""), so the previous fix didn't
actually cover the failing case. Use an explicit length check instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Maas <thomas@webtypes.com>
|
Actionable comments posted: 0 |
Summary
Fixes the
prepare-releasefailure in the v0.25.0 release workflow (run #26561992452).Problem
The
set-replaces-directiveMakefile target fetches the latest GitHub release name to build the OLMspec.replacesvalue. When a release has an emptynamefield (v0.23.2 was created without--title),jq -r '.name'returns an empty string, producingauthorino-operator.which fails OLM bundle validation:Fix
Use jq's alternative operator (
//) to fall back totag_namewhennameis empty or null.Also fixed:
gh release edit v0.23.2 --title v0.23.2to set the missing release name.Known limitation
This target uses
/releases/latestwhich returns the most recently published release globally, not per-branch. When releasing on multiple minor branches (e.g. v0.23.x and v0.25.x), thereplacesdirective could point to the wrong version. A follow-up should makeREPLACES_VERSIONan explicit workflow input.Test plan
gh api repos/Kuadrant/authorino-operator/releases/latest --jq '.name // .tag_name'now returnsv0.23.2Summary by CodeRabbit
Style
Chores