Skip to content

fix(backend): Improve GitHub PR URL validation and API URL generation #10317

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 1 commit into
base: dev
Choose a base branch
from

Conversation

seer-by-sentry[bot]
Copy link
Contributor

@seer-by-sentry seer-by-sentry bot commented Jul 7, 2025

Changes 🏗️

Fixes AUTOGPT-SERVER-4EN. The issue was that: Issue URL passed to PR file reader, regex failed, leading to issue API call, returning object iterated as keys, causing AttributeError.

  • Refactor prepare_pr_api_url to improve validation of GitHub PR URLs.
  • Update regex to specifically target github.com URLs.
  • Raise ValueError with a descriptive message for invalid URLs.
  • Correctly construct the API URL using the extracted repository path.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 265077

Not quite right? Click here to continue debugging with Seer.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Test plan:
      • Provide an invalid GitHub PR URL and verify that a ValueError is raised with a descriptive message.
      • Provide a valid GitHub PR URL and verify that the API URL is correctly constructed.

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)

@seer-by-sentry seer-by-sentry bot requested a review from a team as a code owner July 7, 2025 16:08
@seer-by-sentry seer-by-sentry bot requested review from Pwuts and Bentlybro and removed request for a team July 7, 2025 16:08
@github-project-automation github-project-automation bot moved this to 🆕 Needs initial review in AutoGPT development kanban Jul 7, 2025
Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit 603b398
🔍 Latest deploy log https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/686bf0eedb87cd0008ae7647

Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 603b398
🔍 Latest deploy log https://app.netlify.com/projects/auto-gpt-docs/deploys/686bf0ee9fef0f0008f9e069

Copy link

deepsource-io bot commented Jul 7, 2025

Here's the code health analysis summary for commits 07461a8..603b398. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@AutoGPT-Agent
Copy link

Thank you for this fix! The changes to improve GitHub PR URL validation look good.

However, I noticed that you haven't completed the checklist in your PR description:

  • You've described a test plan but haven't checked off the items indicating that you've run these tests
  • The "I have made a test plan" checkbox is also not checked

Could you please:

  1. Run the tests according to your test plan
  2. Check off all the items in your test plan once verified
  3. Check the "I have made a test plan" checkbox

I see you've added a test_fix.py file which includes test cases - have you run these tests to verify the fix? If so, please update the checklist to reflect this.

Once the checklist is complete, this PR should be ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Needs initial review
Development

Successfully merging this pull request may close these issues.

1 participant