Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(slack): Refactor Link Identity View #72792

Merged
merged 4 commits into from
Jun 18, 2024
Merged

ref(slack): Refactor Link Identity View #72792

merged 4 commits into from
Jun 18, 2024

Conversation

iamrajjoshi
Copy link
Member

https://www.notion.so/sentry/Slack-ff5b8ab4fd1e4760ab829438ce97ce15

Addresses bot-3 task.

Here, I refactored the view to have two separate methods for get and post. I added bunch of logging and metrics & improved tests.

@iamrajjoshi iamrajjoshi requested a review from a team June 14, 2024 17:40
@iamrajjoshi iamrajjoshi self-assigned this Jun 14, 2024
@iamrajjoshi iamrajjoshi requested a review from a team as a code owner June 14, 2024 17:40
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 14, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 20 lines in your changes missing coverage. Please review.

Project coverage is 78.05%. Comparing base (4607472) to head (f2aabc8).
Report is 82 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #72792    +/-   ##
========================================
  Coverage   78.05%   78.05%            
========================================
  Files        6601     6605     +4     
  Lines      294319   294515   +196     
  Branches    50753    50763    +10     
========================================
+ Hits       229725   229886   +161     
- Misses      58358    58383    +25     
- Partials     6236     6246    +10     
Files Coverage Δ
src/sentry/integrations/slack/views/__init__.py 100.00% <100.00%> (ø)
src/sentry/integrations/slack/views/types.py 100.00% <100.00%> (ø)
...sentry/integrations/slack/views/unlink_identity.py 81.81% <72.22%> (-4.39%) ⬇️
...c/sentry/integrations/slack/views/link_identity.py 77.02% <67.39%> (-15.08%) ⬇️

... and 90 files with indirect coverage changes

except IntegrityError:
_logger.exception("slack.link.integrity_error")
metrics.incr(
self._METRICS_FAILURE_KEYKEY + ".post.identity.integrity_error",
Copy link
Contributor

Choose a reason for hiding this comment

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

might be a typo 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.

fixed

Copy link
Contributor

@ykamo001 ykamo001 left a comment

Choose a reason for hiding this comment

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

unblocking as you add more changes, functionally looks solid atm!

src/sentry/integrations/slack/views/link_identity.py Outdated Show resolved Hide resolved
Comment on lines 90 to 91
params.update({"organization": organization, "integration": integration, "idp": idp})
return super().dispatch(request, params=params)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to update params or could we just pass them into super().dispatch() as specific key word arguments? super().dispatch(org=organization)

Comment on lines 105 to 111
params = IdentityParams(
organization=params_dict["organization"],
integration=params_dict["integration"],
idp=params_dict["idp"],
slack_id=params_dict["slack_id"],
channel_id=params_dict["channel_id"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we do any key error catches here?

@iamrajjoshi iamrajjoshi merged commit 12bb4a9 into master Jun 18, 2024
48 of 49 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/mes-ref/bot-3 branch June 18, 2024 16:36
Copy link

sentry-io bot commented Jun 18, 2024

Suspect Issues

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

  • ‼️ Http404 /extensions/slack/link-identity/{signed_params}/ View Issue

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2024
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.

2 participants