Closed pr-pilot-ai[bot] closed 2 months ago
The following tests failed due to the changes introduced in this PR:
api/tests/test_api.py
engine/agents/tests/test_tools.py
engine/tests/test_models.py
engine/tests/test_task_engine.py
engine/tests/test_task_scheduler.py
webhooks/test_webhooks.py
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.
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
Update Tests: Ensure that the test setup includes the new migration. This can be done by adding the migration step in the test setup.
# 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.
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
SentryIntegration
model toaccounts/models.py
to store the Sentry API key.dashboard/templates/integrations/sentry.html
with a form to enter the Sentry API key.IntegrationView
class indashboard/views/integrations.py
to handle the Sentry API key form submission.engine/agents/integration_tools/sentry_tools.py
.engine/agents/tests/test_sentry_tools.py
.engine/agents/integration_tools/__init__.py
to include the new Sentry tools.Related Issue
SentryIntegration
model.How to Test
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.