fix(ai-reviews): try to correct maintainer recognition checks#2091
fix(ai-reviews): try to correct maintainer recognition checks#2091
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
@coderabbitai suggest alternatives: perhaps, it's better to first collect all info on the user asking for |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 273 🏁 Script executed: Length of output: 219 🏁 Script executed: Length of output: 23914 🏁 Script executed: Length of output: 4983
Current approach — recapThe Alternative A — Two-job split (collect info first, then review)Split the single job into two: jobs:
gate:
if: |
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null &&
(github.event.comment.body == '/review' || startsWith(github.event.comment.body, '/review '))) ||
(github.event_name == 'pull_request_review_comment' &&
(github.event.comment.body == '/review' || startsWith(github.event.comment.body, '/review '))) ||
(github.event_name == 'pull_request' && ...)
runs-on: ubuntu-latest
outputs:
trusted: ${{ steps.check.outputs.trusted }}
pr_number: ${{ steps.check.outputs.pr_number }}
is_fork: ${{ steps.check.outputs.is_fork }}
base_ref: ${{ steps.check.outputs.base_ref }}
steps:
- name: Collect user info and PR context
id: check
env:
GH_TOKEN: ${{ github.token }}
uses: actions/github-script@...
with:
script: |
// 1. Resolve PR number
// 2. Call collaborator permission API
// 3. Fetch PR metadata (fork, base/head ref)
// 4. core.setOutput('trusted', 'true'/'false')
// 5. core.setOutput('pr_number', ...)
// etc.
pr-review:
needs: gate
if: needs.gate.outputs.trusted == 'true'
runs-on: ubuntu-latest
steps:
# No permission check needed — gate already did it
- name: Checkout
...Pros:
Cons:
Alternative B — Adopt the
|
| Job always starts? | API call? | Team-derived write? | Consistent with commander.yml? |
|
|---|---|---|---|---|
| Current | ✅ Yes (wasteful) | ✅ Always | ✅ Yes | ❌ No |
| Alt A (two-job) | ❌ Gate only | ✅ Gate job | ✅ Yes | Partial |
Alt B (author_association) |
❌ No | ❌ Never | ❌ No | ✅ Yes |
| Alt C (hybrid) | ❌ No | ✅ Yes | Mostly |
Recommendation: Alt C gives the best of both worlds — cheap job-level filtering aligned with commander.yml, plus correctness for team-derived write access. Alt A is the cleanest architecturally if you want a strict separation of "who triggered this" from "what to do about it."
Closes #1970