[ci] Make patch releases from release-X.Y branches - #816
Conversation
WalkthroughThis update modifies two GitHub Actions workflow files related to release and tag handling. The release workflow now uses forced tag creation and pushing to ensure tags are overwritten if they already exist. The tag workflow introduces dynamic detection of the base branch for tags, enforces stricter branch criteria, and reorganizes steps with clearer annotations. It also removes the tag deletion step and updates the pull request creation to use the dynamically determined base branch. The workflows are now more robust in handling tags and releases, with improved control flow and documentation. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Repository
participant Maintainer
GitHub Actions->>Repository: Detect tag push
GitHub Actions->>GitHub Actions: Determine base branch (must be 'main' or 'release-X.Y')
alt Valid base branch
GitHub Actions->>GitHub Actions: Proceed with workflow steps
GitHub Actions->>Repository: Build artifacts, create/reuse draft release, upload assets, run tests
GitHub Actions->>Repository: Create PR with base branch
else Invalid base branch
GitHub Actions->>GitHub Actions: Fail workflow early
end
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/tags.yaml (1)
50-50: Remove trailing whitespace for YAML lint compliance.There is a trailing space at line 50, which can cause YAML linters to fail. Please remove it to maintain formatting standards.
- For a push event with a tag, GitHub sets context.payload.base_ref + For a push event with a tag, GitHub sets context.payload.base_ref🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 50-50: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/pull-requests-release.yaml(1 hunks).github/workflows/tags.yaml(6 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/tags.yaml
[error] 50-50: trailing spaces
(trailing-spaces)
🔇 Additional comments (3)
.github/workflows/tags.yaml (2)
42-68: Dynamic base branch detection and validation is robust and well-implemented.The logic for determining and validating the base branch from which the tag was pushed is clear, strict, and prevents accidental releases from the wrong branches. This is a best practice for release workflows.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 50-50: trailing spaces
(trailing-spaces)
111-151: Dynamic pull request creation targets correct base branch.The update to use the dynamically determined base branch for PR creation ensures that release PRs are always targeted appropriately, reducing manual errors and improving automation reliability.
.github/workflows/pull-requests-release.yaml (1)
71-72: Use of--forcefor tag creation and push aligns with robust tag management.Adding
--forceto bothgit tagandgit pushensures that tags can be safely overwritten as required by the updated release process. This is consistent with the stricter tag handling in the tags workflow.
Signed-off-by: Andrei Kvapil <[email protected]> Co-authored-by: Nick Volynkin <[email protected]>
a172129 to
7dbb8a1
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/tags.yaml (1)
49-50: Remove trailing whitespace for YAML lint compliance.There is a trailing space at line 50, flagged by static analysis. While this does not affect workflow execution, it's best practice to remove it for YAML lint compliance.
- /* - For a push event with a tag, GitHub sets context.payload.base_ref + /* + For a push event with a tag, GitHub sets context.payload.base_ref🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 50-50: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/pull-requests-release.yaml(1 hunks).github/workflows/tags.yaml(6 hunks)
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/pull-requests-release.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/tags.yaml
[error] 50-50: trailing spaces
(trailing-spaces)
🔇 Additional comments (4)
.github/workflows/tags.yaml (4)
42-68: Dynamic base branch detection and validation is robust and clear.The logic for determining and validating the base branch from which the tag was pushed is well-implemented. The workflow now fails early with clear error messages if the tag is not from
mainor arelease-X.Ybranch, preventing accidental or unauthorized releases.This is a significant improvement in release safety and clarity.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 50-50: trailing spaces
(trailing-spaces)
111-151: Dynamic PR creation using detected base branch is correct and maintainable.The pull request creation step now uses the dynamically detected base branch, ensuring that release PRs always target the correct branch. This prevents mistakes and reduces manual intervention.
The logic for checking existing PRs and labeling new ones is also clear and robust.
19-41: Release existence check and early skip logic is sound.The workflow checks for an existing non-draft release with the same tag and skips the rest of the steps if found. This prevents duplicate releases and unnecessary work.
The logic is clear and the output is easy to follow.
69-195: Step annotations and conditional execution improve maintainability.The workflow steps are now clearly annotated and conditionally executed based on whether a release already exists. This improves readability and maintainability for future contributors.
No issues found in the build, commit, branch, release, asset, or test steps.
Nick Volynkin (NickVolynkin)
left a comment
There was a problem hiding this comment.
LTGM!
This PR includes the following changes: * Do not remove version tag as part of releasing pipeline * Overwrite tag only by fact of merging releasing pull request * Automatically detect merge base and prepare pull request for this base * Allow to run pipeline only for tags created on `main` and `release-X.Y` branches Signed-off-by: Andrei Kvapil <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Improved workflow reliability by forcing Git tag creation and push to overwrite existing tags if necessary. - Enhanced workflow documentation with detailed, numbered comments for greater clarity. - Updated tag-based workflow to dynamically determine the base branch, ensuring only valid branches are used. - Removed the automatic deletion of pushed tags in the workflow. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
release-X.Y branches
This PR includes the following changes:
mainandrelease-X.YbranchesSigned-off-by: Andrei Kvapil [email protected]
Summary by CodeRabbit