Skip to content

Conversation

rowanseymour
Copy link
Member

No description provided.

@rowanseymour rowanseymour changed the title Assignment by event Ticket assignment by event handling Sep 2, 2025
@rowanseymour rowanseymour marked this pull request as ready for review September 2, 2025 19:21
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 19:21
Copy link

@Copilot Copilot AI left a 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})
Copy link
Preview

Copilot AI Sep 2, 2025

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.

Suggested change
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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 29.12621% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.28%. Comparing base (293102f) to head (d45307b).

Files with missing lines Patch % Lines
core/runner/handlers/ticket_assignee_changed.go 5.88% 32 Missing ⚠️
core/runner/hooks/insert_daily_counts.go 0.00% 13 Missing ⚠️
core/runner/hooks/update_ticket_assignee.go 0.00% 13 Missing ⚠️
web/ticket/assign.go 73.07% 5 Missing and 2 partials ⚠️
core/models/user.go 0.00% 5 Missing ⚠️
core/models/ticket.go 80.00% 1 Missing ⚠️
web/ticket/add_note.go 66.66% 0 Missing and 1 partial ⚠️
web/ticket/change_topic.go 75.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rowanseymour rowanseymour merged commit 666960a into main Sep 2, 2025
5 checks passed
@rowanseymour rowanseymour deleted the assignment_by_event branch September 2, 2025 20:06
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants