Skip to content

[leas code] Deduplicate Linear team readers - #13417

Merged
nwparker merged 2 commits into
mainfrom
nwparker/leas-code-linear-team-readers
Aug 10, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/leas-code-linear-team-readers

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Route Linear state, label, and member reads through one private resource reader while retaining the six existing public functions. This removes repeated client selection, semaphore handling, authentication cleanup, logging, and fallback code for a net reduction of 46 lines.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Focused verification:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/linear (15 files, 109 tests)
  • pnpm exec vitest run --config config/vitest.config.ts src/main/linear/teams.test.ts src/main/ipc/linear.test.ts src/main/runtime/linear-save-issue.test.ts (3 files, 22 tests)
  • pnpm run typecheck:node
  • Targeted oxlint and oxfmt checks
  • pnpm run check:code-quality:changed
  • git diff --check

AI Review Report

The review compared every old reader with the shared path and checked client selection, missing-client fallback, acquire placement, awaited team/resource loads, authentication token clearing, ordinary error fallback, exact warning labels, and release in finally. The new matrix exercises all three fallback and throwing reader pairs, including authentication failures. The change was reviewed for macOS, Linux, and Windows and does not alter paths, shells, shortcuts, Electron behavior, SSH routing, folder workspaces, Git commands, or remote wire formats.

Security Audit

Authentication failure behavior is unchanged: the affected workspace token is cleared and the error is rethrown in both reader modes. No secrets, commands, dependencies, IPC payloads, file paths, or external input validation changed.

Notes

Independent cleanup PR based on main. The shared helper remains private to the Linear team module.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 347867cf-6b01-4e30-8a3b-1381aff85dd9

📥 Commits

Reviewing files that changed from the base of the PR and between b2e29a2 and eb31e31.

📒 Files selected for processing (2)
  • src/main/linear/teams.test.ts
  • src/main/linear/teams.ts

📝 Walkthrough

Walkthrough

The change adds a shared readTeamResource helper for Linear team state, label, and member reads. The helper centralizes client lookup, acquisition, team retrieval, authentication cleanup, warnings, fallback results, and release handling. Non-throwing readers return empty arrays for non-authentication failures. Throwing readers propagate failures. Tests add shared client lifecycle mocks and parameterized coverage for fallback behavior, error propagation, warning logs, releases, and token clearing.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: deduplicating Linear team readers; the prefix adds minor noise but does not obscure the scope.
Description check ✅ Passed The description includes all required sections and provides clear change, testing, review, security, and platform compatibility details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

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

@nwparker
nwparker merged commit 934faae into main Aug 10, 2026
44 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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