Skip to content

Add pagination safety guards in get_issues_by_attachment_url

a808bc8
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

feat: Add Linear action item syncing for incidents #139

Add pagination safety guards in get_issues_by_attachment_url
a808bc8
Select commit
Loading
Failed to load commit list.
GitHub Actions / warden completed Apr 7, 2026 in 9m 1s

1 issue

Medium

N+1 query pattern when resolving action item assignees - `src/firetower/incidents/services.py:180-197`

The loop at lines 180-202 calls _resolve_assignee_by_email() for each issue with an assignee. This function makes multiple database queries per call: one to look up the user by email, potentially creates user and userprofile records, makes a Slack API call for new users, and then does an ExternalProfile.objects.get_or_create(). With many Linear issues having assignees, this creates an N+1 query pattern that could cause significant performance degradation during sync.

Also found at:

  • src/firetower/incidents/services.py:187-202
5 skills analyzed
Skill Findings Duration Cost
security-review 0 409.8s $2.00
django-access-review 0 363.7s $3.23
django-perf-review 0 251.9s $1.69
code-review 1 533.8s $2.67
find-bugs 0 179.6s $5.16

Duration: 1738.8s · Tokens: 7.1M in / 88.8k out · Cost: $14.78 (+extraction: $0.01, +merge: $0.00, +dedup: $0.02)