Skip to content

[ISSUE #4291]♻️Refactor CI workflows to separate auto-approve and auto-merge actions for improved clarity and maintainability#4293

Closed
mxsm wants to merge 3 commits intomainfrom
refactor-4291-1
Closed

[ISSUE #4291]♻️Refactor CI workflows to separate auto-approve and auto-merge actions for improved clarity and maintainability#4293
mxsm wants to merge 3 commits intomainfrom
refactor-4291-1

Conversation

@mxsm
Copy link
Owner

@mxsm mxsm commented Nov 16, 2025

Which Issue(s) This PR Fixes(Closes)

Fixes #4291

Brief Description

How Did You Test This Change?

mxsm added 3 commits November 16, 2025 22:51
…o-merge actions for improved clarity and maintainability
…o-merge actions for improved clarity and maintainability
…o-merge actions for improved clarity and maintainability
Copilot AI review requested due to automatic review settings November 16, 2025 15:46
@rocketmq-rust-bot
Copy link
Collaborator

🔊@mxsm 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Warning

Rate limit exceeded

@mxsm has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 9935697 and 47c1873.

📒 Files selected for processing (3)
  • .github/workflows/auto-approve.yml (1 hunks)
  • .github/workflows/auto-merge.yml (1 hunks)
  • .github/workflows/ci.yaml (1 hunks)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-4291-1

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the CI/CD workflow by extracting the auto-approve and auto-merge functionality from the main CI workflow into separate, dedicated workflow files for improved modularity and maintainability.

  • Removes auto-approve and auto-merge jobs from ci.yaml
  • Creates standalone auto-approve.yml workflow that waits for CI checks and auto-approves PRs with the "auto merge" label
  • Creates standalone auto-merge.yml workflow that handles automatic merging after approval

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/ci.yaml Removed the auto-approve and auto-merge jobs to simplify the main CI workflow
.github/workflows/auto-approve.yml New workflow that auto-approves PRs after CI checks pass
.github/workflows/auto-merge.yml New workflow that handles automatic merging of approved PRs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ref: ${{ github.event.pull_request.head.sha }}
repo: ${{ github.repository }}
wait-interval: 20
running-workflow-name: "Rocketmq Rust CI"
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The running-workflow-name parameter should match the exact name of the CI workflow, which is "Rocketmq Rust CI". However, the wait-on-check-action expects check names, not workflow names. For GitHub Actions workflows, the check names are typically the job names (e.g., "Check (fmt + clippy)", "Build & Test (ubuntu-latest)", "Code Coverage"), not the workflow name.

Consider either:

  1. Waiting for specific job names instead of the workflow name
  2. Using a different approach to ensure CI has completed

Alternatively, you may need to verify if the action correctly handles workflow names in the context of GitHub Actions.

Suggested change
running-workflow-name: "Rocketmq Rust CI"
check-name: "Check (fmt + clippy), Build & Test (ubuntu-latest), Code Coverage"

Copilot uses AI. Check for mistakes.

steps:
- name: Wait for Rocketmq Rust CI to succeed
uses: lewagon/wait-on-check-action@v1.1.0
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The version v1.1.0 of lewagon/wait-on-check-action may be outdated. Consider using a more recent version (e.g., v1.3.4 or later) which includes bug fixes and improvements. Check the action's repository for the latest stable version.

Suggested change
uses: lewagon/wait-on-check-action@v1.1.0
uses: lewagon/wait-on-check-action@v1.3.4

Copilot uses AI. Check for mistakes.
with:
github-token: ${{ secrets.BOT_TOKEN }}
pull-request-number: ${{ github.event.pull_request.number }}
review-message: "LGTM✅ All required checks passed. Auto-approved for merge." No newline at end of file
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space between "LGTM" and the emoji. Should be "LGTM ✅" for better readability.

Suggested change
review-message: "LGTM✅ All required checks passed. Auto-approved for merge."
review-message: "LGTM ✅ All required checks passed. Auto-approved for merge."

Copilot uses AI. Check for mistakes.
types: [ completed ]

permissions:
pull-requests: read
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The auto-approve action requires pull-requests: write permission to approve pull requests, but the current permissions only grant pull-requests: read. This will cause the approval step to fail with a permission error.

Add pull-requests: write to the permissions section:

permissions:
  pull-requests: write
  contents: read
  checks: read
Suggested change
pull-requests: read
pull-requests: write

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +7
check_suite:
types: [ completed ]
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this workflow is triggered by a check_suite event (line 6-7), the github.event.pull_request context used in the condition (lines 18-19) and in the steps (lines 26, 35) will not be available, causing the workflow to fail or skip unexpectedly.

Consider removing the check_suite trigger or adding logic to handle this event type differently. The workflow will already be triggered by pull_request_target events when the PR is updated or labeled.

Suggested change
check_suite:
types: [ completed ]

Copilot uses AI. Check for mistakes.
@mxsm mxsm closed this Nov 16, 2025
@mxsm mxsm deleted the refactor-4291-1 branch November 16, 2025 15:55
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge refactor♻️ refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️]Refactor CI workflows to separate auto-approve and auto-merge actions for improved clarity and maintainability

4 participants