Skip to content

CG-17310: Disable PR creation Sentry errors #1041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Apr 15, 2025

Motivation

When trying to create a PR on a branch that already has a PR, a Sentry error is generated and the agent is not shown a good error message.

Changes

  1. Modified GitRepoClient.create_pull to check if a PR already exists for the branch before attempting to create a new one
  2. Updated Codebase.create_pr to use get_or_create_pull instead of create_pull to handle the case when a PR already exists
  3. Added a test case to verify that creating a PR on a branch that already has a PR returns the existing PR

Testing

Added a new test case test_codebase_create_pr_existing_pr that verifies the behavior when trying to create a PR on a branch that already has a PR.

Fixes CG-17310


💻 View my workAbout Codegen

@codegen-sh codegen-sh bot requested review from codegen-team and a team as code owners April 15, 2025 01:33
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.

0 participants