-
Notifications
You must be signed in to change notification settings - Fork 12
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
Github app to provide blast radius or test plan #28
Comments
Thanks @dhirenmathur for a detailed description! I'd like to work on this! |
@parthfloyd awesome, I've assigned you the issue, let me know if you need any more context! |
@dhirenmathur I'm looking forward to incorporate the following changes:
Please feel free to add any feedback on this. |
Sounds good overall, can you provide more detail around the flow of the request handler. @parthfloyd |
Yes @dhirenmathur For example: for a new PR, |
-supports PR create, PR update & comment with bot mention on github
* Added 2 query for fetching project & user_id: - Get First project from database by repository name & branch name - Get first user id from project repository name * (fix) minor import error in flow.py * integrated comment on pr method * #28 (feat) init request handler for webhook -supports PR create, PR update & comment with bot mention on github * removed unused parameter from fetch_pr * integrated fix for user_id * fix momentum interaction with bot * sonar-lint refactoring * (refactor) added case to handle new pr on existing branch * (fix) handled windows file path for extracting file name. * (fix) refactored handle_open_pr * refactored generate testplan for webhook * minor update to bot comments for blast radius & test plan. * minor fix to filename in blast radius comment. * minor update to blast radius comment. --------- Co-authored-by: Dhiren Mathur <[email protected]>
Description
Develop a new GitHub app that listens to webhooks on PR creation, PR updates, and PR comments that mention the bot with a command. The bot should integrate with the Momentum app, and users who install the bot need to be signed up for the Momentum app.
Workflow
User signs up to momentum and installs app on their repo.
There should be a user preference page on UI that has a toggle to turn on or turn off PR integration on Github. (not part of this task)
Receive webhook: Handle webhooks differently for PR update, PR create, comment with mention, and comment without mention.
PR update:
Parse the webhook body for the branch name, repo name, and base branch name.
Retrieve the project ID using the repo name, branch name, ( in case of multiple, choose the oldest one)
Fetch the blast radius for the project using project id and base branch name.
Comment on the PR with the blast radius information in a table format.
PR create:
Parse the webhook body for the branch name, repo name, and base branch name.
Since we need the user id against which we need to create the project, retrieve the user id from project table by querying using repo name, in the case that multiple users have linked the same repo on momentum, choose the oldest user
Create a project for the branch and repo
Fetch the blast radius for the project and base branch name.
Comment on the PR with the blast radius information in a table format.
Comment with mention:
Listen for a /plan {identifier} command in the comment that mentions the bot.
Parse the webhook body for the repo name and branch name.
Retrieve the project ID using the repo name and branch name.
Fetch the test plan for the specified identifier.
Comment on the PR with the test plan information and the project ID.
Comment without mention:
Ignore the comment.
Relevant documentation:
The text was updated successfully, but these errors were encountered: