refactor(router): extract shared credential resolution helpers#493
Closed
refactor(router): extract shared credential resolution helpers#493
Conversation
Member
|
@aaight resolve conflicts |
Collaborator
Author
Request AddressedWhat was askedResolve merge conflicts on the PR branch. Changes Made
Verification
NoteThis PR's changes were fully subsumed by PR #492. The branch is now at 0 commits ahead of |
46f19fa to
d2d53cf
Compare
Collaborator
Author
|
Conflicts resolved! I rebased the branch onto The conflicts were caused by PR #492 (
Note: This PR's commit was entirely subsumed by #492, so the branch now has 0 commits ahead of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/router/credentials.tswith three shared helpers:resolveTrelloCredentials(),resolveJiraCredentials(), andbuildGitHubHeaders()acknowledgments.ts,reactions.ts,notifications.ts, andpre-actions.tsto use these helpers, eliminating ~300 LOC of duplicationtests/unit/router/credentials.test.tswith 12 unit tests covering success + failure paths for all helpersDetails
Before: Trello credential resolution (2
getIntegrationCredentialcalls + 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
nullon failure.Zero behavior change — all 191 existing router tests continue to pass. The 6 pre-existing failures in
config/projects.test.tsare unrelated to this PR.Test plan
credentials.test.tstests pass (success + failure paths)npm run typecheck— zero errorsnpm run lint:fix— zero errors (one pre-existing warning in unrelated file)Card: https://trello.com/c/699b695aa4474a69ca67a7b9
🤖 Generated with Claude Code