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

feat(derive_code_mapping): Support dry run mode #85065

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Feb 12, 2025

The dry run mode will allow testing the load of adding a new platform without creating the code mappings.
It will also help collect the metrics and discover any errors.

The dry run mode will allow testing the load of adding a new platform without creating the code mappings.
It will also help collect the metrics and discover any errors.
@armenzg armenzg self-assigned this Feb 12, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 12, 2025
@@ -13,7 +13,22 @@


# We only care about extensions of files which would show up in stacktraces after symbolication
SUPPORTED_EXTENSIONS = ["js", "jsx", "tsx", "ts", "mjs", "py", "rb", "rake", "php", "go", "cs"]
SUPPORTED_EXTENSIONS = [
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not making any changes besides sorting it.

@@ -1,3 +1,13 @@
SUPPORTED_INTEGRATIONS = ["github"]
# Any new languages should also require updating the stacktraceLink.tsx and repo_trees.py SUPPORTED_EXTENSIONS
SUPPORTED_LANGUAGES = ["javascript", "python", "node", "ruby", "php", "go", "csharp"]
SUPPORTED_LANGUAGES = [
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not making any changes besides sorting it.

"ruby",
]
# These languages will run as dry-run mode by default
DRY_RUN_PLATFORMS: list[str] = []
Copy link
Member Author

Choose a reason for hiding this comment

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

We will add Java at a later point or even use an option to control it.

if frame and frame.get("in_app") and frame.get("filename")
}
stacktrace_paths.update(paths)
for frame in frames:
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 is equivalent, however, I'm going to add more to it in my next PR.


try:
installation = get_installation(org)
trees = get_trees_for_org(installation, org, extra)
trees_helper = CodeMappingTreesHelper(trees)
code_mappings = trees_helper.generate_code_mappings(stacktrace_paths)
set_project_codemappings(code_mappings, installation, project)
if event.platform not in DRY_RUN_PLATFORMS:
set_project_codemappings(code_mappings, installation, project)
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 is what creates code mappings.

def create_event(
self, frames: Sequence[Mapping[str, str | bool]], platform: str | None = None
) -> Event:
def create_event(self, frames: Sequence[Mapping[str, str | bool]], platform: str) -> Event:
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing | None = None

@armenzg armenzg requested a review from MichaelSun48 February 12, 2025 16:55
@armenzg armenzg marked this pull request as ready for review February 12, 2025 16:55
@armenzg armenzg requested review from a team as code owners February 12, 2025 16:55
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/issues/auto_source_code_config/task.py 77.77% 2 Missing ⚠️
...ntry/issues/auto_source_code_config/stacktraces.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #85065    +/-   ##
========================================
  Coverage   87.93%   87.94%            
========================================
  Files        9616     9611     -5     
  Lines      542926   542173   -753     
  Branches    20996    20950    -46     
========================================
- Hits       477445   476799   -646     
+ Misses      65172    65067   -105     
+ Partials      309      307     -2     

Copy link
Member

@MichaelSun48 MichaelSun48 left a comment

Choose a reason for hiding this comment

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

Good idea! I wish I had this when I added php and go 👍

@MichaelSun48
Copy link
Member

Heads up: I reran backend test (8,14) since it appeared to flake

@armenzg
Copy link
Member Author

armenzg commented Feb 12, 2025

Heads up: I reran backend test (8,14) since it appeared to flake

Thanks! It seems to still be there. I will merge master.

@armenzg armenzg merged commit 322dbe7 into master Feb 13, 2025
49 checks passed
@armenzg armenzg deleted the feat/dry_run_platforms/auto_source/armenzg branch February 13, 2025 12:36
Copy link

sentry-io bot commented Feb 13, 2025

Suspect Issues

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

  • ‼️ KeyError: 'filename' sentry.tasks.post_process.post_process_group View Issue

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

@armenzg armenzg added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Feb 13, 2025
@getsentry-bot
Copy link
Contributor

PR reverted: c841d5a

getsentry-bot added a commit that referenced this pull request Feb 13, 2025
armenzg added a commit that referenced this pull request Feb 13, 2025
The dry run mode allows testing the load of adding a new platform without creating the code mappings. It also helps collect metrics and discover errors.

This handles the issues found in #85065.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 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 Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants