fix(release): complete v0.11.0 automation path#6
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis change introduces automated release-on-merge functionality to the PR workflow. New configuration variables enable control over release dispatch, while the PR manager script now computes semantic version tags from branch names and conditionally triggers release workflows upon successful merge. Changes
Sequence DiagramsequenceDiagram
participant User
participant PR Manager
participant GitHub API
participant Release Workflow
participant Repository
User->>PR Manager: pr merge (with release-on-merge=1)
PR Manager->>GitHub API: gh pr merge [squash/auto options]
GitHub API-->>PR Manager: ✓ Merged
rect rgba(100, 200, 100, 0.5)
Note over PR Manager: Release dispatch logic
PR Manager->>Repository: Extract tag from head branch
Repository-->>PR Manager: Computed tag (e.g., v0.11.0)
PR Manager->>Repository: Check for release workflow
Repository-->>PR Manager: Workflow exists?
alt Workflow exists
PR Manager->>GitHub API: gh release view [tag]
GitHub API-->>PR Manager: Release status
PR Manager->>GitHub API: gh workflow run release.yml
GitHub API->>Release Workflow: Dispatch workflow
Release Workflow-->>GitHub API: ✓ Workflow triggered
PR Manager-->>User: status=release-dispatched
else Workflow not found
PR Manager-->>User: Release workflow not available
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ 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.
2 issues found across 6 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/github/pr_manager.py">
<violation number="1" location="scripts/github/pr_manager.py:87">
P2: Inconsistent `-dev` suffix handling: the second regex matches against original `head` instead of the `-dev`-stripped `version`. A branch named `release/X.Y.Z-dev` will silently fail to produce a tag, unlike the bare `X.Y.Z-dev` pattern which is handled correctly.</violation>
</file>
<file name="Makefile">
<violation number="1" location="Makefile:481">
P2: Use `$(POETRY_ENV) python` instead of bare `python` for the root-repo `pr_manager.py` invocation. The orchestrator call on the lines above uses `$(POETRY_ENV)` to ensure the workspace venv is active, but this new direct call doesn't, risking execution under system Python.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| version = head.removesuffix("-dev") | ||
| if re.fullmatch(r"\d+\.\d+\.\d+", version): | ||
| return f"v{version}" | ||
| match = re.fullmatch(r"release/(?P<version>\d+\.\d+\.\d+)", head) |
There was a problem hiding this comment.
P2: Inconsistent -dev suffix handling: the second regex matches against original head instead of the -dev-stripped version. A branch named release/X.Y.Z-dev will silently fail to produce a tag, unlike the bare X.Y.Z-dev pattern which is handled correctly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/github/pr_manager.py, line 87:
<comment>Inconsistent `-dev` suffix handling: the second regex matches against original `head` instead of the `-dev`-stripped `version`. A branch named `release/X.Y.Z-dev` will silently fail to produce a tag, unlike the bare `X.Y.Z-dev` pattern which is handled correctly.</comment>
<file context>
@@ -79,6 +80,41 @@ def _selector(pr_number: str, head: str) -> str:
+ version = head.removesuffix("-dev")
+ if re.fullmatch(r"\d+\.\d+\.\d+", version):
+ return f"v{version}"
+ match = re.fullmatch(r"release/(?P<version>\d+\.\d+\.\d+)", head)
+ if match:
+ return f"v{match.group('version')}"
</file context>
| match = re.fullmatch(r"release/(?P<version>\d+\.\d+\.\d+)", head) | |
| match = re.fullmatch(r"release/(?P<version>\d+\.\d+\.\d+)", version) |
| --make-arg "PR_RELEASE_ON_MERGE=$(PR_RELEASE_ON_MERGE)" \ | ||
| $(SELECTED_PROJECTS) | ||
| $(Q)if [ "$(PR_INCLUDE_ROOT)" = "1" ]; then \ | ||
| python scripts/github/pr_manager.py \ |
There was a problem hiding this comment.
P2: Use $(POETRY_ENV) python instead of bare python for the root-repo pr_manager.py invocation. The orchestrator call on the lines above uses $(POETRY_ENV) to ensure the workspace venv is active, but this new direct call doesn't, risking execution under system Python.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 481:
<comment>Use `$(POETRY_ENV) python` instead of bare `python` for the root-repo `pr_manager.py` invocation. The orchestrator call on the lines above uses `$(POETRY_ENV)` to ensure the workspace venv is active, but this new direct call doesn't, risking execution under system Python.</comment>
<file context>
@@ -471,7 +475,24 @@ pr: ## Manage pull requests for selected projects
+ --make-arg "PR_RELEASE_ON_MERGE=$(PR_RELEASE_ON_MERGE)" \
$(SELECTED_PROJECTS)
+ $(Q)if [ "$(PR_INCLUDE_ROOT)" = "1" ]; then \
+ python scripts/github/pr_manager.py \
+ --repo-root "$(CURDIR)" \
+ --action "$(PR_ACTION)" \
</file context>
| python scripts/github/pr_manager.py \ | |
| $(POETRY_ENV) python scripts/github/pr_manager.py \ |
Fix release run to avoid local tag creation when PUSH=0 in release workflow.
Summary by cubic
Automates the release workflow on PR merge for semver branches and prevents local tag creation when PUSH=0, completing the v0.11.0 release path.
New Features
Bug Fixes
Written for commit 89a0bbe. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Tests