Skip to content

feat(linear): add linear_issues, linear_notifications, linear_cycle fetchers - #195

Merged
unhappychoice merged 3 commits into
mainfrom
feat/linear-fetchers
Apr 30, 2026
Merged

unhappychoice merged 3 commits into
mainfrom
feat/linear-fetchers

Conversation

@unhappychoice

Copy link
Copy Markdown
Owner

Summary

Three Linear fetchers covering the daily-driver surfaces, sharing a single GraphQL client and token-scoped cache key. Ticks linear_issues and adds two new boxes (linear_notifications, linear_cycle) under Linear in #66.

  • linear_issues — filter-first issue list (status / assignee / team / project / priority / due / label / group_by / limit). 9 shapes, default linked_text_block. Mirrors the todoist_tasks pattern.
  • linear_notifications — inbox snapshot (mentions / assignments / comments / status changes / GitHub PR notifications). 8 shapes, default linked_text_block. Filter-first (filter_read / filter_type / filter_team / limit). Covers IssueNotification, ProjectNotification, and PullRequestNotification (Linear's GitHub-integration subtype) — PR slug parsed from pullRequest.url since the PullRequest type doesn't expose a repo-name field.
  • linear_cycle — current / next / previous / explicit cycle progress for a team. 10 shapes, default Ratio (completed/total). NumberSeries carries the burndown history (completedIssueCountHistory); Bars breaks down issue states; Calendar highlights cycle days + due dates; Badge flags on track / at risk / behind / done based on completion vs elapsed-time gap.

Safety

Safety::Safe across the family — host is api.linear.app (fixed in super::client), so the personal API key (options.token or LINEAR_TOKEN) can never be redirected. OAuth flow intentionally not supported (no place for a callback in a CLI splash).

Architectural notes

  • Shared linear/client.rs owns the GraphQL POST, semaphore (4-permit), Retry-After-honoured 429 retry, token resolution, token-scope hash for disk-cache key partitioning. Mirrors the deariary client pattern.
  • linear_notifications filters read state client-side because Linear's NotificationFilter doesn't expose readAt. actor is pulled inside each fragment because it lives on subtypes, not the Notification interface. PR notifications populate pullRequest, not issue — surfaced as <owner>/<repo>#<number> rows linked to the GitHub PR URL.
  • linear_cycle returns FetchError::Failed("no cycle matched filter") when the team has no active / matching cycle — the user can switch cycle = "next" | "previous" to see planned or recently-finished sprints. NumberSeries values are derived from the API's completedIssueCountHistory (rounded to u64).

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy --all-targets -- -D warnings clean
  • cargo test green (54 new unit tests across the family — option parsing, filter building, sort ordering, render-body shape branches, snippet truncation, repo-from-PR-URL parsing)
  • cargo run --bin splashboard -- catalog fetcher linear_{issues,notifications,cycle} resolves all shapes against compatible renderers
  • Manual smoke test against a real Linear workspace covered: PR review notifications surface as <owner>/<repo>#<n> · PR review · by @<actor> · <PR title> rows (originally the rows were sparse because PullRequestNotification is a separate subtype not covered by IssueNotification fragment).

Catalog

#66 updated:

  • linear_issues — keeps existing checkbox (will tick on merge)
  • linear_notifications — new
  • linear_cycle — new

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@unhappychoice has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 36 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aed9a07a-e796-4905-a30d-4c7aa6caf9a8

📥 Commits

Reviewing files that changed from the base of the PR and between 77d6350 and 4ae87b0.

📒 Files selected for processing (6)
  • src/fetcher/linear/client.rs
  • src/fetcher/linear/cycle.rs
  • src/fetcher/linear/issues.rs
  • src/fetcher/linear/mod.rs
  • src/fetcher/linear/notifications.rs
  • src/fetcher/mod.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/linear-fetchers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 4 minutes and 36 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

…etchers

Three fetchers covering the daily-driver Linear surfaces, sharing a single
GraphQL client + token-scoped cache key helper:

- `linear_issues` — filter-first (status/assignee/team/project/priority/due/
  label/group_by/limit), 9 shapes, default LinkedTextBlock with click-through
  to the issue page
- `linear_notifications` — inbox snapshot with read/type/team filters, 8 shapes,
  default LinkedTextBlock. Covers `IssueNotification`, `ProjectNotification`,
  and `PullRequestNotification` (Linear's GitHub-integration subtype) with the
  PR slug parsed from `pullRequest.url`
- `linear_cycle` — current/next/previous/N cycle progress for a team, 10 shapes,
  default Ratio (completed/total), NumberSeries carries the burndown history

Safety::Safe across the family — host is `api.linear.app` (fixed in
`super::client`), so the personal API key (`options.token` or `LINEAR_TOKEN`)
can never be redirected. OAuth flow is intentionally not supported (no place
for a callback in a CLI splash).

Catalog: ticks `linear_issues` and adds `linear_notifications` + `linear_cycle`
boxes under Linear in #66.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codecov

codecov Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.87936% with 472 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.19%. Comparing base (77d6350) to head (4ae87b0).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/linear/cycle.rs 69.77% 159 Missing ⚠️
src/fetcher/linear/notifications.rs 76.49% 122 Missing ⚠️
src/fetcher/linear/issues.rs 78.44% 114 Missing ⚠️
src/fetcher/linear/client.rs 57.69% 77 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
- Coverage   81.63%   81.19%   -0.45%     
==========================================
  Files         141      146       +5     
  Lines       30010    31817    +1807     
==========================================
+ Hits        24498    25833    +1335     
- Misses       5512     5984     +472     
Files with missing lines Coverage Δ
src/fetcher/linear/mod.rs 100.00% <100.00%> (ø)
src/fetcher/mod.rs 85.17% <100.00%> (+0.12%) ⬆️
src/fetcher/linear/client.rs 57.69% <57.69%> (ø)
src/fetcher/linear/issues.rs 78.44% <78.44%> (ø)
src/fetcher/linear/notifications.rs 76.49% <76.49%> (ø)
src/fetcher/linear/cycle.rs 69.77% <69.77%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

unhappychoice and others added 2 commits April 29, 2026 23:24
27 new tests across the family closing visible holes:

- issues: TextBlock limit cap, Markdown bold/italic, Entries
  state→Status mapping, Calendar month filtering, Timeline
  state+priority detail, Bars `group_by = "status"`, cmp_views
  tie-break by due date
- notifications: to_view subject-extraction priority chain
  (issue > pull_request > project), snippet truncation, missing
  actor elision, TextBlock cap, Entries unread status, Timeline
  ts+status, Badge warn band, pretty_type PR review/PR/humanise
- cycle: previous/garbage filter fallbacks, TextBlock dates,
  Markdown bold, Entries 6 canonical rows, Bars state
  breakdown, Calendar events + anchor clamp when today is past
  cycle, badge_label done branch, days_left clamp

54 → 81 unit tests; build / clippy / fmt all clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@unhappychoice
unhappychoice merged commit e875986 into main Apr 30, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/linear-fetchers branch April 30, 2026 04:37
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