Skip to content

feat: Add ActionItem model and sync service for Linear#193

Open
spalmurray wants to merge 7 commits into
mainfrom
spalmurray/linear-action-item-sync
Open

feat: Add ActionItem model and sync service for Linear#193
spalmurray wants to merge 7 commits into
mainfrom
spalmurray/linear-action-item-sync

Conversation

@spalmurray
Copy link
Copy Markdown
Contributor

Adds the ActionItem model, migration, sync service, serializers, and admin for syncing action items from Linear parent issues. Includes throttling, assignee resolution, parent issue status updates, and deduplication across children and relations.

Split from the linear-action-items branch (PR 2 of 4). Hooks, views, and API endpoints coming in follow-up PRs.

Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py Outdated
Comment thread src/firetower/incidents/services.py Outdated
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
@spalmurray spalmurray marked this pull request as ready for review May 13, 2026 17:46
@spalmurray spalmurray requested a review from a team as a code owner May 13, 2026 17:46
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/admin.py Outdated
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
Comment thread src/firetower/incidents/services.py
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 41d1d53. Configure here.

logger.error(error_msg)
stats.errors.append(error_msg)
incident.action_items_last_synced_at = timezone.now()
incident.save(update_fields=["action_items_last_synced_at"])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed API calls incorrectly update last-synced timestamp

Medium Severity

When the Linear API fails to fetch child or related issues, the code sets action_items_last_synced_at to timezone.now(). This causes the throttle check to treat it as a successful sync, blocking non-forced retries for the full throttle period (default 300s) even though no data was actually synced. The existing sync_incident_participants_from_slack function intentionally does not update the timestamp on API failure, allowing immediate retries. This inconsistency means transient Linear API errors will suppress webhook-triggered syncs for several minutes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 41d1d53. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant