Refactor /assign command to separate decision from effects#1653
Conversation
Signed-off-by: hk2166 <9610hemant@gmail.com>
|
Hey @hk2166 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! PR Checks✅ DCO Sign-off -- All commits have valid sign-offs. Nice work! ✅ GPG Signature -- All commits have verified GPG signatures. Locked and loaded! ✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing! ✅ Issue Link -- Linked to #1626 (assigned to you). 🎉 All checks passed! Your PR is ready for review. Great job! |
|
Hi @gsstoykov @rwalworth , just wanted to follow up on this PR whenever you get a chance to review it. I’d especially appreciate your thoughts on the overall refactoring approach — specifically the separation between the decision layer ( The main goal was to isolate pure eligibility logic from GitHub mutations so the assignment flow becomes easier to test, reason about, and potentially reuse in future automation services, while still preserving the existing behavior and TOCTOU protections. Would love to know if this architecture direction makes sense to you or if you’d prefer a different structure before I continue building further on top of it. |
|
/working |
Refactor the /assign command to separate eligibility decisions from GitHub mutations, making the code easier to test, reason about, and migrate into a reusable automation service.
Related issue(s):
Fixes #1626
Notes for reviewer:
This refactoring introduces a two-layer architecture:
Decision Layer (`determineAssignmentEligibility`): Runs all eligibility checks and returns a structured decision object without performing any GitHub mutations. This makes the logic testable in isolation.
Effect Layer (`executeAssignmentEffects`): Takes the decision object and applies appropriate GitHub side effects (comments, assignments, labels).
Key Points: