This GitHub App is based on the Quarkus GitHub App framework.
It can be run as a native executable.
This action checks that the title of a pull request respects some editorial rules to make Release Notes more consistent.
Based on the .github/quarkus-github-bot.yml file, this rule affects labels to issues and also pings the appropriate people.
Syntax of the .github/quarkus-github-bot.yml file is as follows:
triage:
rules:
- labels: [area/amazon-lambda]
title: "lambda"
notify: [patriot1burke, matejvasek]
directories:
- extensions/amazon-lambda
- integration-tests/amazon-lambda
- labels: [area/persistence]
title: "db2"
notify: [aguibert]
directories:
- extensions/reactive-db2-client/
- extensions/jdbc/jdbc-db2/For issues, each rule can be triggered by:
-
title- if the title matches this regular expression (case insensitively), trigger the rule -
body- if the body (i.e. description) matches this regular expression (case insensitively), trigger the rule -
titleBody- if either the title or the body (i.e. description) match this regular expression (case insensitively), trigger the rule -
expression- allows to write a Jakarta EL expression testingtitle,bodyortitleBody. Be careful when writing expressions, better ping@gsmetin the pull request when creating/updating an expression.
|
Tip
|
When writing expressions, you can use the public static boolean matches(String pattern, String string) {
return Pattern.compile(".*" + pattern + ".*", Pattern.DOTALL | Pattern.CASE_INSENSITIVE).matcher(string)
.matches();
}A rule using an expression based on - labels: [area/hibernate-orm, area/persistence]
expression: |
matches("hibernate", title)
&& !matches("hibernate.validator", title)
&& !matches("hibernate.search", title)
&& !matches("hibernate.reactive", title)
notify: [gsmet, Sanne, yrodiere] |
If the rule is triggered, the following actions will be executed:
-
notify- will create a comment pinging the users listed in the array -
labels- will add the labels to the issue
The pull requests triage action uses the same configuration file as the issues triage action.
There are a few differences though as it doesn’t behave in the exact same way.
For pull requests, each rule can be triggered by:
-
directories- if any file in the commits of the pull requests match, trigger the rule. This is not a regexp (it usesstartsWith) but glob type expression are supported tooextensions/test/**.
If the rule is triggered, the following action will be executed:
-
labels- will add the labels to the issue -
notify- will create a comment pinging the users listed in the array only ifnotifyInPullRequestis true
notifyInPullRequest should be used as follows:
triage:
rules:
- labels: [area/amazon-lambda]
title: "lambda"
notify: [patriot1burke, matejvasek]
notifyInPullRequest: true
directories:
- extensions/amazon-lambda
- integration-tests/amazon-lambdaThe rules applied for issues and pull requests are also applied to discussions, as long as the category is monitored.
Typically, in the case of the Quarkus main repository, we are only monitoring the Q&A category.
Monitoring a category is enabled with:
triage:
discussions:
monitoredCategories: [33575230]The number is the numeric id as present in the JSON event payload.
When the triage/qe? label is added to an issue or a pull request, the QE team is pinged.
The configuration is done in the quarkus-github-bot.yml config file:
triage:
qe:
notify: [rsvoboda, mjurc]When a pull request is merged, if it targets the main branch, it affects the milestone ending with ` - main` to the pull request and the issues resolved by the pull request (e.g. Fixes #1234).
It only affects the milestone is no milestone has been affected prior to the merge. If the milestone cannot be affected, we add a comment to the pull request indicating the items for which we haven’t affected the milestone.
When a workflow run associated to a pull request is completed, a report is generated and added as a comment in the pull request:
If a pull request is closed without being merged, we automatically add the triage/invalid label to the pull request.
The bot will automatically remove these labels when they are outdated:
-
triage/needs-triagefrom closed issues -
waiting-for-cifrom closed pull requests
The bot enforces a specific color for any label created that starts with area/ so that all these labels are consistent.
To participate to the development of this GitHub App, create a playground project in your own org and follow the steps outlined in the Quarkus GitHub App documentation.
GitHub permissions required:
-
Actions -
Read & Write -
Checks -
Read & Write -
Contents -
Read only -
Discussions -
Read & Write -
Issues -
Read & Write -
Pull Requests -
Read & Write
Events to subscribe to:
-
Discussions
-
Issues
-
Label
-
Pull Request
-
Workflow run
-
Workflow dispatch
By default, in dev mode, the Bot runs in dry-run so it’s logging its actions but do not perform them.
You can override this behavior by adding _DEV_QUARKUS_GITHUB_BOT_DRY_RUN=false to your .env file.
Once logged in to the OpenShift cluster (using oc login…), just run:
$ ./deploy-to-openshift.sh