WIP changes are likely to spam irc channels as they are not even
visible by default in dashboards. If we detect the WIP flag as present
and set to true, we just skip doing anything about that message.
Change-Id: Id4ee6c825e6d508c0c722d01ac8b1147b4025dbe
This change fixes the comment-added message sending to filter by the
event type which gerrit is now sending (Verified and Code-Review)
Adding the following to project-config/gerritbot/channels.yaml will
restore the previous functionality of sending messages for Verified,
Code-Review +2 and -2:
events:
- comments-added
- x-vrif-minus-2
- x-vrif-plus-2
- x-crvw-minus-2
- x-crvw-plus-2
Additionally, specifying 'comments-added' will send a message for
*every* gerrit comment, so the only way to get messages for
x-vrif-plus-2 (for example) is to also receive a firehose of every
gerrit comment.
To make this more configurable, the event type x-all-comments has been
added, which is now required in combination with 'comments-added' to
send a message for every gerrit comment:
events:
- comments-added
- x-all-comments
Change-Id: I9971e045c3416b300d1fd4683a2c145afef3d44f
With this change, the channel config yaml file can now be configured to
support regular expressions.
Any value in any section may be prefixed with `^` to denote that it is
to be treated as a regular expression [1]. Start and end ^anchors$ are
implicit (so add `.*` if needed).
For example, given the following paragraph in the channel config yaml:
openstack-foo:
events:
- patchset-created
- change-merged
projects:
- openstack/foo
- ^openstack/foo-.*
- openstack/oslo.foo
branches:
- master
- ^stable/(newton|ocata|pike)
...messages will be posted to #openstack-foo for events coming in from
project openstack/foo, openstack/foo-one, openstack/foo-bar, etc.; on
branches master, stable/newton, stable/ocata, or stable/pike.
Behavior is unchanged for values not prefixed with `^`.
[1] This paradigm cribbed from gerrit's search functionality:
https://review.openstack.org/Documentation/user-search.html#path
Change-Id: I97cb8faa72600bd1bd9792bb6bb59a3b652ec389
Enhance the tests introduced in [1] to exercise the filtering logic in
the Gerrit class.
[1] https://review.openstack.org/#/c/545128/
Change-Id: Ib4ecd9e7ee233378f25d585f016ba1448b9e8797
* Add some additional unit tests, including the initial framework to
be able to test the Gerrit() class.
* Improve the readability of the code by using more descriptive
variable names.
* Migrate to using '.stestr.conf' instead of '.testr.conf'. This
removes warning message that was being displayed.
Change-Id: I596c4ccb9fe37d996de26089eefd8481a12ff13b
Add an initial unit test framework and one unit test. This way we can
ask people to add unit tests when they contribute code.
Change-Id: If52976e1992945a8e38af3cbad5b5f4389922d4c