-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Linear action item syncing for incidents #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
spalmurray
wants to merge
29
commits into
main
Choose a base branch
from
spalmurray/linear-action-items
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
23910ec
Add Linear action item tracking via link to firetower on issue
spalmurray e5e6219
add base url to ci toml
spalmurray 7bc7563
Add trailing slash to incident URL for exact Linear attachment matching
spalmurray 39d1c4d
Remove duplicate firetower_base_url declarations
spalmurray 23b720f
Cache _get_incident result and add IncidentPermission to SyncActionIt…
spalmurray b24dce6
Scope action item update_or_create to include incident
spalmurray 93607c2
Add Bearer prefix to Linear API Authorization header
spalmurray f8252c9
Fix trailing slash mismatch and update_or_create lookup for action items
spalmurray b6dac66
Paginate Linear attachments query to fetch all results
spalmurray c08f8f5
Add trailing slash to incident URLs to prevent prefix matching
spalmurray 7d1b984
Rename admin method to avoid shadowing sync_action_items_from_linear …
spalmurray 1397f35
Add explicit permission_classes to ActionItemListView
spalmurray f48df06
Add pagination safety guards in get_issues_by_attachment_url
spalmurray 7df9f91
Update throttle timestamp on Linear API failure to prevent retry storms
spalmurray b1182a0
Move sync endpoint to /api/ path
spalmurray 0646622
Remove Jira redirect logic from incident detail view
spalmurray 1e4d71b
Replace Linear api_key config with client_id and client_secret for OAuth
spalmurray 44ff23d
Add LinearOAuthToken model for storing OAuth credentials
spalmurray 5d21355
Implement Linear OAuth 2.0 client credentials flow and update attachm…
spalmurray edbb80f
Use expires_in from Linear token response instead of hardcoded lifetime
spalmurray 2bd882c
Extract _make_graphql_request helper to deduplicate requests.post calls
spalmurray 744b8bd
Use is not None check for expires_in to handle zero values
spalmurray ffd6fd7
Add field-level encryption to LinearOAuthToken access_token
spalmurray 49ce2d8
Add salt_key config for encrypted fields with fallback to SECRET_KEY
spalmurray ee28694
Apply dual review fixes: use incident_number, add permission check, r…
spalmurray 404bfb7
Make salt_key required, use Linear user ID for external profiles, laz…
spalmurray 07e541d
Only create ExternalProfile with real Linear ID, skip sync when Linea…
spalmurray a4cd886
Remove pinned_regions that was re-introduced during rebase
spalmurray 4bc74d3
Add Linear config to CI toml so action item tests run
spalmurray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/firetower/incidents/migrations/0015_add_action_item_model.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Generated by Django 5.2.12 on 2026-04-01 19:53 | ||
|
|
||
| import django.db.models.deletion | ||
| from django.conf import settings | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("incidents", "0014_add_total_downtime"), | ||
| migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="incident", | ||
| name="action_items_last_synced_at", | ||
| field=models.DateTimeField(blank=True, null=True), | ||
| ), | ||
| migrations.CreateModel( | ||
| name="ActionItem", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.BigAutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ("linear_issue_id", models.CharField(max_length=255, unique=True)), | ||
| ("linear_identifier", models.CharField(max_length=25)), | ||
| ("title", models.CharField(max_length=500)), | ||
| ( | ||
| "status", | ||
| models.CharField( | ||
| choices=[ | ||
| ("Todo", "Todo"), | ||
| ("In Progress", "In Progress"), | ||
| ("Done", "Done"), | ||
| ("Cancelled", "Cancelled"), | ||
| ], | ||
| default="Todo", | ||
| max_length=20, | ||
| ), | ||
| ), | ||
| ("url", models.URLField(max_length=500)), | ||
| ("created_at", models.DateTimeField(auto_now_add=True)), | ||
| ("updated_at", models.DateTimeField(auto_now=True)), | ||
| ( | ||
| "assignee", | ||
| models.ForeignKey( | ||
| blank=True, | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| related_name="action_items", | ||
| to=settings.AUTH_USER_MODEL, | ||
| ), | ||
| ), | ||
| ( | ||
| "incident", | ||
| models.ForeignKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="action_items", | ||
| to="incidents.incident", | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "ordering": ["created_at"], | ||
| }, | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.