ci: skip team membership check for bot actors#4301
ci: skip team membership check for bot actors#4301rnetser wants to merge 1 commit intoRedHatQE:mainfrom
Conversation
📝 WalkthroughWalkthroughThis pull request tightens a GitHub Actions job filter: it keeps the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
The tspascoal/get-user-teams-membership action fails when triggered by GitHub App bots (e.g. cnv-tests-github-webhook-dollierp[bot]) because GraphQL user(login:) cannot resolve bot accounts. Add !endsWith check to skip the job entirely for bot actors.
de0bbd2 to
cc412b9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/request-coderabbit-test-instructions.yml:
- Around line 17-18: Replace the brittle startsWith('cnv-tests-github-webhook')
check with a general bot exclusion using the PR actor login: replace the current
joint condition that references github.event.pull_request.user.login (the
!contains(...,'renovate') && !startsWith(...,'cnv-tests-github-webhook') logic)
with a single check using !endsWith(github.event.pull_request.user.login,
'[bot]') so all bot accounts (e.g., renovate[bot], dependabot[bot],
cnv-tests-... [bot]) are excluded before calling
tspascoal/get-user-teams-membership@v3.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 562d31aa-7c32-441f-84b7-da5282c0ba8d
📒 Files selected for processing (1)
.github/workflows/request-coderabbit-test-instructions.yml
| !contains(github.event.pull_request.user.login, 'renovate') && | ||
| !startsWith(github.event.pull_request.user.login, 'cnv-tests-github-webhook') |
There was a problem hiding this comment.
Implementation doesn't match the stated fix - consider broader bot exclusion.
The PR objectives state the fix should use !endsWith(github.event.pull_request.user.login, '[bot]') to exclude all bot actors, but the implementation uses !startsWith(github.event.pull_request.user.login, 'cnv-tests-github-webhook') which only excludes one specific bot prefix.
Why this matters:
- GitHub Apps convention: All bot accounts end with
[bot]suffix (e.g.,renovate[bot],dependabot[bot],cnv-tests-github-webhook-dollierp[bot]) - The
tspascoal/get-user-teams-membership@v3action fails for ANY bot account because GraphQL'suser(login:)query cannot resolveBotnodes (onlyUsernodes) - Current implementation won't protect against other bots that may trigger PRs in the future
Recommendation: Use the more general solution from the PR objectives:
🤖 Proposed fix for comprehensive bot exclusion
- !contains(github.event.pull_request.user.login, 'renovate') &&
- !startsWith(github.event.pull_request.user.login, 'cnv-tests-github-webhook')
+ !endsWith(github.event.pull_request.user.login, '[bot]')This single condition handles all bot accounts (including renovate[bot] and cnv-tests-github-webhook-*[bot]), making the workflow more maintainable and future-proof.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| !contains(github.event.pull_request.user.login, 'renovate') && | |
| !startsWith(github.event.pull_request.user.login, 'cnv-tests-github-webhook') | |
| !endsWith(github.event.pull_request.user.login, '[bot]') |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/request-coderabbit-test-instructions.yml around lines 17 -
18, Replace the brittle startsWith('cnv-tests-github-webhook') check with a
general bot exclusion using the PR actor login: replace the current joint
condition that references github.event.pull_request.user.login (the
!contains(...,'renovate') && !startsWith(...,'cnv-tests-github-webhook') logic)
with a single check using !endsWith(github.event.pull_request.user.login,
'[bot]') so all bot accounts (e.g., renovate[bot], dependabot[bot],
cnv-tests-... [bot]) are excluded before calling
tspascoal/get-user-teams-membership@v3.
Problem
The
comment-on-commitjob in therequest-coderabbit-test-instructionsworkflow fails when a PR is triggered by a GitHub App bot (e.g.,cnv-tests-github-webhook-dollierp[bot]).The
tspascoal/get-user-teams-membership@v3action uses GitHub's GraphQLuser(login:)query, which cannot resolve bot accounts (Botnodes vsUsernodes), resulting in:Failed run: https://github.com/RedHatQE/openshift-virtualization-tests/actions/runs/23626976494/job/69053639334
Fix
Add
!endsWith(github.event.pull_request.user.login, '[bot]')to the job'sifcondition to skip the entire job for bot actors. Bot-authored PRs don't need CodeRabbit test execution plan comments.Changes
.github/workflows/request-coderabbit-test-instructions.yml: Added bot actor exclusion to job conditionSummary by CodeRabbit
Note: No user-facing changes. This update refines background automation and infrastructure behavior.