Skip to content

Conversation

@priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Oct 15, 2025

Problem
The Slack API has some limitations (see the PR discussion). We list up to 1,000 channels in the dropdown, but users might not find the one they want. To address this, we will allow users to manually enter a channel. If the channel was typed instead of selected from the list, we want to validate it on the component’s onBlur event.

Solution
We’re introducing a separate endpoint specifically for channel validation, since the form might not be complete and we cannot fire the same request used when submitting the form.

This validation may not be necessary for MS Teams or Discord, but we can include it for consistency.

Contributes to https://linear.app/getsentry/issue/TET-1229/implement-dropdown-or-validation-for-slack-field

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 15, 2025
@linear
Copy link

linear bot commented Oct 15, 2025

@priscilawebdev priscilawebdev changed the title feat(integration): Add endpoint to validate a custom integration channel feat(integration): Add endpoint to validate a manual entered channel Oct 15, 2025
@priscilawebdev priscilawebdev changed the title feat(integration): Add endpoint to validate a manual entered channel feat(integration): Add endpoint to validate a manually entered channel Oct 15, 2025
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

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

Files with missing lines Patch % Lines
...oints/organization_integration_channel_validate.py 91.83% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #101508      +/-   ##
===========================================
+ Coverage   79.87%    80.99%   +1.11%     
===========================================
  Files        8697      8705       +8     
  Lines      386780    386842      +62     
  Branches    24514     24471      -43     
===========================================
+ Hits       308958    313306    +4348     
+ Misses      77474     73185    -4289     
- Partials      348       351       +3     

Copy link
Member

@leeandher leeandher left a comment

Choose a reason for hiding this comment

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

Looks great! Minor comments, but logically looks excellent, great tests too 🔥

Comment on lines 91 to 93
except Exception as e:
return Response(
{"valid": False, "detail": str(e) or "Unexpected error"},
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this large wrapping try/except, If there are individual parts we worry about failing or timing out (maybe the slack util get_channel_id, and the other equivalents) then we can just wrap those portions so it's easier to understand what we're worrying about breaking.

That said anything that isn't an API call out to an integration seems super straight forward to me so I don't think this is necessary!

Copy link
Member Author

@priscilawebdev priscilawebdev Oct 16, 2025

Choose a reason for hiding this comment

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

Thanks for the feedback! I updated the code so it no longer exposes raw responses, filters out known exceptions (ApiError, ValidationError, etc.), and uses sentry_sdk.capture_exception just for unexpected errors. I kept a single try/except around everything for simplicity - hope that is fine!

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 16, 2025
@github-actions
Copy link
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@priscilawebdev priscilawebdev marked this pull request as ready for review October 16, 2025 08:33
@priscilawebdev priscilawebdev requested review from a team as code owners October 16, 2025 08:34
@priscilawebdev priscilawebdev enabled auto-merge (squash) October 16, 2025 08:34
@priscilawebdev priscilawebdev merged commit fd59e87 into master Oct 16, 2025
69 checks passed
@priscilawebdev priscilawebdev deleted the priscila/feat/integrations/add-endpoint-for-custom-channel-validation branch October 16, 2025 21:04
@ryan953 ryan953 removed the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 16, 2025
@sentry
Copy link

sentry bot commented Oct 21, 2025

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants