feat(np): Adds renderer for MSTeams issue alerts#112890
feat(np): Adds renderer for MSTeams issue alerts#112890GabeVillalobos wants to merge 1 commit intomasterfrom
Conversation
| return MSTeamsMessageBuilder().build( | ||
| title=cls.build_title(group=group, issue_url=issue_url), | ||
| fields=fields, | ||
| actions=cls.build_actions(issue_url=issue_url), |
There was a problem hiding this comment.
build_actions called without required group parameter causes TypeError
On line 89, cls.build_actions(issue_url=issue_url) is called but the method signature on line 159 requires both group: Group and issue_url: str parameters. This will raise TypeError: build_actions() missing 1 required keyword-only argument: 'group' when rendering any MSTeams issue notification. The group variable is available in scope and should be passed.
Verification
Read the full file to confirm the method signature at line 159 is def build_actions(cls, *, group: Group, issue_url: str) -> list[Action] and the call at line 89 only passes issue_url=issue_url. The group parameter is required (keyword-only after *) but not provided.
Suggested fix: Pass the group parameter to build_actions
| actions=cls.build_actions(issue_url=issue_url), | |
| actions=cls.build_actions(group=group, issue_url=issue_url), |
Identified by Warden sentry-backend-bugs · 259-7AC
| event_data = invocation.event_data | ||
|
|
There was a problem hiding this comment.
Dead code: Registry.get() never returns None, so ValueError is never raised
In issue_notification_data_factory, the code checks if handler is None after calling issue_alert_handler_registry.get(action.type). However, Registry.get() raises NoRegistrationExistsError when the key is not found - it never returns None. This means the ValueError with the custom error message is dead code and will never execute. If an unsupported action type is passed, callers receive NoRegistrationExistsError instead of the intended ValueError.
Verification
Read sentry/utils/registry.py lines 45-48 confirming Registry.get() raises NoRegistrationExistsError on missing keys. The None check at line 161-162 is unreachable.
Identified by Warden sentry-backend-bugs · DTW-E3M
Backend Test FailuresFailures on
|
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.