feat: Prep main for v2 merge - #251
Conversation
📝 WalkthroughWalkthroughCI now targets ChangesOperator v1 release flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHubActions
participant DockerHub
participant Quay
participant GitHubRelease
Developer->>GitHubActions: Push annotated v1.x.y tag
GitHubActions->>GitHubActions: Validate tag and origin/v1 ancestry
GitHubActions->>DockerHub: Build and publish VERSION, MINOR, MAJOR, latest
GitHubActions->>Quay: Publish VERSION, MINOR, MAJOR
GitHubActions->>GitHubRelease: Create release with generated notes
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release.yaml (1)
34-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract
BASH_REMATCHimmediately to prevent silent corruption.Relying on the
BASH_REMATCHarray across multiple intervening commands is brittle. If a future change introduces another regex match (=~) within the intermediate lines or inside a called script/completion, the array will be silently overwritten, corrupting yourminorandmajorvariables.It is a best practice to extract these values immediately after the match.
♻️ Proposed refactor
if [[ ! "${tag}" =~ ^v(1)\.([0-9]+)\.([0-9]+)$ ]]; then echo "Expected a stable v1 tag in the form v1.x.y; got ${tag}" >&2 exit 1 fi + + major="${BASH_REMATCH[1]}" + minor="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}" + version="${tag#v}" if [[ "$(git cat-file -t "refs/tags/${tag}")" != "tag" ]]; then echo "Release tag ${tag} must be annotated" >&2 exit 1 fi git fetch --no-tags origin refs/heads/v1:refs/remotes/origin/v1 tagged_commit="$(git rev-list -n 1 "${tag}")" if ! git merge-base --is-ancestor "${tagged_commit}" refs/remotes/origin/v1; then echo "Tagged commit ${tagged_commit} is not reachable from origin/v1" >&2 exit 1 fi - - version="${tag#v}" - minor="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}" - major="${BASH_REMATCH[1]}"🤖 Prompt for 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. In @.github/workflows/release.yaml around lines 34 - 54, Extract the regex capture groups from BASH_REMATCH immediately after the tag validation in the release workflow, before any git commands or other intervening operations. Update the later minor and major assignments to reuse those saved capture values, preserving the existing v1.x.y validation behavior.
🤖 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.
Nitpick comments:
In @.github/workflows/release.yaml:
- Around line 34-54: Extract the regex capture groups from BASH_REMATCH
immediately after the tag validation in the release workflow, before any git
commands or other intervening operations. Update the later minor and major
assignments to reuse those saved capture values, preserving the existing v1.x.y
validation behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 39f973d6-11c3-419b-99c4-fcf3c19294e9
📒 Files selected for processing (5)
.github/workflows/docker-build-scan.yml.github/workflows/release.yaml.github/workflows/run-tests.yaml.releaserc.jsondocs/releasing-v1.md
💤 Files with no reviewable changes (1)
- .releaserc.json
Summary by CodeRabbit
New Features
v1.x.ytags.latesttags on Docker Hub; Quay receives version, minor, and major tags.Documentation
Chores
v1branch.