Skip to content

Commit 015d47a

Browse files
🛠️ apply pre-commit fixes
1 parent fc03d98 commit 015d47a

File tree

6 files changed

+39
-30
lines changed

6 files changed

+39
-30
lines changed

src/migrations/versions/d962b4664c6a_migration.py

+30-21
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,51 @@
55
Create Date: 2025-03-17 18:08:58.255287
66
77
"""
8-
from alembic import op
9-
import sqlalchemy as sa
108

9+
import sqlalchemy as sa
10+
from alembic import op
1111

1212
# revision identifiers, used by Alembic.
13-
revision = 'd962b4664c6a'
14-
down_revision = 'cac994b711d3'
13+
revision = "d962b4664c6a"
14+
down_revision = "cac994b711d3"
1515
branch_labels = None
1616
depends_on = None
1717

1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21-
op.create_table('codegen_unit_test_generation_pr_context_to_run_id',
22-
sa.Column('id', sa.Integer(), nullable=False),
23-
sa.Column('provider', sa.String(), nullable=False),
24-
sa.Column('owner', sa.String(), nullable=False),
25-
sa.Column('pr_id', sa.BigInteger(), nullable=False),
26-
sa.Column('repo', sa.String(), nullable=False),
27-
sa.Column('run_id', sa.Integer(), nullable=False),
28-
sa.Column('iterations', sa.Integer(), nullable=False),
29-
sa.Column('original_pr_url', sa.String(), nullable=False),
30-
sa.ForeignKeyConstraint(['run_id'], ['run_state.id'], ondelete='CASCADE'),
31-
sa.PrimaryKeyConstraint('id'),
32-
sa.UniqueConstraint('provider', 'pr_id', 'repo', 'owner', 'original_pr_url')
21+
op.create_table(
22+
"codegen_unit_test_generation_pr_context_to_run_id",
23+
sa.Column("id", sa.Integer(), nullable=False),
24+
sa.Column("provider", sa.String(), nullable=False),
25+
sa.Column("owner", sa.String(), nullable=False),
26+
sa.Column("pr_id", sa.BigInteger(), nullable=False),
27+
sa.Column("repo", sa.String(), nullable=False),
28+
sa.Column("run_id", sa.Integer(), nullable=False),
29+
sa.Column("iterations", sa.Integer(), nullable=False),
30+
sa.Column("original_pr_url", sa.String(), nullable=False),
31+
sa.ForeignKeyConstraint(["run_id"], ["run_state.id"], ondelete="CASCADE"),
32+
sa.PrimaryKeyConstraint("id"),
33+
sa.UniqueConstraint("provider", "pr_id", "repo", "owner", "original_pr_url"),
3334
)
34-
with op.batch_alter_table('codegen_unit_test_generation_pr_context_to_run_id', schema=None) as batch_op:
35-
batch_op.create_index('ix_autofix_repo_owner_pr_id', ['owner', 'repo', 'pr_id', 'original_pr_url'], unique=False)
35+
with op.batch_alter_table(
36+
"codegen_unit_test_generation_pr_context_to_run_id", schema=None
37+
) as batch_op:
38+
batch_op.create_index(
39+
"ix_autofix_repo_owner_pr_id",
40+
["owner", "repo", "pr_id", "original_pr_url"],
41+
unique=False,
42+
)
3643

3744
# ### end Alembic commands ###
3845

3946

4047
def downgrade():
4148
# ### commands auto generated by Alembic - please adjust! ###
42-
with op.batch_alter_table('codegen_unit_test_generation_pr_context_to_run_id', schema=None) as batch_op:
43-
batch_op.drop_index('ix_autofix_repo_owner_pr_id')
49+
with op.batch_alter_table(
50+
"codegen_unit_test_generation_pr_context_to_run_id", schema=None
51+
) as batch_op:
52+
batch_op.drop_index("ix_autofix_repo_owner_pr_id")
4453

45-
op.drop_table('codegen_unit_test_generation_pr_context_to_run_id')
54+
op.drop_table("codegen_unit_test_generation_pr_context_to_run_id")
4655
# ### end Alembic commands ###

src/seer/automation/codegen/prompts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ class RetryUnitTestPrompts:
327327
@staticmethod
328328
def format_continue_unit_tests_prompt(code_coverage_info: str, test_result_info: str):
329329
return textwrap.dedent(
330-
"""\
330+
"""\
331331
The tests you have generated so far are not sufficient to cover all the changes in the codebase. You need to continue generating unit tests to address the gaps in coverage and fix any failing tests.
332332
333-
To help you with this, you have access to code coverage information at a file level attached as a JSON in addtion to test result information also in a JSON format.
333+
To help you with this, you have access to code coverage information at a file level attached as a JSON in addtion to test result information also in a JSON format.
334334
335335
Using the information and instructions provided, update the unit tests to ensure robust code coverage as well as fix any failing tests. Use the exact same format you used previously to regenerate tests. Your changes will be appended as a new commit to the branch of the existing PR.
336336

src/seer/automation/codegen/retry_unit_test_github_pr_creator.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import logging
22
import time
3+
34
from github.PullRequest import PullRequest
5+
46
from seer.automation.codebase.repo_client import RepoClient
57
from seer.automation.models import FileChange
68
from seer.db import DbPrContextToUnitTestGenerationRunIdMapping, Session

src/seer/automation/codegen/retry_unittest_coding_component.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
from integrations.codecov.codecov_client import CodecovClient
77
from seer.automation.agent.agent import AgentConfig, LlmAgent, RunConfig
88
from seer.automation.agent.client import AnthropicProvider, LlmClient
9-
from seer.automation.autofix.tools import BaseTools
109
from seer.automation.autofix.components.coding.models import PlanStepsPromptXml
1110
from seer.automation.autofix.components.coding.utils import (
1211
task_to_file_change,
1312
task_to_file_create,
1413
task_to_file_delete,
1514
)
15+
from seer.automation.autofix.tools import BaseTools
1616
from seer.automation.codebase.repo_client import RepoClientType
1717
from seer.automation.codegen.codegen_context import CodegenContext
1818
from seer.automation.codegen.models import CodeUnitTestOutput, CodeUnitTestRequest

src/seer/automation/codegen/unit_test_github_pr_creator.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
from seer.automation.codebase.repo_client import RepoClient
77
from seer.automation.models import FileChange
8-
from seer.db import (
9-
DbPrContextToUnitTestGenerationRunIdMapping,
10-
Session,
11-
)
8+
from seer.db import DbPrContextToUnitTestGenerationRunIdMapping, Session
129

1310
logger = logging.getLogger(__name__)
1411

tests/automation/codegen/test_retry_unit_test_step.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import unittest
22
from unittest.mock import MagicMock, patch
3-
from seer.automation.models import RepoDefinition
4-
from seer.automation.codegen.retry_unittest_step import RetryUnittestStep
3+
54
from seer.automation.codegen.retry_unit_test_github_pr_creator import RetryUnitTestGithubPrUpdater
5+
from seer.automation.codegen.retry_unittest_step import RetryUnittestStep
6+
from seer.automation.models import RepoDefinition
67
from seer.automation.state import DbStateRunTypes
78

89

0 commit comments

Comments
 (0)