-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
ref(github): PR comment workflow #89969
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(github): PR comment workflow #89969
Conversation
04a1f86
to
08c1d6d
Compare
def format_comment_url(url: str, referrer: str) -> str: | ||
return url + "?referrer=" + referrer | ||
|
||
def get_comment_body(self, issue_ids: list[int]) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously split into two methods which I've decided to combine so that it is easier to implement for each integration.
issue_comment_contents = get_comment_contents(top_5_issue_ids)
# ...
comment_body = format_comment(issue_comment_contents)
return raw_snql_query(request, referrer=self.referrer.value)["data"] | ||
|
||
|
||
def run_pr_comment_workflow(integration_name: str, pr_id: int, project_id: int) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move the run_pr_comment_workflow
function logic into the task itself? i don't think we need it to live as a separate function if it only is run in the task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cathteng did you mean src/sentry/integrations/github/tasks/pr_comment.py
or somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please, since that task is only calling this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cathteng Ah, my plan is to make it generic so that it can be used by other integrations as well (i.e., GitLab, Bitbucket, Azure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be generic because we are using functions from the installation which would be implemented by other providers, right?
f1f4651
to
942dd2f
Compare
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Make the PR comment workflow generic. Migrate the GitHub integration to utilize it.
This PR is built on top of #89683.