Skip to content

refactor(router): extract shared credential resolution helpers#493

Closed
aaight wants to merge 0 commit intodevfrom
feature/router-credential-helpers
Closed

refactor(router): extract shared credential resolution helpers#493
aaight wants to merge 0 commit intodevfrom
feature/router-credential-helpers

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Feb 22, 2026

Summary

  • Creates src/router/credentials.ts with three shared helpers: resolveTrelloCredentials(), resolveJiraCredentials(), and buildGitHubHeaders()
  • Refactors acknowledgments.ts, reactions.ts, notifications.ts, and pre-actions.ts to use these helpers, eliminating ~300 LOC of duplication
  • Adds tests/unit/router/credentials.test.ts with 12 unit tests covering success + failure paths for all helpers

Details

Before: Trello credential resolution (2 getIntegrationCredential calls + try/catch) was duplicated 5×; JIRA credential resolution (3 calls + findProjectById + base64 auth) was duplicated 5×; GitHub API headers object was duplicated 7× across 4 files.

After: Single call to the appropriate helper returns typed credentials or null on failure.

Zero behavior change — all 191 existing router tests continue to pass. The 6 pre-existing failures in config/projects.test.ts are unrelated to this PR.

Test plan

  • All 191 existing router tests pass
  • 12 new credentials.test.ts tests pass (success + failure paths)
  • npm run typecheck — zero errors
  • npm run lint:fix — zero errors (one pre-existing warning in unrelated file)

Card: https://trello.com/c/699b695aa4474a69ca67a7b9

🤖 Generated with Claude Code

@zbigniewsobiecki
Copy link
Copy Markdown
Member

@aaight resolve conflicts

@aaight
Copy link
Copy Markdown
Collaborator Author

aaight commented Feb 22, 2026

Request Addressed

What was asked

Resolve merge conflicts on the PR branch.

Changes Made

Verification

  • All 205 router tests passing
  • All 2645 non-config tests passing (6 pre-existing failures in config/projects.test.ts are unrelated)
  • Typecheck passing

Note

This PR's changes were fully subsumed by PR #492. The branch is now at 0 commits ahead of dev, so this PR can likely be closed.

@aaight aaight closed this Feb 22, 2026
@aaight aaight force-pushed the feature/router-credential-helpers branch from 46f19fa to d2d53cf Compare February 22, 2026 21:29
@aaight
Copy link
Copy Markdown
Collaborator Author

aaight commented Feb 22, 2026

Conflicts resolved! I rebased the branch onto dev.

The conflicts were caused by PR #492 (refactor/router-platform-clients) which landed on dev with essentially the same refactoring — extracting shared credential helpers into platformClients.ts (this PR used credentials.ts). Since dev already has the complete refactoring:

Note: This PR's commit was entirely subsumed by #492, so the branch now has 0 commits ahead of dev. You may want to close this PR since the refactoring has already been merged.

@zbigniewsobiecki zbigniewsobiecki deleted the feature/router-credential-helpers branch March 16, 2026 16:43
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.

2 participants