Repository navigation
chore: Move redis operations to RedisRepository #WPB-29141 - #161
alexandreferris merged 2 commits into
Conversation
* Centralize Redis GET/SET operations in `RedisRepository` * Update services and dependency injection to use the repository * Add repository and credential behaviour tests
|
Review: Move Redis operations to Nice refactor. Putting the key format behind one class and injecting it, instead of using 🐛 Behavior change: a non-UUID conversation ID on the webhook route now returns 500 instead of 403
The comment in the route says it returns 403 so that GitHub doesn't keep redelivering a permanently failing delivery. A 5xx undoes that, and anyone can trigger 500s and error logs just by guessing URLs. Suggestion: parse the ID in the route the way the Actions route already does ( Minor: lookups now use the lowercased UUID The webhook key used to be built from the raw path string. It's now built from Naming consistency The repository methods are Optional: get-or-create isn't atomic (existing issue)
Small things
Summary: The structure is good and so is the test coverage. Please fix the 500-on-invalid-UUID regression on the webhook route before merging. The rest are suggestions. |
spoonman01
left a comment
There was a problem hiding this comment.
Yes good stuff. I would suggest going even further and try to remove completely ActionsTokenValidator and SignatureValidator.
They just have 2 functions wrapping the RedisRepository, they can be moved directly inside RedisRepository.
Maybe actually it's a RedisService (as there is business logic inside) but with just one class you have fetching / setting / validation of tokens and signatures, and the classes using that are abstracted away from the internal checks.
* Replace Redis repository and validators with a single RedisService * Centralize token and webhook signature validation * Update dependency injection and tests for the consolidated service
Awesome stuff! I changed to |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Issues
Code had redis operations laying around in different parts of the codebase
Solutions
RedisRepositoryTesting
Test Coverage (Optional)