summaryrefslogtreecommitdiffstats
path: root/git-hooks
Commit message (Collapse)AuthorAgeFilesLines
...
* Sanity-bot: Make sure Pick-to footer doesn't contain source branchDaniel Smith2020-09-081-0/+3
| | | | | | | | | | | | The sanity bot should warn if the source branch is in the Pick-to footer since this would be redundant and cause a failed pick attempt by the cherry-pick bot. Only exact branches are matched, since it is possible to submit a change to a minor branch with a Pick-to footer that targets a bugfix branch. Fixes: QTQAINFRA-3886 Change-Id: I234d20205bd3896b7be631ba29db2efe895b9bd3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Sanity: Exclude also testdata-* from copyright checkOrgad Shaneh2020-08-231-1/+1
| | | | | | | For example, testdata-qt in qbs/527d5a8ec54e44291d4968754bdf574ebe57822b Change-Id: I072327c111bb0ba010bc606fabf56a9ebc6c0d95 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Sanity: Exclude also testdata_ from copyright checkOrgad Shaneh2020-08-221-1/+1
| | | | | | | | | | | | https://codereview.qt-project.org/c/qt-creator/qt-creator/+/299771 added tests with directories named tests/cppmodelmanager/testdata_project1 and testdata_project2. As these directories contain test-related header files, they should not require copyright headers. Change-Id: I24ba03fbbf47dddd18d8d8d1a96498ad1301ea3a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Allow periods in summary when 'etc' is the last wordDaniel Smith2020-08-141-1/+1
| | | | | | | | Fixes: QTQAINFRA-3866 Change-Id: I0872dc2880f3ceb60c6efeb15d72b6bf627c4051 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Sanity-bot: Add /perfdata/ to the whitelist of test data directoriesDaniel Smith2020-07-101-1/+1
| | | | | | | | | | | "perfdata" should be an accepted testdata directory name, since it's logical to separate correctness data from performance data in test directories. Fixes: QTQAINFRA-3841 Change-Id: I3b1522a58c94e5b42774ecd8b0a658c2f8936ef4 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Sanity-bot: Fix typo in commit message parserDaniel Smith2020-07-101-1/+1
| | | | | | | | | Committer name/email have never been checked for validity due to a typo. Change-Id: Ida571959bbe56d7c4ca2c0e20f50ad13dc81ce71 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Gerrit-bot: Fix use of uninitialized variable when no sanity-reviewDaniel Smith2020-07-101-1/+2
| | | | | | | | | | | | If the Sanity-bot subprocess fails to generate a suitable output with the 'Sanity-Review' label, gerrit-bot restarts the process repeatedly, spamming the change in gerrit. Check for the uninitialized variable so the warning isn't thrown. Task-number: QTQAINFRA-3841 Change-Id: I9950e3242bc043d9d986f9e046d53a6ba1fecf17 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Treat wip branches like dev to suppress cherry-pick messagesDaniel Smith2020-05-261-1/+1
| | | | | | | | | | | | | wip/* branches don't need to be notified of missing pick-to footers since users working on wip branches should know what they're doing. Even though cherry-pick bot is enabled in an entire repo, the usefulness of sanity-checking for pick-to footers is very limited in wip branches. The easiest way around this is to treat wip branches like dev when running in gerrit. Task-number: QTQAINFRA-3751 Change-Id: I81fd427e83ebcd703f9b1700bf00367544c98a0e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* take advantage of now having a proper ref->sha1 mappingOswald Buddenhagen2020-05-151-3/+2
| | | | | | | this makes things marginally faster, but mostly just more consistent. Change-Id: Ifdd84b54bb541ba13c9ff1fa349e0a2479f6060f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* add validation according to the new cherry-picking policyOswald Buddenhagen2020-05-151-11/+61
| | | | | | | | Task-number: QTQAINFRA-3663 Started-by: Daniel Smith <daniel.smith@qt.io> Change-Id: Iafa560d52cbca4bbf490694982bc3cddaea08b20 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* make gerrit-bot pass the branch name to sanitize-commitOswald Buddenhagen2020-05-152-18/+25
| | | | | | | | | | | | | guessing the target branch with the help of git-merge-base is unreliable when the user does a cross-branch push or the commit has simply an old base. therefore, explicitly pass in the branch if we already know it, which is the case on the server. Fixes: QTQAINFRA-3322 Started-by: Daniel Smith <daniel.smith@qt.io> Change-Id: I5fd1e827b9e169f4aa2eb3590bc4f252037d6ba0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* recognize space-separated tasks as well when complaining about themOswald Buddenhagen2020-05-151-2/+2
| | | | | Change-Id: I36eb87b815902b153134b1772f2a0707d4621d20 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* re-nest conditionsOswald Buddenhagen2020-05-121-11/+10
| | | | | | | this is clearer, and a tiny bit faster. Change-Id: I2bb0608876d18fa1241091abfbf940732c39d953 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* straighten out ChangeLog section state trackingOswald Buddenhagen2020-05-121-1/+5
| | | | | | | | | so far, footers in the middle of the changelog would suspend it, but not terminate it, which made no sense at all, given that the changelog is just a text section and footers separate text sections. Change-Id: I650c430700c8edc0c359ecc9c6b8b57f9632b5ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* fix handling of bogus change-log footersOswald Buddenhagen2020-05-081-3/+8
| | | | | | | | | | we cannot just pretend that a footer is a tag, as the semantics are entirely different, so there would be "interesting" follow-up effects. also, due to the cascading of the conditions, we'd never actually catch "Change-Log" footers. Change-Id: Ia4754316693e0afdac4d24d994b4d6c136977745 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* make the footer identification regex stricter againOswald Buddenhagen2020-05-081-1/+1
| | | | | | | | | | | | don't accept single words, as this leads to way too many false positives, as originally anticipated. instead, whitelist "Fixes" explicitly. amends ddd8ad86. Fixes: QTQAINFRA-2789 Change-Id: Iec23c24e942e0947b53162ab066f53394cabb851 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* suppress stderr output of git-merge-baseOswald Buddenhagen2020-05-081-2/+2
| | | | | | | | | | | when validating cherry-pick sources, we might be presented entirely unknown sha1s. don't spam stderr with the resulting error messages from git, as they are entirely expected. amends 51744f4f0. Change-Id: I9a5203ee1810ba6903eab9ad8bfb8f695e196ba5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rework creation of stable output for the autotestOswald Buddenhagen2020-05-081-9/+1
| | | | | | | | | | | instead of using tied hashes, just sort by line number. that's more thorough, cheaper, and less convoluted - so much that we can do it unconditionally. amends 1ae5efe70. Change-Id: Ieb5a6fc26379597cd30475b5725bed06205cb9c6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add Pick-to in the commit-msg hookOrgad Shaneh2020-04-211-1/+1
| | | | | | | This is needed for placing it before Change-Id. Change-Id: I9d1f0b220872941a7cb23f9c2aea5c990409ada3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Expand the exemptions for test data filesEdward Welbourne2019-10-301-1/+1
| | | | | | | | | | | Along with not caring how messily they use space, we don't care if they end in a newline, lack a copyright notice or use terminology that might be mistaken for someone's trade-mark. Fixes: QTQAINFRA-2832 Change-Id: I08b919bf3f9c97e2d47598b69430d6fbf909f847 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Exempt tests/*/data/ as well as tests/*/testdata/ from the spacing testsEdward Welbourne2019-10-301-1/+1
| | | | | | | | | Plenty of existing tests use data/ rather than testdata/ as their data directories. Change-Id: I8398c35618313ec9571dd197da040b3f9671e42c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* clang-format-pre-commit: Silence the noisy 'which' on WindowsFriedemann Kleint2019-10-141-2/+2
| | | | | Change-Id: I0fa8750ccff953dc690aee131f8b934704ad743d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* clang-format-pre-commit: Find git-clang-format pointed to by LLVM_INSTALL_DIRFriedemann Kleint2019-10-141-1/+6
| | | | | | | | In a Qt setup, LLVM is pointed to by the variable but not in the path as not to auto-detect the Clang mkspec. Change-Id: If3dbaa158b7e9eb7e84745cf51afe0ea6e51aa1c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* clang-format-pre-commit: Fix help text to list the likely correct commandFriedemann Kleint2019-10-141-1/+2
| | | | | Change-Id: Ie78af25b3ef855e3f88d9f075654649abe41fc4c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix inverted logic in clang-format-pre-commitFrederik Gladhorn2019-10-111-1/+4
| | | | | | | And ignore when there are no relevant files, such as this commit. Change-Id: Ic8b747061822ad02538eacbcaa10f98332b6d9e7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prospective shell syntax fix for clang-pre-commit hookSimon Hausmann2019-10-101-1/+1
| | | | | | Change-Id: I231d81b599b2e8b0da135a53061ddb8173236c4b Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Switch from patience diff to minimal diffEdward Welbourne2019-09-231-1/+3
| | | | | | | | | | | | | | | | | I find that a pure indentation change (making all the doc comments in qcalendar.cpp use the same indent, without reflowing after) gets complained at for mixing space-changes with non-space-changes. This arises because the "patience diff" algorithm we've been using makes some less than ideal choices. The minimal diff algorithm fares better on such a change - and sounds like it has a decent chance of being good on whatever cases prompted (the bogus and unnatural diffs that lead to) commit 6dac9c54dc0b72643629da2442bbe7c4526d7ae4, which this amends. Change-Id: I3b7efc03dbd8ec388ebc38458b25552f4ec426d6 Reviewed-by: Sergio Ahumada <sahumada@texla.cl> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add clang-format-pre-commit hookFrederik Gladhorn2019-09-191-0/+29
| | | | | Change-Id: Iafa2ce4ca485122e44e5b143af68823793dd4b85 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Mark 5.12 as an LTS branchKari Oikarinen2019-09-021-1/+1
| | | | | | Change-Id: Ic784af0bc3b01d66116e5aa42af0772bbe51fb62 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* gerrit-bot: Fix syntax problem due to too much arcane punctuationEdward Welbourne2019-08-071-1/+2
| | | | | | | | | | | | We now check for the existence of the comment section in a slightly more readable way and then proceed based on that. Done-with: Orgad Shaneh <orgad.shaneh@audiocodes.com> Fixes: QTQAINFRA-2988 Change-Id: I90ddef66b97fea42bd9723a234235820bb21875a Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid warning on taking length of undefined listEdward Welbourne2019-07-311-1/+1
| | | | | | | | Add missing dereference. Fixes: QTQAINFRA-2988 Change-Id: Ic20cb633cef19a40820d9f3585ffa3886416442f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QDoc bot: Add "autogenerated" tagOrgad Shaneh2019-07-191-1/+2
| | | | | | | | Useful for filtering out bot messages. Change-Id: I26d23b159ec006185c9fb817155742722f4095fa Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SanityBot: Add "autogenerated" tagOrgad Shaneh2019-07-161-0/+1
| | | | | | | Enables filtering of bot messages Change-Id: I2060a6868fa703e009277a19d91c65de14d5ce11 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* gerrit-bot: Give the project when adding reviewers to a changeKari Oikarinen2019-06-111-1/+1
| | | | | | | | | | | Work around an issue where set-reviewers call causes an internal server error due to a NullPointerException. Giving the project explicitly avoids that error. Task-number: QTQAINFRA-3035 Change-Id: I466a85eb4bf7a7a14a5054e3436b16159e75f4c1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Gerrit Bot: Message that moving changes is done using the UIFrederik Gladhorn2019-05-271-32/+1
| | | | | | | | After the Gerrit upgrade, the bot doesn't work any more (we use NoteDB now) and the functionality is in the regular UI. Change-Id: I005b2501d63d6a99c9f643fd77a6451e5c6cfb06 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Avoid warning on taking length of undefined listEdward Welbourne2019-05-071-1/+1
| | | | | | | | | | | | | | | Recently added check for fatuous sanity review tested for empty comments with int($$verdict{comments}) == 0 but it's possible that $$verdict{comments} is undefined; when it is, we get a warning here: Use of uninitialized value in int at /srv/gerrit/sanitybot/gerrit-bot.pl line 224. So add and tweak some punctuation to make perl happy again. Thanks to Ossi for the appropriate runes. Change-Id: I211baa2e61cda98fc61ec97775f5a247da00c1f4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Fix sanity bot startup - Bare NONE is not allowedFrederik Gladhorn2019-05-031-1/+1
| | | | | | | | | After the last change, the bot refuses to start: Execution of /srv/gerrit/sanitybot/gerrit-bot.pl aborted due to compilation errors. Bareword "NONE" not allowed while "strict subs" in use at /srv/gerrit/sanitybot/gerrit-bot.pl line 224. Change-Id: I62958d97ba0311986549c7cc6e78a4e381cbd28a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Suppress notification when there's nothing but a +1 from the sanity botEdward Welbourne2019-05-021-0/+4
| | | | | | | Fixes: QTBI-1549 Change-Id: I061eafd8ab5b27d07dd9165e82688fd8cbcbe78d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Permit the use of MAC/mac again in commit messages/contentSimon Hausmann2019-03-151-1/+1
| | | | | | | | | | | | | Once in a while somebody runs into the bot complaining about the use of "MAC" when it's perfectly fine. For example in the context of "MAC address". This is quite annoying and less helpful than perhaps intended. So this change removes the trigger-happy part of the check but keeps the more clearly defined potential uses of old terminology from Apple. Fixes: QTQAINFRA-2800 Change-Id: If6b9cfbd0a808b424ffc93728fcc66939f5ad6ee Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't check spacing in test-dataEdward Welbourne2018-10-311-0/+2
| | | | | | | | | | | | | | | We have a general convention of storing test data in testdata/ sub-directories alongside their tests. This data is whatever it needs to be, for whatever the test may be doing, so we don't want to waste cycles commenting on its spacing, or spam reviewers with the results. Adding this exception might even encourage those maintaining tests with such data to adopt this (already common) convention and make it easier for others who encounter tests to know where to find their data. (I'll start with testlib's selftest's expected_* data when I can find the time.) Change-Id: Ib27b75e858e0573a65540787f4ccae6b2383bc3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Add Fixes: tag to sanity botFrederik Gladhorn2018-09-041-1/+4
| | | | | | | Change-Id: I80b9e149675a13810cfa1164d97b1902d1ceb792 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add Fixes in gerrit_commit_msg_hookFrederik Gladhorn2018-08-311-1/+1
| | | | | | | This ensures the footers look nice. Change-Id: Ie8c61dbf39ceaccdc47e69764385ea252ab961af Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* sanitizer: slightly refactor initialization of $eof_checkOswald Buddenhagen2018-08-211-5/+4
| | | | | | | ... so it's more consistent with the other flags. Change-Id: Ic2eae23ed10594f7adab7f5980852294252923d9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* sanitizer: exclude 3rdparty from eol-at-eof checkOswald Buddenhagen2018-08-211-1/+1
| | | | | | | | the eof is part of the content (and not just a git attribute, like the eol style), so it makes no sense to enforce our style for 3rdparty. Change-Id: I6cdfd4f3bf14ddab9e6cb2531547b97f5b96cbc8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* accept dashes in branch names in move requestsOswald Buddenhagen2018-03-191-1/+1
| | | | | | Change-Id: If351a93f6959406e032e85c8e0238af87333a727 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* sanitize-commit: recognize cross-repo cherry-picksOswald Buddenhagen2018-03-191-3/+5
| | | | | | | | we don't validate them, though, as we have no access to the source repository. Change-Id: I8eea89506aca007cb2413d24632904ab81119cae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Include the prior branch in gerrit-bot's "Moved" messageEdward Welbourne2018-02-271-1/+1
| | | | | | | | | | | Having now seen moves using the bot in practice, I find that reviews after a move typically give no hint to which branch they were on *before* the move. Though usually unimportant, it's sometimes of interest to a reviewer. Change-Id: I2462ca2033a7f9007ff5dc226dc6674b04b4e4fb Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* declare 5.9 a cherry-pick branchOswald Buddenhagen2018-02-121-1/+1
| | | | | Change-Id: Ibd1c42ab4bbe2592b3f9116546f0e5342180d139 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* gerrit-bot: comment out status check in move command processingOswald Buddenhagen2018-01-121-3/+4
| | | | | | | | | | contrary to expectations, the 'status' field is simply missing from the event streams change object. we'll let the worker script complain about the problem instead. Change-Id: Ie7cc6af462372f52a1e942fec836c680f0f51dd2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* gerrit-bot: support slashes in branch names in move requestsOswald Buddenhagen2018-01-121-1/+1
| | | | | Change-Id: Ifcace60957cf2383effaaa23adcd7e1509d04066 Reviewed-by: Orgad Shaneh <orgads@gmail.com>