|
1 | | -# dlang-bot |
2 | | -Dlang-bot for automated bugzilla, github, and trello references. |
3 | | -Also cancels stale Travis-CI builds |
| 1 | +# Dlang-Bot |
4 | 2 |
|
5 | | - |
| 3 | +[](https://travis-ci.org/dlang-bots/dlang-bot) |
| 4 | +[](https://codecov.io/gh/dlang-bots/dlang-bot) |
| 5 | + |
| 6 | +<img alt="dlang-bot" height="200px" src="public/img/dlang_bot.png" /> |
| 7 | + |
| 8 | +Features |
| 9 | +-------- |
| 10 | + |
| 11 | +- [Automated bugzilla, github, and trello references](#automated-references) |
| 12 | +- [Auto-merging approved & passing PRs](#auto-merge) |
| 13 | +- [Canceling stale Travis-CI builds](#canceling-stale) |
| 14 | + |
| 15 | + |
| 16 | +<a name="automated-references" /> |
| 17 | + |
| 18 | +Automated references |
| 19 | +-------------------- |
| 20 | + |
| 21 | +For example let's say you fixed [Issue 16582](https://issues.dlang.org/show_bug.cgi?id=16582) |
| 22 | +and make a PR for on GitHub. |
| 23 | +If one of your commits mentions the issue, e.g. like this Git commit message: |
| 24 | + |
| 25 | +``` |
| 26 | +fix Issue 16582 - ParameterDefaults fails w/ scope parameter |
| 27 | +``` |
| 28 | + |
| 29 | +The Dlang-Bot will do all the hard work of linking and referencing |
| 30 | +between Bugzilla, GitHub and Trello do for you. |
| 31 | + |
| 32 | +### GitHub |
| 33 | + |
| 34 | +It would comment on GitHub with list of all mentioned issues and link them to Bugzilla: |
| 35 | + |
| 36 | +<img alt="dlang-bot-github" height="120px" src="public/img/dlang_bot_github_comment.png" /> |
| 37 | + |
| 38 | +The first column of the table is the current status of the referenced issue. |
| 39 | + |
| 40 | +### Trello |
| 41 | + |
| 42 | +For the [Trello board](https://trello.com/b/XoFjxiqG/active) it will also provide a |
| 43 | +reference: |
| 44 | + |
| 45 | +<img alt="dlang-bot-trello" height="120px" src="public/img/dlang_bot_trello_comment.png" /> |
| 46 | + |
| 47 | +And once a PR gets merged, the bot moves the linked Trello card to "Testing / Review". |
| 48 | + |
| 49 | +### Bugzilla |
| 50 | + |
| 51 | +Once a PR has been merged (i.e. the commits got pushed to master or stable), |
| 52 | +GitHub's Bugzilla integration will automatically comment to Bugzilla with a regarding commit: |
| 53 | + |
| 54 | +<img alt="dlang-bot-bugzilla" height="120px" src="public/img/dlang_bot_bugzilla_comment.png" /> |
| 55 | + |
| 56 | +Of course it will also automatically close the references issues (at least if either |
| 57 | +"fix", "close" or "address" occurs before the issue id). |
| 58 | + |
| 59 | +Using this syntax is also very important because for the changelog generation, the |
| 60 | +git history will be used. Thus _only_ if the Dlang-Bot has detected an issue |
| 61 | +and commented on your PR it can become part of the changelog. |
| 62 | + |
| 63 | +### Nerdy details |
| 64 | + |
| 65 | +- one can mention multiple issues in one commit and/or multiple commits |
| 66 | +- the exact RegEx is: |
| 67 | + |
| 68 | +``` |
| 69 | +((close|fix|address)e?(s|d)? )?(ticket|bug|tracker item|issue)s?:? *([\d ,\+&#and]+) |
| 70 | +``` |
| 71 | + |
| 72 | +(the GitHub Bugzilla integration and the Dlang-Bot use the same RegEx to parse |
| 73 | +git commit messages) |
| 74 | + |
| 75 | +<a name="auto-merge" /> |
| 76 | + |
| 77 | +Auto-merge (WIP) |
| 78 | +--------------- |
| 79 | + |
| 80 | +At the moment the Dlang-Bot supports merging via special `auto-merge` and |
| 81 | +`auto-merge-squash` labels. The later will perform a squashed merge of all commits |
| 82 | +in the PR into a single one. |
| 83 | + |
| 84 | +A reviewer can toggle a PR for "auto-merge" by simply adding the `auto-merge` label |
| 85 | +(`auto-merge-squash` respectively). |
| 86 | + |
| 87 | + |
| 88 | +### Nerdy details |
| 89 | + |
| 90 | +- this relies on the "restricted branches" feature of GitHub (the Dlang-Bot will |
| 91 | +send the attempt to merge to the GitHub API) |
| 92 | +- once a new commit event occurs (push, synchronization) the Dlang-Bot will |
| 93 | +automatically remove set all auto-merge labels from the PR |
| 94 | +- for status events the GitHub API doesn't allow to get an information about the |
| 95 | +- the Dlang-Bot will then try to restart the PR on every new event. |
| 96 | +- concerning PR of the commit (thus all potential auto-merge PRs are checked) |
| 97 | + |
| 98 | +_Note_: at the moment the Dlang-Bot doesn't store _any_ authentication token, so |
| 99 | +it can't perform actions on behalf of others. |
| 100 | + |
| 101 | +<a name="canceling-state" /> |
| 102 | + |
| 103 | +Canceling stale Travis-CI builds |
| 104 | +-------------------------------- |
| 105 | + |
| 106 | +To avoid wasteful resource consumption with Travis CI, |
| 107 | +the Dlang-Bot will automatically cancel the previous, possibly running build of |
| 108 | +a PR on a new commit event (push or synchronization by a user). |
0 commit comments