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(scm): metrics for derive_code_mappings #81329

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

cathteng
Copy link
Member

Adds SLO tracking for the derive_code_mappings task, which is currently only used for GitHub integrations.

@cathteng cathteng requested review from a team as code owners November 26, 2024 19:18
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 26, 2024
)

def test_does_not_raise_installation_removed(self):
def test_does_not_raise_installation_removed(self, mock_record):
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 test wasn't testing anything because the platform "any" was not in the list of SUPPORTED_LANGUAGES. fixed that above

Copy link
Member

@iamrajjoshi iamrajjoshi left a comment

Choose a reason for hiding this comment

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

lgtm, 1 nit

src/sentry/tasks/derive_code_mappings.py Outdated Show resolved Hide resolved
try:
with lock.acquire():
# This method is specific to the GithubIntegration
if not isinstance(installation, GitHubIntegration):
Copy link
Member

Choose a reason for hiding this comment

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

noice

Copy link
Member

@GabeVillalobos GabeVillalobos left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments but nothing blocking.

Comment on lines +58 to +62
return self.respond(
{
"text": f"The {installation.model.provider} integration does not support derived code mappings"
},
status=status.HTTP_400_BAD_REQUEST,
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 ever hit this case? If so, do we want to log 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.

no, the query for the installation only filters for github integrations. this fixes the typing but i need to return early and return something

tests/sentry/tasks/test_derive_code_mappings.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/tasks/derive_code_mappings.py 88.88% 3 Missing ⚠️
...api/endpoints/organization_derive_code_mappings.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #81329       +/-   ##
===========================================
+ Coverage   52.90%   80.35%   +27.45%     
===========================================
  Files        7195     7220       +25     
  Lines      318237   319588     +1351     
  Branches    20772    20772               
===========================================
+ Hits       168369   256814    +88445     
+ Misses     149475    62381    -87094     
  Partials      393      393               

@cathteng cathteng merged commit 21d9108 into master Nov 26, 2024
47 checks passed
@cathteng cathteng deleted the cathy/scm/derive-code-mappings-metrics branch November 26, 2024 20:36
Copy link

sentry-io bot commented Nov 26, 2024

Suspect Issues

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

  • ‼️ UnableToAcquireLock: Unable to acquire <Lock: 'get_trees_for_org:maenca'> due to error: Could not set key: 'l:get_tree... sentry.tasks.derive_code_mappings.derive_code_m... 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