You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: cherry-pick PR creation fails when PR author cannot be assigned #1050
When cherry-picking a PR to target branches, the gh pr create command includes --assignee {pr_author}. If the PR author is not a collaborator with appropriate permissions on the repository, GitHub rejects the assignee and the entire PR creation fails.
Problem / Motivation
This happened on RedHatQE/mtv-api-tests#371 where user rgolangh (who submitted via a fork) could not be assigned on RedHatQE/mtv-api-tests.
Error from logs:
Cherry pick PR creation failed: --- could not assign user: 'rgolangh' not found
Root Cause
In webhook_server/libs/handlers/runner_handler.py line 855:
The --assignee flag is unconditionally set to the PR author without verifying they can be assigned.
Requirements
When assign_to_pr_owner is enabled, first attempt to use the PR author as assignee
If gh pr create fails due to assignee not found, retry without the --assignee flag (or with a fallback assignee from the OWNERS file / repository approvers)
The cherry-pick PR creation should not fail just because the author can't be assigned
Add test coverage for the fallback scenario
Deliverables
Update cherry-pick PR creation to handle assignee failures gracefully
Fall back to a maintainer/approver from the OWNERS file if the PR author cannot be assigned
Add/update tests for the new behavior
Notes
The fix should be in webhook_server/libs/handlers/runner_handler.py in the cherry-pick PR creation logic. The fallback should be silent (log a warning, not post a PR comment about the fallback).
Activity
fix: handle cherry-pick PR assignee failure gracefully