Skip to content

Handle repos that don't support draft PRs#823

Draft
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/d285f452-2a60-463b-9d84-b62885069db6
Draft

Handle repos that don't support draft PRs#823
codegen-sh[bot] wants to merge 2 commits intodevelopfrom
gen/d285f452-2a60-463b-9d84-b62885069db6

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 12, 2025

Description

This PR addresses the issue where the CreatePR tool fails on repositories that don't support draft PRs.

Changes

  • Modified the create_pull method in GitRepoClient to catch the specific error related to draft PRs not being supported
  • Added a fallback mechanism to retry the PR creation without the draft flag when this error occurs
  • Added appropriate logging to track when this fallback is used

Testing

This change should allow the CreatePR tool to work on all repositories, regardless of whether they support draft PRs or not.

Fixes CG-11610

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


codegen-bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant