Skip to content

Commit dcefbb9

Browse files
committed
changed filtering and var names
1 parent 73111da commit dcefbb9

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/sentry/tasks/summaries/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ def organization_project_issue_substatus_summaries(ctx: OrganizationReportContex
748748
project_ctx.total_substatus_count += item["total"]
749749

750750

751-
_PAST_ISSUES_CANDIDATE_LIMIT = 50
752-
_PAST_ISSUES_LINK_BOOST = 2
751+
PAST_ISSUES_CANDIDATE_LIMIT = 50
752+
PAST_ISSUES_LINK_BOOST = 2
753753

754754

755755
def project_past_resolved_issues(
@@ -765,7 +765,7 @@ def project_past_resolved_issues(
765765
status=GroupStatus.RESOLVED,
766766
resolved_at__gte=ctx.start,
767767
resolved_at__lt=ctx.end + timedelta(days=1),
768-
).order_by("-times_seen")[:_PAST_ISSUES_CANDIDATE_LIMIT]
768+
).order_by("-times_seen")[:PAST_ISSUES_CANDIDATE_LIMIT]
769769
)
770770

771771
if not candidates:
@@ -853,7 +853,6 @@ def _past_resolved_error_counts(
853853
Op.EQ,
854854
GroupStatus.RESOLVED,
855855
),
856-
Condition(Column("level", entity=events_entity), Op.EQ, "error"),
857856
],
858857
groupby=[Column("group_id", entity=events_entity)],
859858
orderby=[OrderBy(Function("count", []), Direction.DESC)],
@@ -926,7 +925,7 @@ def fetch_past_resolved_issue_links(ctx: OrganizationReportContext) -> None:
926925
# Re-sort with link boost applied, then truncate to top 3
927926
for project_ctx in ctx.projects_context_map.values():
928927
project_ctx.past_resolved_issues.sort(
929-
key=lambda x: x[1] * (_PAST_ISSUES_LINK_BOOST if x[2] else 1),
928+
key=lambda x: x[1] * (PAST_ISSUES_LINK_BOOST if x[2] else 1),
930929
reverse=True,
931930
)
932931
project_ctx.past_resolved_issues = project_ctx.past_resolved_issues[:3]

src/sentry/tasks/summaries/weekly_reports.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from sentry.tasks.summaries.organization_report_context_factory import (
3737
OrganizationReportContextFactory,
3838
)
39-
from sentry.tasks.summaries.utils import ONE_DAY, OrganizationReportContext
39+
from sentry.tasks.summaries.utils import ONE_DAY, PAST_ISSUES_LINK_BOOST, OrganizationReportContext
4040
from sentry.tasks.summaries.weekly_report_cache import cache_project_metrics
4141
from sentry.taskworker.namespaces import reports_tasks
4242
from sentry.types.group import GroupSubStatus
@@ -781,8 +781,6 @@ def all_key_performance_issues():
781781
return heapq.nlargest(3, all_key_performance_issues(), lambda d: d["count"])
782782

783783
def past_issues():
784-
from sentry.tasks.summaries.utils import _PAST_ISSUES_LINK_BOOST
785-
786784
def all_past_issues():
787785
for project_ctx in user_projects:
788786
for group, count, has_linked_pr_or_commit in project_ctx.past_resolved_issues:
@@ -794,7 +792,7 @@ def all_past_issues():
794792
"message": display["message"],
795793
"has_linked_pr_or_commit": has_linked_pr_or_commit,
796794
"_relevance": count
797-
* (_PAST_ISSUES_LINK_BOOST if has_linked_pr_or_commit else 1),
795+
* (PAST_ISSUES_LINK_BOOST if has_linked_pr_or_commit else 1),
798796
}
799797

800798
return heapq.nlargest(3, all_past_issues(), lambda d: d["_relevance"])

0 commit comments

Comments
 (0)