-
Notifications
You must be signed in to change notification settings - Fork 2
Ticket assignment by event handling #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors ticket assignment system from direct database operations to an event-driven architecture using flow events and handlers.
- Replaces direct database calls with flow event processing for ticket assignee changes
- Introduces new event handlers and hooks for managing ticket assignments
- Standardizes event creation patterns across ticket operations
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
web/ticket/assign.go | Refactored to use event-driven approach with scenes and flow events |
web/ticket/change_topic.go | Standardized event creation pattern by extracting to variable |
web/ticket/add_note.go | Standardized event creation pattern by extracting to variable |
core/runner/handlers/ticket_assignee_changed.go | New event handler for processing ticket assignee changes |
core/runner/hooks/update_ticket_assignee.go | New hook for batch updating ticket assignees |
core/runner/hooks/insert_daily_counts.go | New hook for inserting daily count metrics |
core/models/ticket.go | Simplified TicketsChangeAssignee to only perform database update |
core/models/user.go | Added Reference method for creating user references |
core/models/notification.go | Removed NotificationsFromTicketEvents function |
core/models/ticket_test.go | Updated test to match simplified assignee change method |
go.mod | Updated goflow dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
} | ||
} | ||
|
||
scene.AttachPreCommitHook(hooks.UpdateTicketTopic, hooks.TicketAssigneeUpdate{Ticket: ticket, AssigneeID: assigneeID, UserID: userID}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hook reference should be hooks.UpdateTicketAssignee
not hooks.UpdateTicketTopic
. This appears to be using the wrong hook for assignee updates.
scene.AttachPreCommitHook(hooks.UpdateTicketTopic, hooks.TicketAssigneeUpdate{Ticket: ticket, AssigneeID: assigneeID, UserID: userID}) | |
scene.AttachPreCommitHook(hooks.UpdateTicketAssignee, hooks.TicketAssigneeUpdate{Ticket: ticket, AssigneeID: assigneeID, UserID: userID}) |
Copilot uses AI. Check for mistakes.
…o record prev assignee
06ba873
to
375c920
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
- Coverage 50.59% 50.28% -0.32%
==========================================
Files 256 259 +3
Lines 15190 15227 +37
==========================================
- Hits 7686 7657 -29
- Misses 6703 6771 +68
+ Partials 801 799 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.