Repository navigation
ref(github): Include Sentry user attribution in created issue body - #133345
Open
kukanggg89 wants to merge 3 commits into
Open
kukanggg89 wants to merge 3 commits into
kukanggg89 wants to merge 3 commits into
Conversation
When a Sentry user creates a GitHub issue from the issue detail page, the created issue now ends with a "*Created by Sentry on behalf of {name}*" line, so readers on GitHub know who to follow up with. The name is used as-is, with no email fallback, so nothing private leaks onto a public repository; no line is added when the user has no name set or when the issue is created automatically by a rule.
Fixes getsentry#90806
Assisted-by: Muse
|
@kukanggg89 is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
@giovanni-guidini the other PR had a comment but no reply: I'd say it's fine if we do this for GitHub only unless there's a better place to make this more at a platform level |
The named `user` parameter on the abstract `create_issue` broke mypy: the six other provider overrides only declare `(data, **kwargs)`, so the base signature no longer matched them. Drop the parameter from the base class again and read the user out of `**kwargs` in the GitHub override instead; the endpoint call passes it as a keyword argument either way. Also drop the stray blank lines at the end of the touched files that `ruff format` flagged. Assisted-by: Muse
pre-commit lint failed on the previous head because `ruff format` wanted one more blank line between two test methods in tests/sentry/integrations/github/test_issues.py. Applied the `ruff format` output verbatim; no behavior change. Assisted-by: Muse
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues created from Sentry through the GitHub integration now end with a
*Created by Sentry on behalf of {name}*line, so anyone reading the issue on GitHub can see which Sentry user created it and who to ask about it.This picks up #127187, which the stale bot closed twice while it waited for review. Two points from that review are handled here. The line uses the Sentry user's name only, with no fallback to email, so an email address never ends up in a public issue body. The wording follows the suggestion there, "Created by Sentry on behalf of {user}". No line is added when the user has no name set, or when the issue is created automatically by a rule, since that path has no acting user.
The change itself is small.
GroupIntegrationDetailsEndpoint.postpasses the signed-in user through toinstallation.create_issue,IssueBasicIntegration.create_issuetakes an optionaluserargument, andGitHubIssuesSpec.create_issueappends the line to the body when a name is present. Other providers take the same argument through**kwargsand ignore it, so only GitHub issues get the line for now, matching the scope of the issue.Tests: three new cases in
tests/sentry/integrations/github/test_issues.py. One checks the posted GitHub payload carries the attribution line for a named user, one checks the body is untouched when no user is passed, and one checks a user with no name set gets no line either. The test suite was not run locally; the new tests rely on the repo CI to run.Fixes #90806
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.