Skip to content

Conversation

colinodell
Copy link
Member

@colinodell colinodell commented Jun 16, 2025

Refactoring away some of the complexity and rough edges. At a high level:

  • From Generic to Specific: Event types are no longer generic, making it easier to work with them when the payload types don't matter
  • Handler → Parser Paradigm: The concept of "handlers" has been replaced with "parsers" and "processors"
  • Global Processors: Added support for global processors that always run to perform common tasks
  • Package Consolidation: Replaced pkg/common and pkg/handler with pkg/event and pkg/validation
  • Validation Separation: Validation logic has been extracted to its own package
  • Dropped Third-Party Support: We no longer provider wrappers for github.com/go-playground/webhooks/v6 out-of-the-box

@colinodell colinodell self-assigned this Jun 16, 2025
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 83.91608% with 23 lines in your changes missing coverage. Please review.

Project coverage is 87.24%. Comparing base (0d6990c) to head (9a1c394).
Report is 6 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server.go 70.00% 8 Missing and 1 partial ⚠️
pkg/notifier/default.go 68.00% 5 Missing and 3 partials ⚠️
pkg/notifier/decorators.go 57.14% 3 Missing ⚠️
pkg/server/handler.go 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
+ Coverage   77.61%   87.24%   +9.62%     
==========================================
  Files          20       18       -2     
  Lines         983      894      -89     
==========================================
+ Hits          763      780      +17     
+ Misses        207       98     -109     
- Partials       13       16       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@colinodell
Copy link
Member Author

colinodell commented Jun 16, 2025

The failures above are due to this MR missing code coverage thresholds we normally expect for typical PRs. Because this change set is unusually large I recommend we ignore those thresholds here.

Edit: on second thought, let's use this opportunity to improve our code coverage.

@colinodell colinodell force-pushed the refactor branch 2 times, most recently from d3546c7 to 221b528 Compare June 16, 2025 20:52
@colinodell colinodell marked this pull request as ready for review June 16, 2025 20:57
@@ -0,0 +1,53 @@
// Copyright 2025 SeatGeek, Inc.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how this works, but some files have 2024 and some have 2025. I guess you just keep the year it was last touched in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, I'll take a closer look at that in a follow-up PR

return func(writer http.ResponseWriter, request *http.Request) {
slog.Debug("handling incoming webhook", "handler", s.Key(), "path", request.URL.Path)
slog.Debug("handling incoming webhook", "parser", parserKey, "path", request.URL.Path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add these as attributes so they can be reused in the logger scoped to this func?

logger := slog.With(
    slog.String("parser", parserKey),
    slog.String("path", request.URL.Path),
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I'll revisit this in a follow-up PR.

Copy link
Contributor

@bbckr bbckr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great test coverage. I just have one nit, but still approved

@colinodell colinodell merged commit 8da893c into main Jun 17, 2025
11 checks passed
@colinodell colinodell deleted the refactor branch June 17, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants