PR-Pilot-AI / pr-pilot

An AI agent for your development workflow that can search and manipulate the code base, browse the internet and interact with Github issues and pull requests
https://www.pr-pilot.ai
GNU General Public License v3.0
148 stars 15 forks source link

✨ Add Sentry Integration to PR Pilot #190

Closed pr-pilot-ai[bot] closed 2 months ago

pr-pilot-ai[bot] commented 2 months ago

Description

This PR introduces a new Sentry integration to PR Pilot. Users can now enter their Sentry API key in the dashboard, allowing PR Pilot to interact with the Sentry API to search for issues and events.

Changes Made

Related Issue

How to Test

  1. Go to the integrations page in the dashboard.
  2. Enter a valid Sentry API key in the provided form.
  3. Verify that the key is saved and that the Sentry tools can fetch issues and events using the API key.

Notes

This integration enhances PR Pilot's capabilities by allowing it to interact with Sentry, providing users with more comprehensive tools for issue and event management.

pr-pilot-ai[bot] commented 2 months ago

The following tests failed due to the changes introduced in this PR:

  1. api/tests/test_api.py

  2. engine/agents/tests/test_tools.py

  3. engine/tests/test_models.py

  4. engine/tests/test_task_engine.py

  5. engine/tests/test_task_scheduler.py

  6. webhooks/test_webhooks.py

Cause of Failures

The errors are primarily due to the missing database table accounts_sentryintegration. This table is required by the new SentryIntegration model introduced in the PR. The tests fail because the table does not exist in the test database.

Suggested Fix

  1. Add Missing Migration: Ensure that the migration for the SentryIntegration model is created and applied. This can be done by running:

    python manage.py makemigrations accounts
    python manage.py migrate
  2. Update Tests: Ensure that the test setup includes the new migration. This can be done by adding the migration step in the test setup.

Example Code Snippet for Migration

# In your test setup file or conftest.py
import pytest
from django.core.management import call_command

@pytest.fixture(scope='session')
def django_db_setup():
    call_command('migrate', run_syncdb=True)

By ensuring the migration is applied, the tests should be able to find the accounts_sentryintegration table and pass successfully.