Revert "Skip notifications about WIP changes"

Needs more discussion.

This reverts commit 54e2f218d6.

Change-Id: I7fd6b8f78830cc87d14b67d957fa64cc0d453c0b
This commit is contained in:
Jeremy Stanley 2021-01-19 19:26:18 +00:00
parent e3bcd8a4e9
commit 225a6a3502
3 changed files with 3 additions and 23 deletions

View File

@ -301,15 +301,9 @@ class Gerrit(threading.Thread):
return ret
def _read(self, data):
# We skip notifications abour WIP changes
if 'change' in data and data['change'].get('wip', False):
self.log.debug('Skipped processing event on WIP change: %s', data)
return
try:
# We only consider event (not project/branch) filters for these.
# 'wip-state-changed' is included in order to notify when a change
# moves from wip to non-wip.
event_only_types = ('ref-updated', 'wip-state-changed')
event_only_types = ('ref-updated',)
if data['type'] in event_only_types:
channel_set = self._channels_for('events', data['type'])
else:

View File

@ -12,7 +12,6 @@
# under the License.
import collections
import copy
import testtools
import yaml
@ -141,9 +140,6 @@ class GerritTestCase(testtools.TestCase):
}
self.sample_data_wip = copy.deepcopy(self.sample_data)
self.sample_data_wip['change']['wip'] = True
def _validate_patchset_created(self):
self.assertEqual(1, len(self.ircbot.messages))
message = self.ircbot.messages[0]
@ -176,10 +172,6 @@ class GerritTestCase(testtools.TestCase):
self.gerrit._read(dict(self.sample_data, type='ref-updated'))
self._validate_ref_updated()
def test__read_ref_updated_wip(self):
self.gerrit._read(dict(self.sample_data_wip, type='ref-updated'))
self.assertEqual(0, len(self.ircbot.messages))
def _validate_change_merged(self):
self.assertEqual(1, len(self.ircbot.messages))
message = self.ircbot.messages[0]

10
tox.ini
View File

@ -1,8 +1,5 @@
[tox]
envlist =
pep8
py3
py3-{devel}
envlist = py37,pep8
[testenv]
usedevelop = True
@ -14,10 +11,7 @@ setenv = VIRTUAL_ENV={envdir}
LC_ALL=en_US.UTF-8
PYTHONWARNINGS=default::DeprecationWarning
TESTS_DIR=./gerritbot/tests/unit/
deps =
-r{toxinidir}/test-requirements.txt
devel: git+https://opendev.org/opendev/gerritlib.git@master#egg=gerritlib
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = rm
commands =
rm -f .testrepository/times.dbm