diff --git a/tests/unit/test_pagure_driver.py b/tests/unit/test_pagure_driver.py index 18330fe32b..4b7aa524a4 100644 --- a/tests/unit/test_pagure_driver.py +++ b/tests/unit/test_pagure_driver.py @@ -542,7 +542,8 @@ class TestPagureDriver(ZuulTestCase): self.assertEqual(0, len(self.history)) # Set the score threshold as reached - A.threshold_reached = True + # Here we use None that means no specific score is required + A.threshold_reached = None self.fake_pagure.emitEvent(A.getPullRequestOpenedEvent()) self.waitUntilSettled() # connection.canMerge is not validated diff --git a/zuul/driver/pagure/pagureconnection.py b/zuul/driver/pagure/pagureconnection.py index 0b910d2c7a..3d7ff6a9a8 100644 --- a/zuul/driver/pagure/pagureconnection.py +++ b/zuul/driver/pagure/pagureconnection.py @@ -795,9 +795,13 @@ class PagureConnection(BaseConnection): if self._hasRequiredStatusChecks(change): ci_flag = True + # By default project get -1 in "Minimum score to merge pull-request" + # But this makes the API to return None for threshold_reached. We need + # to handle this case as threshold_reached: True because it means + # no minimal score configured. threshold = pr.get('threshold_reached') if threshold is None: - self.log.debug("No threshold_reached attribute found") + threshold = True log.debug( 'PR %s#%s mergeability details mergeable: %s '