Skip to content

Commit 3b13a33

Browse files
committed
tests: include in celery task list
1 parent 1f8c910 commit 3b13a33

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/seer/automation/codebase/models.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,22 @@ class StaticAnalysisRule(BaseModel):
138138
id: int
139139
code: str
140140
tool: str
141-
is_autofixable: bool | None # refers to "Quick fix" not seer autofix
141+
is_autofixable: bool | None # refers to "Quick fix"?
142142
is_stable: bool | None
143143
category: str
144144

145+
def format_rule(self) -> str:
146+
return textwrap.dedent(
147+
f"""\
148+
Static Analysis Rule:
149+
Rule: {self.code}
150+
Tool: {self.tool}
151+
Is auto-fixable: {self.is_autofixable}
152+
Is stable: {self.is_stable}
153+
Category: {self.category}
154+
"""
155+
)
156+
145157

146158
class StaticAnalysisWarning(BaseModel):
147159
id: int
@@ -165,6 +177,6 @@ def format_warning(self) -> str:
165177
start_line: {location.start_line}
166178
end_line: {location.end_line}
167179
----------
180+
{self.rule.format_rule() if self.rule else ""}
168181
"""
169-
+ ("Rule:\n\t" + self.rule.model_dump_json(indent=2) if self.rule else "")
170182
)

src/seer/automation/codegen/relevant_warnings_component.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _is_issue_fixable_cache_key(llm_client: LlmClient, issue: SentryIssue) -> tu
3030
@cached(cache=LRUCache(maxsize=1000), key=_is_issue_fixable_cache_key)
3131
def is_issue_fixable(llm_client: LlmClient, issue: SentryIssue) -> bool:
3232
"""
33-
Given an issue, predict whether it is fixable.
33+
Given an issue, predict whether it's fixable.
3434
LRU-cached by the `issue.group_id` in case the same issue is analyzed across many requests.
3535
"""
3636
completion = llm_client.generate_structured(

tests/test_celery.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_detected_celery_jobs():
2525
"seer.automation.autofix.tasks.check_and_mark_recent_autofix_runs",
2626
"seer.automation.codegen.unittest_step.unittest_task",
2727
"seer.automation.codegen.pr_review_step.pr_review_task",
28+
"seer.automation.codegen.relevant_warnings_step.relevant_warnings_task",
2829
"seer.automation.tasks.delete_data_for_ttl",
2930
"seer.smoke_test.smoke_test",
3031
]

0 commit comments

Comments
 (0)