15 Commits

Author SHA1 Message Date
Clark Boylan
180cc6aeda Be more explicit about using python3 to run tools/
We have python scripts in the tools/ dir the vast majority of which we
run regularly with python3 via our python3 default basepython in tox.
However, most of these use a `python` shebang line which can be
confusing as to whether or not these scripts run under python3 or not.

To make this more clear set them to python3. I've confirmed the scripts
running under tox are happy with these changes. For the ones that don't
run under tox I've done a quick review and they look happy too.

Change-Id: I983d23c33f7780e5708aa728c829c3262fc99ea0
2020-06-08 16:40:44 -07:00
Dr. Jens Harbott
703f107788 Fix use of 'comment-added' event type
In [0] an event type of 'comments-added' was used for the ironic
channel, but the correct event type is 'comment-added'.

[0] https://review.opendev.org/698091

Change-Id: Idd0638357aa4ed751a7e862c0e514e10b468ee9a
2020-01-21 13:33:02 +00:00
Zuul
98402d34e3 Merge "IRC #openstack-ironic gerritbot CI failed messages" 2020-01-21 08:43:20 +00:00
Steve Baker
abefaaea44 IRC #openstack-ironic gerritbot CI failed messages
When a gerrit comment of type Verified with value -2 is posted, send a
message to the #openstack-ironic channel.

This will raise awareness of CI job failures preventing changes from
landing, and is proposed as a trial for later refinement.

Update irc_tests.py for the dependend change to pass tests.

Change-Id: I251e9e5ea760fe5da1a8fbca7cee365dd3ae563b
Depends-On: https://review.opendev.org/#/c/698089/
2020-01-17 20:53:20 +01:00
Ian Wienand
4f6629021e Update hacking, fix errors/warnings
This version of hacking doesn't understand f-strings as usable in
Python 3.  Update to the latest and fix current issues, which are all
just formatting fixes.

Change-Id: I0a7d6f93f07477b6dd29ab143130dd9064c250be
2020-01-14 09:40:45 +11:00
Andreas Jaeger
e7f77f283f Some python yaml fixes
libyaml now needs to Loader keyword to not throw a warning, use
safe_load instead everywhere.

sort_keys isn't supported for reasons surpassing understanding, so
switch to ruamel.yaml for the places where we write contents back
out.

Our ruamel.yaml wrapper strips extra leading space, which is needed
when the root object is a list. When the root object is NOT a list,
it's not needed. Add a flag to the constructor to toggle the
behavior.

For gerrit/projects.yaml this leads to a different wrapping of
description fields, which is included here.

Let ruamel.yaml handle comments

Since we've switched to ruamel.yaml, we don't need to strip
comments. Stop stripping them. Intra-list comments aren't
supported, so just remove them.

Please don't ask me why we can't have a space before openstack-merlin.

Change-Id: I72776774eabd4e397ee5e8bdd58b3632be8fd3a1
2019-04-10 13:33:51 +00:00
Sean McGinnis
f0680c7127
Remove x-vrif-minus-2 from gerritbot notifications
This event is currently a noop and a new event name is in the works to
replace its intended functionality. This removes all references to the
non-functional notification. Teams can add the new replacement
notification once it's available if they want to have these.

Change-Id: Iad5fd75bc10924b483a14a449853b6b8e7c4c465
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-11 16:27:12 -05:00
Andreas Jaeger
4adbecad99 Fix flake8
fix a "bug" in that the flake8 configuration in tox.ini was exclusively
selecting H231 as the only error it would report, so it was missing the
errors in the python modules (such as submit_log_processor_jobs). Due to
this being the case for a long time (since 2004) limit the more thorough
linting to the roles/ and playbooks/ directories where we'll be adding
ansible plugins/modules/etc. Also, lint in jenkins/script and nodepool.

Fix problems found.

We can lint everything with pep8 once the zuul v2 scripts are removed,
not worth patching them right now.

Change-Id: I479f010643cf3b67c183d763510f07a33400d38b
Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com>
2017-10-21 18:37:10 +02:00
Andreas Jaeger
676fb1d6f3 Remove gerritbot limit test
gerritbot can now handle more than 120 channels, remove the test for it.

Change-Id: If6d1630581762aab93c979ba7852f845bc2846f5
Depends-On: Ifafeed77e640bc7b5910251c619358a8a2bd78a6
2016-12-01 19:47:50 +01:00
Frédéric Guillot
0d290bd349 Remove whitespaces and add parenthesis to print statements
Change-Id: I0cab05343b1845f92b4c606e4f2d573faf871103
2016-08-24 16:48:09 -04:00
Andreas Jaeger
3968468468 Consistent ERROR messages
Capitalize ERROR for all project-config specific tests, so
that errors can found easily.

Add missing ERROR marks.

Change-Id: I1d7e1077de62945647e0329462016a34eaabd83e
2016-06-30 13:16:10 +02:00
Andreas Jaeger
65a096a964 Check number of channels for gerritbot
We currently have a limit of 120 channels, do not allow more channels to
be set up.

Change-Id: If70f1775b2d07d9af52c83a9d234c08ac73925ce
2016-06-20 19:12:21 +02:00
Andreas Jaeger
0b4b988d9f Basic validation for gerritbot/channels.yaml
Recently a change merged that had not branches line and gerritbot
refused to start again. This could have been avoided by validation of
the file.

Test some basic validation of the yaml file to avoid breakage.

Change-Id: I2dc4a28aeac07d3fc73d3954d8fbe8f2448334e5
2015-12-23 17:53:43 +01:00
Andreas Jaeger
bb85da439d Fix return code of irc_tests.py
The scripts was always returning 0 - see
https://review.openstack.org/#/c/163876/1 which should have failed since
accessbot was not updated.

Fixed with properly wrapping main.

Change-Id: Ica8b4fa28cf9ac0009443340949ff6b32ccb9dd1
2015-03-12 16:56:11 +01:00
Andreas Jaeger
f8788e2e27 Ensure that gerritbot channels are in accessbot
Add new test that checks that channels mentioned in gerritbot are also
in accessbot.

Enhance the irc tox target so that it runs the checks, and update Zuul
so that the job is run for changes to gerritbot.

Add channels openstack-mistral and puppet-openstack to accessbot,
openstackinfra now has access to the channels. These two channels are
already in gerritbot.

Make check_irc_access.py script executable.

Change-Id: Ic68ba9a1c60854e68817fcadb1a5df2144944af7
2015-03-06 12:51:24 +01:00