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(integrations): Decouple getting trees and code mapping #83705

Merged
merged 56 commits into from
Jan 28, 2025

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Jan 20, 2025

The code to getting trees for repos (required for deriving code mappings) is strongly coupled with the GitHub client, thus, requiring making it hard to expand the feature to other integrations (upcoming work by the Ecosystem team).

This makes the logic independent from the GitHub client.

An option will control which code path to use, thus, a follow-up change will be required to deprecate the old code.

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jan 20, 2025
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 12 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../integrations/source_code_management/repo_trees.py 95.04% 6 Missing ⚠️
src/sentry/tasks/auto_source_code_config.py 84.21% 3 Missing ⚠️
src/sentry/integrations/github/client.py 89.47% 2 Missing ⚠️
...ntry/integrations/github_enterprise/integration.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #83705       +/-   ##
===========================================
+ Coverage   51.82%   87.57%   +35.74%     
===========================================
  Files        9554     9546        -8     
  Lines      541207   541401      +194     
  Branches    21331    21260       -71     
===========================================
+ Hits       280485   474120   +193635     
+ Misses     260367    66926   -193441     
  Partials      355      355               

Copy link

codecov bot commented Jan 21, 2025

Bundle Report

Changes will increase total bundle size by 3.49kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
app-webpack-bundle-array-push 33.44MB 3.49kB (0.01%) ⬆️

@@ -30,6 +30,7 @@
from sentry.integrations.models.organization_integration import OrganizationIntegration
from sentry.integrations.services.repository import RpcRepository, repository_service
from sentry.integrations.source_code_management.commit_context import CommitContextIntegration
from sentry.integrations.source_code_management.repo_trees import RepoTreesIntegration
Copy link
Member Author

@armenzg armenzg Jan 20, 2025

Choose a reason for hiding this comment

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

RepoTreesIntegration will contain much code from the GitHub client without GitHub specific code.

Copy link
Member Author

Choose a reason for hiding this comment

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

The code removed from this module belongs to getting the repo trees rather than creating the code mappings.

@armenzg armenzg requested a review from cathteng January 24, 2025 20:17
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.

Looks good!

@armenzg
Copy link
Member Author

armenzg commented Jan 27, 2025

Thanks @GabeVillalobos !

In response to Josh's comment. I spoke with him on Slack.

I will merge this tomorrow.

@armenzg armenzg enabled auto-merge (squash) January 28, 2025 13:29
armenzg added a commit that referenced this pull request Jan 28, 2025
In #83705 we created a client which is not strongly coupled with the GitHub client.

This change removes the old code.
armenzg added a commit that referenced this pull request Jan 28, 2025
In #83705 we created a client which is not strongly coupled with the GitHub client.

This change removes the old code.
@armenzg armenzg merged commit 85bd5e2 into master Jan 28, 2025
50 checks passed
@armenzg armenzg deleted the feat/decouple/get_trees_code/armenzg branch January 28, 2025 14:35
armenzg added a commit that referenced this pull request Jan 29, 2025
In #83705 we created a client not strongly coupled with the GitHub
client.

This change removes the old code.
andrewshie-sentry pushed a commit that referenced this pull request Jan 29, 2025
The code to getting trees for repos (required for deriving code
mappings) is strongly coupled with the GitHub client, thus, requiring
making it hard to expand the feature to other integrations (upcoming
work by the Ecosystem team).

This makes the logic independent from the GitHub client.

An option will control which code path to use, thus, a follow-up change
will be required to deprecate the old code.
andrewshie-sentry pushed a commit that referenced this pull request Jan 29, 2025
In #83705 we created a client not strongly coupled with the GitHub
client.

This change removes the old code.
c298lee pushed a commit that referenced this pull request Jan 29, 2025
The code to getting trees for repos (required for deriving code
mappings) is strongly coupled with the GitHub client, thus, requiring
making it hard to expand the feature to other integrations (upcoming
work by the Ecosystem team).

This makes the logic independent from the GitHub client.

An option will control which code path to use, thus, a follow-up change
will be required to deprecate the old code.
c298lee pushed a commit that referenced this pull request Jan 29, 2025
In #83705 we created a client not strongly coupled with the GitHub
client.

This change removes the old code.
Copy link

sentry-io bot commented Jan 29, 2025

Suspect Issues

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

  • ‼️ ApiError: {"detail":"Internal Error","errorId":"0a5ac1ede0744ef98746bc575a3e4574"} /api/0/organizations/{organization_id_or_slug}/... View Issue

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

@armenzg armenzg removed the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 30, 2025
armenzg added a commit that referenced this pull request Jan 30, 2025
During the refactor in #83705 I made the assumption that we would take #83984, however, that's not the case.

This fixes the bug I introduced.
armenzg added a commit that referenced this pull request Jan 31, 2025
During the refactor in #83705, I assumed we would take #83984; however,
that did not end up being the case.

This fixes the bug I introduced.
andrewshie-sentry pushed a commit that referenced this pull request Feb 5, 2025
During the refactor in #83705, I assumed we would take #83984; however,
that did not end up being the case.

This fixes the bug I introduced.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 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