Skip to content

feat: add Linear destination - #195

Merged
masukai merged 3 commits into
drt-hub:mainfrom
PFCAaron12:feat/add-Linear-destination
Apr 12, 2026
Merged

feat: add Linear destination#195
masukai merged 3 commits into
drt-hub:mainfrom
PFCAaron12:feat/add-Linear-destination

Conversation

@PFCAaron12

Copy link
Copy Markdown
Collaborator

What does this PR do?

  1. Add LinearDestinationConfig to drt/config/models.py

  2. Create drt/destinations/linear.py

  3. Register in DestinationConfig union and _get_destination() in CLI

Related Issue

Closes #37

Checklist

  • Tests pass (make test)
  • Linter passes (make lint)
  • Updated CHANGELOG.md (if user-facing change)

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@masukai masukai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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! 🚀

@masukai

masukai commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Apologies for the delay. I’m away for a few days but will prioritize this when I’m back.

@PFCAaron12 PFCAaron12 changed the title git checkout -b feat/add-Linear-destination feat: add Linear destination Apr 9, 2026
@PFCAaron12

Copy link
Copy Markdown
Collaborator Author

I have made the changes and the tests are in tests/unit/test_linear_destination.py.

@PFCAaron12

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

masukai added a commit to PFCAaron12/drt that referenced this pull request Apr 12, 2026
masukai
masukai previously approved these changes Apr 12, 2026

@masukai masukai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 to LinearDestinationConfig
  • Fix resolve_env(config.team_id, config.team_id_env) so the team_id field is actually used
  • Add on_error == "fail" break logic after error handlers
  • Use sync_options.retry with _DEFAULT_RETRY fallback
  • Add default=str to json.dumps() for record preview safety
  • Trailing newlines, logger, CHANGELOG entry, module docstring
  • Test cleanup with monkeypatch for 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!

PFCAaron12 and others added 3 commits April 12, 2026 21:47
- 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>
@masukai
masukai force-pushed the feat/add-Linear-destination branch from dd50c09 to fdc3c00 Compare April 12, 2026 12:52
@masukai
masukai merged commit ea24bb9 into drt-hub:main Apr 12, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

good first issue: add Linear destination (create/update issues)

2 participants