-
Notifications
You must be signed in to change notification settings - Fork 167
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
PROD-29281: Replace Mergeable with a custom tool for label and title enforcement #3862
Conversation
Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊 |
cfcea92
to
6746c28
Compare
6746c28
to
2b707f9
Compare
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.
Nice one!
The initial version of the PR Manager will provide feedback on incorrectly labeled pull requests. We've created a GitHub application that will receive an authenticated `octokit` instance (named `github` in our script) when it's executed by GitHub script actions. We've added a simple markdown parser which can help us find links and other required items in the pull request body. The script will provide feedback based on the errors it finds, creating a new comment if one doesn't exist, updating an existing one if there is one and removing a created comment once all issues are fixed.
We currently ignore dependabot in Mergeable and we port that behaviour to the PR manager until we decide differently.
This was the only validation that Mergeable still had that the PR manager was missing. We've also changed it slightly so that we get rid of `Issue #PROD` which is now very prolific but which is pushing Drupal standards onto our Jira issues. We provide a specific message for that case to guide people to the new format. The benefit of making sure we properly distinguish is that other tools looking at titles know whether to check Jira or Drupal.org for the source of truth.
The final step is to uninstall the app but this completes the replacement of mergeable by our own JavaScript based tool for which we can provide more friendly messaging.
We were using "Duplicate" in one and "Multiple X" in the other. We now have them all consistently showing "multiple x" to aid recognizability for the users.
c0428e7
to
5c2bd54
Compare
Problem
The message that Mergeable adds is usually not very helpful and it can be difficult to figure out without opening the workflows what needs to be changed. Additionally Mergeable doesn’t really provide us with many ways to extend its capabilities and build on top of it.
Solution
In we’ve found that we can use GitHub Scripts to create a tool that can post and update comments on a PR to provide more targetted and helpful feedback.
Issue tracker
https://getopensocial.atlassian.net/browse/PROD-29281
Theme issue tracker
How to test
The business logic of the PR manager is tested using Jest, (see
*.test.js
) we assume that GitHub's API works as described and don't have tests that talk to the REST API directly.Definition of done
Before merge
After merge
Screenshots
When nothing is provided.
Duplicate labels or a title mixing the Drupal and Jira format
Release notes
Pull Requests will no longer be validated by Mergeable and instead use a newly introduced custom built JavaScript solution under the name "PR Manager". It aims to provide more helpful messages in case PRs violate the requirements we set.
One additional change is that PRs for Jira tickets should no longer start with
Issue #
but should start with the Jira ticket directly.Change Record
Translations