Skip to content

✨ feat(scm): add environment infomation to suspect commit prs #93025

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

Merged
merged 6 commits into from
Jun 20, 2025

Conversation

iamrajjoshi
Copy link
Member

@iamrajjoshi iamrajjoshi commented Jun 6, 2025

image

This pr adds environment information to pr comments.

there isn't a clean way to fetch the environment for a group since there can be many environments associated for a group, but when we open the issue details page, it defaults to opening the recommended_event (which will also be the latest_event for low frequency groups.

this made it an ideal candidate to grab the event for, then fetch its environment and show it in the pr comment. this should address the main pain point since errors in dev will be relatively new and be the recommended event

closes ECO-94

@iamrajjoshi iamrajjoshi self-assigned this Jun 6, 2025
@iamrajjoshi iamrajjoshi requested review from a team as code owners June 6, 2025 14:39
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 6, 2025
title=issue.title,
subtitle=self.format_comment_subtitle(issue.culprit),
subtitle=self.format_comment_subtitle(issue.culprit or "unknown culprit"),
Copy link
Member Author

Choose a reason for hiding this comment

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

turns out culprit is falsy

return f" Environment: *({environment.name})*"
except Exception as e:
# If anything goes wrong, just continue without environment info
logger.info(
Copy link
Member Author

Choose a reason for hiding this comment

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

not error because i don't think a sentry issue is warranted. this can happen if user doesn't set up environments as well

@iamrajjoshi iamrajjoshi changed the title ✨ feat: add environment infomation to suspect commit prs ✨ feat(scm): add environment infomation to suspect commit prs Jun 6, 2025
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...egrations/source_code_management/commit_context.py 85.71% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #93025    +/-   ##
========================================
  Coverage   88.03%   88.04%            
========================================
  Files       10335    10337     +2     
  Lines      596828   597013   +185     
  Branches    23196    23196            
========================================
+ Hits       525432   525613   +181     
- Misses      70937    70941     +4     
  Partials      459      459            

@iamrajjoshi iamrajjoshi merged commit fd4ab7b into master Jun 20, 2025
65 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/env-suspect-commits branch June 20, 2025 18:20
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 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.

2 participants