summaryrefslogtreecommitdiff
path: root/scripts/jira
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-06-0818-487/+36
| | | | | | | | | | | Replace the current license header in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: master Task-number: QTBUG-67283 Change-Id: I6ae743e055bbf1cf514abe604157068923fb03c6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Sanitize branch fix version before comparingDaniel Smith2021-03-221-0/+5
| | | | | | | | | | | The closer bot doesn't understand tqtc/lts- prefixed branch names. Sanitize them to remove the prefix for comparison with gerrit branch names, which may include additional text following the version in human-readable format such as "5.15.3 Commercial LTS" Change-Id: I3dfca21047977c352c00b8cd52c8ad9c97854173 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Preserve case in Jira version tags when splittingEdward Welbourne2020-09-184-77/+77
| | | | | | | | | | Implements a suggestion made on (PS7 of) the review for commit 592d7f14e9b8ffa036639485c1c04181bdb3cc4d to avoid the limitations of distutils.version.LooseVersion instead of kludging round them. Type annotations thanks to Daniel Smith. Change-Id: I590b2958a660ef978c692e0d08cbc3b17105c673 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Jira Closer bot: General fixup - Make tests passDaniel Smith2020-09-0911-304/+509
| | | | | | | | | | | This patch includes: - Formatting changes to pass flake8 standards and remove "ignore" typehints. - Add a new test to verify production configuration before startup - Bump hard-coded future version number to non-existent 5.16.0 Change-Id: I0965937fd07847cb41c218dd93a38b8238c0e697 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Jira Closer bot: Update transition logic to be aware of issue typeDaniel Smith2020-09-092-4/+14
| | | | | | | | | | | Not all issues in Jira have the transition "Fixed" while in the in-progress state. Since it isn't always appropriate for some issue types to have a transition called "Fixed", the bot should be aware of the issue type, and use a suitable transition name. Fixes: QTQAINFRA-3842 Change-Id: I3447bb4d5a5a0c2edde76315b4573440f5f5da62 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix closing of issues when jira labels are irregularFrederik Gladhorn2020-09-092-54/+90
| | | | | | | | | | The LooseVersion class would fail to compare versions when they were interpreted as mix of strings and integers (< doesn't work for str and int). This happens in sorting when the versions were for example '5.14.0 Beta 1' and '5.14.0 Beta2'. Change-Id: I0ec626e60e7040944c5c5965a39a1382aa269021 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update ssh config to point to the correct certificate locationDaniel Smith2019-12-032-1/+15
| | | | | | | | Also add a test to verify secrets exist and are not default values to avoid silent authentication failures. Change-Id: I30287bfb683d110efc9dc25087d0acd2324190c3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Ensure git fetch operations report failures to the logDaniel Smith2019-12-021-1/+5
| | | | | | | | | | If git fetch exits with a non-zero exit code, report an error to the log. This is being enabled to assist in diagnosing otherwise silent failures such as ssh authentication issues when updating the repo head refs. Change-Id: Id5fffa9a5a80b460df217298759d97ff854cd8e2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add reviewer-deleted Gerrit stream events in Jira Gerrit botFrederik Gladhorn2019-12-022-1/+12
| | | | | | | | This avoids printing warnings. Otherwise it doesn't change anything. Change-Id: I04ba6eb33ed32527398c284d6eef50f93bdd74b3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* Add install dev dependencies to MakefileFrederik Gladhorn2019-07-261-0/+3
| | | | | Change-Id: Iba8db482d275efc3bcb120391b94abbe4b3db247 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Cleanup jira gerrit botFrederik Gladhorn2019-07-2614-102/+146
| | | | | | | | | Move Version out, rename Change to ChangeRange which makes it a bit clearer. Rename the function to get a logger to get_logger so that it doesn't have the same name as the module itself. Change-Id: I0f9f9b07a64b2f76cedc369525de5f1ec9941a1e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add type ignore hints for newer mypyFrederik Gladhorn2019-07-264-6/+6
| | | | | | | 3rd party packages often lack type information. Change-Id: Iac427eada2354537124767c48d720fa5776da8e9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make flake8 happyFrederik Gladhorn2019-07-261-2/+2
| | | | | Change-Id: Ie06f79b842254e8bf39cebd4f6da33dfd5c06909 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Do not hard-code python 3.6Frederik Gladhorn2019-07-262-289/+303
| | | | | | | Also update the dependencies. Change-Id: Ibfb1f7e4bf867dc8d29567677ce02f077957d6c6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Teach jira-gerrit-bot about replication eventsFrederik Gladhorn2019-06-271-0/+2
| | | | | | | | | | | | We can safely ignore these, but it's nice to explicitly handle all types of events, especially if someone wants to later use this code for other purposes. These events are new since the Gerrit upgrade. Change-Id: I8b411a4cf55fb0775eba917bff4fdd4458162fb7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Simplify jira bot: we now always get an event instanceFrederik Gladhorn2019-06-272-5/+3
| | | | | | | Change-Id: Ifbbad62d0068e6955fe547c1bbf8a1e895a0b140 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Stop running the bot on random eventsFrederik Gladhorn2019-06-273-20/+44
| | | | | | | | | | | | We upgraded gerrit, the new gerrit version sends more ref-updated events. Filter those out. We eventually ran out of file descriptors, because each comment added on Gerrit would lead to fetching the corresponding repo around eight times, which is completely unneeded. Change-Id: I195a3c16f838ba5fb872e6bfb79640a99628315d Fixes: QTQAINFRA-2884 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Use full path to pipenv in MakefileFrederik Gladhorn2019-04-081-1/+1
| | | | | | | | When deploying automatically and using systemd to run, we have a clean environment, which means pipenv cannot be found. Change-Id: Iff44fe50fe8f55255736586bc5fe5a827fac1036 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Do not add comment about not closing issue when the issue is closedFrederik Gladhorn2019-04-081-5/+6
| | | | | | | | | | Simplify the code that closes issues and make sure it updates the fields. Before the bot would unconditionally add "A change related to this issue was integrated. This issue was re-opened before, the bot will not close this issue, please close it manually when applicable." Change-Id: Ic8e3840a6341cccb0bef0136c6e03a01ce9e5ece Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add missing return type annotationFrederik Gladhorn2019-04-081-1/+1
| | | | | Change-Id: I6bd9add27907955f6033e1202a495526f203d38c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Use a clone of the full repo to run on productionFrederik Gladhorn2019-04-051-1/+1
| | | | | | | | | Originally the bot lived in a repo of its own. Now it's in qtqa and to make automatic deployment and updating easy, use the full path in systemd. Change-Id: I8ef7cc8b82f63d19ac39fc3a156ce97a4d0c0c0a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Add Makefile for the JIRA-Gerrit botFrederik Gladhorn2019-04-051-0/+28
| | | | | | | | The top-level .gitignore ignores makefiles, therefore this was not included in the first commit. Change-Id: I41bd3a899bf1754d3003dcaebbb78334799e530f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix gerrit bot closing issues that were manually re-openedFrederik Gladhorn2019-04-032-9/+26
| | | | | | | | | Instead of closing the issue again, post a comment. Change-Id: I76d3c531abbad2fa97912925af3630cf866bcf8c Fixes: QTQAINFRA-2847 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Simplify test setupFrederik Gladhorn2019-04-031-10/+2
| | | | | | Change-Id: Ie7d2bf38f2cb077c5cff183b341c059b067cee46 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Improve branch handling in testFrederik Gladhorn2019-04-031-33/+36
| | | | | | | | | The tests need to resolve dev to a version number. This still needs to dynamically figure out the next major version... But at least it's a baby step forward. Change-Id: I8ac433e57ba4a77315d316891a68dd260514b746 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make sure to have a copy of tqtc-qt5 to be able to pass all testsFrederik Gladhorn2019-04-031-0/+2
| | | | | | Change-Id: If1cc0a91101f65c881eb9a785440c2e949883142 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Use f-strings to improve readabilityFrederik Gladhorn2019-04-011-2/+2
| | | | | | Change-Id: Ia826a6b7eb54b8f84ba3a3071c27fcb4afe2d9d9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Clean up directory operations to be more cross-platformFrederik Gladhorn2019-04-012-2/+2
| | | | | Change-Id: I5e0e59629299225fb769bd213f74565d874db107 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Improve readmeFrederik Gladhorn2019-04-011-3/+3
| | | | | Change-Id: I74370b90cf13cee12bf5581472a69151b1b21966 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Make __init__.py files more consistentFrederik Gladhorn2019-04-011-1/+5
| | | | | | | Other files are split into several lines, follow in this one. Change-Id: I97efda35a0296d8b47b36e590b7a053467865264 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Add comment and __main__ check to helper scriptFrederik Gladhorn2019-04-011-8/+12
| | | | | Change-Id: I8d0b6a3bf166c20201128f8f7acfc11ac3be8e74 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* JIRA-Gerrit-Bot: ignore E266Frederik Gladhorn2019-04-011-2/+2
| | | | | | | The check otherwise complains about all of our copyright lines. Change-Id: I2d924a8e9c73a0be7da1ffe3d595ff3c04d70e33 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Initial version of the JIRA-Gerrit botFrederik Gladhorn2019-03-2931-0/+2826
This bot listens to Gerrit ssh events and closes JIRA issues when the commit message contains a Fixes: QTBUG-### line. Change-Id: I6d68b69e624143e2aae84ad0b172583d3855703d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>