Skip to content

ci: add /request-review and /unrequest-review comment commands#4986

Open
Ma77Ball wants to merge 1 commit intoapache:mainfrom
Ma77Ball:feat/requestReview
Open

ci: add /request-review and /unrequest-review comment commands#4986
Ma77Ball wants to merge 1 commit intoapache:mainfrom
Ma77Ball:feat/requestReview

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 8, 2026

What changes were proposed in this PR?

  • Renamed .github/workflows/take-commands.yml → .github/workflows/comment-commands.yml, since the workflow now handles more than just /take and /untake.
  • Added a new request-review job that handles two new slash commands on PRs:
    • /request-review @alice @bob requests reviews from the listed users/teams.
    • /unrequest-review @alice cancels a pending review request.
  • Authorization: PR author (fast path) or any committer with write/maintain/admin permission. Anyone else is rejected and logged.
  • Supports both individual users (@alice) and teams (@org/team-name); routes them to the correct API bucket.
  • Strips self-mentions before calling the API so the atomic call doesn't fail over a single bad name.
  • Workflow renamed Issue take commands → Comment commands and granted pull-requests: write.
  • Avoids the /review namespace so it stays free for future use (e.g., self-review).

Any related issues, documentation, or discussions?

Closes: #4975

How was this PR tested?

Tested on my local fork.

Was this PR authored or co-authored using generative AI tooling?

Co-Authored with Claude Opus 4.7 in Compliance with ASF

@github-actions github-actions Bot added feature ci changes related to CI labels May 8, 2026
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

Ma77Ball commented May 8, 2026

@aglinxinyuan please review.

Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang left a comment

Choose a reason for hiding this comment

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

LGTM! This should be useful! Left some minor comments


// Authorize: PR author always, otherwise commenter must hold
// write/maintain/admin on the repo (i.e. a committer).
let allowed = commenter === author;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can just allow PR authors to use this. Committers can use GitHub UI already.

// reject the whole atomic call over one bad name.
const reviewers = [];
const team_reviewers = [];
for (const [, h] of match[2].matchAll(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious, can we also allow copilot to be requested as reviewer?

@Yicong-Huang
Copy link
Copy Markdown
Contributor

Yicong-Huang commented May 8, 2026

@aglinxinyuan please review.

Can you try it on this PR? I.e., Use /request-review to request review from @aglinxinyuan. It supposed to work.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.72%. Comparing base (b4f3a41) to head (82bb911).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #4986   +/-   ##
=========================================
  Coverage     42.72%   42.72%           
  Complexity     2185     2185           
=========================================
  Files          1031     1031           
  Lines         38152    38152           
  Branches       4004     4004           
=========================================
  Hits          16302    16302           
  Misses        20831    20831           
  Partials       1019     1019           
Flag Coverage Δ
access-control-service 39.53% <ø> (ø)
agent-service 33.72% <ø> (ø)
amber 43.22% <ø> (ø)
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.18% <ø> (ø)
frontend 33.08% <ø> (ø)
python 88.90% <ø> (ø)
workflow-compiling-service 47.72% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-triage: support /review and /unreview comments to request reviewers on PRs

3 participants