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

Add webhook support for automatic MR review in the right channel #68

Open
M0nkeySan opened this issue Nov 6, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@M0nkeySan
Copy link
Collaborator

Current Behavior

Currently, merge requests can only be added to Slack channels manually using the review command. This requires manual intervention for each MR that needs to be tracked in Slack.

When a MR is opened by an automation, like renovate-bot, the MR is not added in the slack channel.

Proposed Enhancement

Add support for GitLab webhooks to automatically assign merge requests to configured Slack channels based on MR labels. This would enable automatic tracking of MRs in relevant channels as soon as they are created.

The idea would be to create a dedicated label homer-review which trigger the automation on homer side or not.

How

The code which handle the webhook from the MR is located in mergeRequestHookHandler.ts.

The needed changes are :

  1. Add a handler for the open action, check if the labels array contains homer-review
  2. Search if the project_id field is linked to 1 or more channels in the database.
  3. Build the review message with buildReviewMessage
  4. Add the review to the channels addReviewToChannel
@M0nkeySan M0nkeySan added the enhancement New feature or request label Nov 6, 2024
@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2024

This would enable automatic tracking of MRs in relevant channels as soon as they are created.

I think maybe this should be avoided. I like to avoid notifying my colleagues until I've reviewed the MR myself, have a green pipeline, sometimes I even run tests on integration before that. I would be favorable to something that triggers auto-tracking when the PR is marked as "ready for review" and has at least one reviewer assigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants