sentry icon indicating copy to clipboard operation
sentry copied to clipboard

chore(notif-platform): More utility on NotificationProvider

Open leeandher opened this issue 7 months ago • 1 comments

Adds a few things to NotificationProvider

  • get_renderer() -> uses the default renderer by default
  • target_class -> must be a subclass of NotificationTarget, added a test for this
  • target_resource_types -> a list of valid resources that this provider can consume
  • validate_target -> a method for the eventual NotificationService to validate the incoming target

The NotificationTarget classes are dataclasses with their own validation. Even though it's a side-effect, I think it's reasonable to prevent initializing a dataclass which will produce an error if used, though I added a todo about a making needless RPC calls

All of the validation has added tests, and the renderers/providers being stubbed out have also been expanded.

leeandher avatar Jun 13 '25 21:06 leeandher

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #93562      +/-   ##
==========================================
+ Coverage   85.65%   88.03%   +2.38%     
==========================================
  Files       10331    10336       +5     
  Lines      596435   596434       -1     
  Branches    23161    23124      -37     
==========================================
+ Hits       510869   525088   +14219     
+ Misses      85107    70853   -14254     
- Partials      459      493      +34     

codecov[bot] avatar Jun 13 '25 21:06 codecov[bot]