Skip to content

Conversation

cathteng
Copy link
Member

Merge into #99433 because both MSTeams and Slack use the same config schema, so we should have both action validators ready together when we make target_identifier optional on the config schema. The action validators will populate target_identifier for the Action's config for saving.

@cathteng cathteng requested review from a team as code owners September 15, 2025 21:08
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 15, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/integrations/msteams/actions/form.py 83.33% 1 Missing ⚠️
src/sentry/integrations/msteams/spec.py 0.00% 1 Missing ⚠️
src/sentry/integrations/msteams/utils.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           cathy/aci/action-validation-translators   #99540      +/-   ##
===========================================================================
- Coverage                                    81.21%   81.21%   -0.01%     
===========================================================================
  Files                                         8589     8586       -3     
  Lines                                       380345   380199     -146     
  Branches                                     24102    24102              
===========================================================================
- Hits                                        308903   308783     -120     
+ Misses                                       71096    71070      -26     
  Partials                                       346      346              

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

high level this all looks good, just a couple of nits / random suggestions. should we also have @GabeVillalobos review to make sure the changes to the integrations code is okay?

from .types import BaseActionValidatorHandler


def _get_integration(validated_data: dict[str, Any], provider: str) -> RpcIntegration:
Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid some circular dep issues; we could create action_validator folder, and have this in a utils method. then have a separate file per type; Slack, MSTeams, etc.

not too critical though, just could be a nice way to organize and reduce what's being imported per file.

)

result = validator.is_valid()
assert result is False
Copy link
Contributor

Choose a reason for hiding this comment

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

it'd be cool if this also validated the error is related to integration id (i may or may not have written a test like this, and found that the validator was failing as expected, but not for the correct reasons.. and there was just a bug in code 😅)

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@Christinarlong Christinarlong left a comment

Choose a reason for hiding this comment

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

a nit or two, also I can feel all the circular imports throughout the PR :despairge:

(possibly in coordination with grouping other integrations by purpose)
"""

from .message_builder import * # noqa: F401,F403
Copy link
Contributor

Choose a reason for hiding this comment

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

is this for a circular import? 👀 Like how much do we need this, 'cause I think init files that export modules with a bunch of stuff will cause more circular imports down the line.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes this is for a circular import

Comment on lines +35 to +36
integration = integration_service.get_integration(
integration_id=integration_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

same schtuff as the other pr on do we need an objectstatus active or smthn here 🤷‍♀️

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I forgot to keep it 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.

o I forgot I added this in in another spot. The super().clean() uses the passed in integrations to check if the integration_id is valid, and those integrations are all active so I COULD do it or not here

cursor[bot]

This comment was marked as outdated.

@cathteng cathteng merged commit 829fa59 into cathy/aci/action-validation-translators Sep 16, 2025
59 of 60 checks passed
@cathteng cathteng deleted the cathy/aci/msteams-action-validation branch September 16, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants