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

♻️ chore(slo): SLOs for CommitContextIntegration #81225

Merged
merged 8 commits into from
Nov 25, 2024

Conversation

iamrajjoshi
Copy link
Member

take 2, added ecosystem slo event lifecycles to the mixin.

@iamrajjoshi iamrajjoshi self-assigned this Nov 24, 2024
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 24, 2024
)


class MockCommitContextIntegration(CommitContextIntegration):
Copy link
Member Author

Choose a reason for hiding this comment

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

this was the easiest way to test this.

call for call in mock_record.mock_calls if call.args[0] == EventLifecycleOutcome.HALTED
)
assert event_failures.args[1] == error_msg
if isinstance(error_msg, Exception):
Copy link
Member Author

Choose a reason for hiding this comment

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

this allows us to use these helpers when we pass an exception as well

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 99.06542% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/integrations/utils/metrics.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #81225      +/-   ##
==========================================
+ Coverage   80.25%   80.35%   +0.09%     
==========================================
  Files        7447     7220     -227     
  Lines      329627   319587   -10040     
  Branches    20779    20779              
==========================================
- Hits       264540   256791    -7749     
+ Misses      64693    62402    -2291     
  Partials      394      394              

@iamrajjoshi iamrajjoshi marked this pull request as ready for review November 25, 2024 15:22
@iamrajjoshi iamrajjoshi requested review from a team as code owners November 25, 2024 15:22
@@ -1223,10 +1229,18 @@ def test_gh_comment_debounces(self, get_jwt, mock_comment_workflow, mock_get_com
)
assert mock_comment_workflow.call_count == 1

start_1, failure_1, start_2, failure_2 = mock_record.mock_calls
assert start_1.args[0] == EventLifecycleOutcome.STARTED
assert failure_1.args[0] == EventLifecycleOutcome.SUCCESS
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit: variable names for the failures here don't match the outcomes.

try:
response = client.get_blame_for_files(files, extra)
except IdentityNotValid as e:
lifecycle.record_failure(e)
Copy link
Member

Choose a reason for hiding this comment

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

should we ask Issues team why these specific errors are caught? i'm not sure if this is a failure on our side or the user's side. it seems like this happens when refreshing the identity fails

Copy link
Member Author

Choose a reason for hiding this comment

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

let me do that. i think we can record_failure to see how often this happens then adjust?

Comment on lines +154 to +156
logger.info(
_pr_comment_log(integration_name=self.integration_name, suffix="disabled"),
extra={"organization_id": project.organization_id},
Copy link
Member

Choose a reason for hiding this comment

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

i remember we added logging when halts happen. does this mean we can remove these logs?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, once we are satisfied with the SLOs, @GabeVillalobos is tracking a task to remove these logs.

@iamrajjoshi iamrajjoshi merged commit a071e2a into master Nov 25, 2024
50 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/commit-context-slo branch November 25, 2024 18:38
Copy link

sentry-io bot commented Nov 25, 2024

Suspect Issues

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

  • ‼️ ApiInvalidRequestError sentry.tasks.process_commit_context View Issue
  • ‼️ ApiRetryError: SafeHTTPConnectionPool(host='sentry-rpc-prod-control.us.sentry.internal', port=8999): Max retries... sentry.tasks.process_commit_context View Issue
  • ‼️ IntegrationError: Identity not found. sentry.tasks.process_commit_context View Issue
  • ‼️ **ApiError: Something went wrong while executing your query. Please include 8070:1360AD:32959D2:63B23EC:6746...** sentry.tasks.process_commit_context` View Issue
  • ‼️ ApiError: {"detail":"Internal Error","errorId":"e3d5e9a7dc1146648d8ae814721a9399"} sentry.tasks.process_commit_context View Issue

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

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