diff options
Diffstat (limited to 'scripts/jira/jira-bug-closer/README.md')
-rw-r--r-- | scripts/jira/jira-bug-closer/README.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/jira/jira-bug-closer/README.md b/scripts/jira/jira-bug-closer/README.md new file mode 100644 index 00000000..0b261a3c --- /dev/null +++ b/scripts/jira/jira-bug-closer/README.md @@ -0,0 +1,50 @@ +# JIRA bot to close issues + +Listen to gerrit events and close corresponding JIRA tasks when there is a fixes tag in the commit message. + +## Prerequisites and building + +You need to have [pipenv](https://pipenv.readthedocs.io/en/latest/) installed. +Run `make` to install dependencies. + +## Connecting to a JIRA account using OAuth + +* Generate a private/public rsa certificate pair (`jiracloser.pem`, `jiracloser.pub`) + * See for example https://www.madboa.com/geek/openssl/#key-rsa + +* Log in to JIRA as admin. +* Find "Integrations" -> "Application Links" + * Enter a random URL (e.g. https://www.qt.io) and click "Create new link" + * Fill out the fields, it does not really matter: + * Name: Gerrit Issue Bot + * Type: Generic + * Service Provider Name: Qt JIRA bot (anything goes) + * Consumer key: jira-gerrit-bot-oauth-consumer + * Shared Secret: 8aG2#dwV24$e9J43@s8b + * Request Token URL: https://www.qt.io + * Access token URL: https://www.qt.io + * Authorize URL: https://www.qt.io + * Create incoming link: yes + * Next page (this is important, can be edited later under incoming authentication) + * Consumer key: jira-gerrit-oauth + * Consumer Name: Gerrit Issue Closer + * Public Key: content of `jiracloser.pub` + * You can delete the outgoing auth after this excercise + +* Log in to JIRA with the bot user. +* In a terminal run: `make oauth` +* The script puts out a URL, which must be *opened as the bot user* +* Click Allow +* Press enter in the terminal +* Copy the `oauth_token` and `oauth_token_secret` into config.ini. + +## Running the bot + +`make run` + +## Running tests + +Run `make test` which runs a style check, type checking and the automated tests. +Please make sure that all of them pass before contributing. + +It's also possible to generate coverage information (`make coverage` will open a a browser). |