feat: add Linear destination - #195
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
masukai
left a comment
There was a problem hiding this comment.
Thanks @PFCAaron12 — Linear is a useful destination for alerting workflows! 🙌
A few things to address:
1. PR title
Looks like the branch command ended up as the title — could you update it to something like feat: add Linear destination?
2. CI is failing
config.team_id is referenced in linear.py but LinearDestinationConfig only defines team_id_env. You'll need either a team_id field (like Discord's webhook_url / webhook_url_env pattern) or update the code to use resolve_env(None, config.team_id_env).
3. Missing CLI wiring
_get_destination() in drt/cli/main.py needs the Linear destination registered (import, type union, isinstance check). See how SendGrid was added in your other PR for reference.
4. Tests needed
Please add unit tests — tests/unit/test_discord.py is a good template to follow.
5. CLA
Please sign the CLA by posting a comment:
I have read the CLA Document and I hereby sign the CLA
6. Minor
- Missing newline at end of
linear.py
Also noting that #194 (SendGrid) has similar feedback — feel free to tackle both together. Happy to help if you have questions! 🚀
|
Apologies for the delay. I’m away for a few days but will prioritize this when I’m back. |
|
I have made the changes and the tests are in tests/unit/test_linear_destination.py. |
|
I have read the CLA Document and I hereby sign the CLA |
masukai
left a comment
There was a problem hiding this comment.
Thanks again, @PFCAaron12 — really appreciate the back-to-back contributions with SendGrid and now Linear! 🙌 Great to see you expanding drt's integration coverage.
The revised commit addresses most of the earlier feedback (PR title, CLI wiring, tests, CLA) — thank you for following up on those. The core logic (GraphQL mutation, template rendering, retry + rate limiting) looks solid.
I found a few alignment items compared to patterns that were recently refined across other destinations. Since the fixes are mostly mechanical, I'll merge this and apply them myself post-merge so you're not blocked. Listing them here for transparency:
Items I'll fix post-merge:
- Add
describe()method toLinearDestinationConfig - Fix
resolve_env(config.team_id, config.team_id_env)so theteam_idfield is actually used - Add
on_error == "fail"break logic after error handlers - Use
sync_options.retrywith_DEFAULT_RETRYfallback - Add
default=strtojson.dumps()for record preview safety - Trailing newlines, logger, CHANGELOG entry, module docstring
- Test cleanup with
monkeypatchfor env vars
These are all patterns refined during recent merges, so totally understandable they weren't in place here.
Merging with squash — thanks for helping expand drt's destination coverage! Linear is a great addition for engineering alerting workflows. 🎉
If you enjoy using drt, a ⭐ on the repo would mean a lot. Happy to see more PRs from you!
- Add describe() method to LinearDestinationConfig - Fix resolve_env(config.team_id, config.team_id_env) so team_id is used - Make team_id_env optional (can provide team_id directly) - Add on_error="fail" break logic after error handlers - Use sync_options.retry with _DEFAULT_RETRY fallback - Add json.dumps(row, default=str) for safe record preview - Add httpx.RequestError handler - Remove arbitrary 9 RPS rate limiter cap - Omit assigneeId from payload when None - Rewrite tests with monkeypatch (no os.environ leaks) - Add module docstring, logger - Add CHANGELOG entry - Fix trailing newlines, import ordering (ruff) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dd50c09 to
fdc3c00
Compare
What does this PR do?
Add LinearDestinationConfig to drt/config/models.py
Create drt/destinations/linear.py
Register in DestinationConfig union and _get_destination() in CLI
Related Issue
Closes #37
Checklist
make test)make lint)CHANGELOG.md(if user-facing change)