-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure that an update is obsoleted if it reaches unstable karma threshold in pending state #901
Conversation
@@ -1077,6 +1077,16 @@ def set_request(self, db, action, username): | |||
update=self, agent=username)) | |||
return | |||
|
|||
# If an update with pending status receives negative karma, make sure it gets obsoleted | |||
if self.status is UpdateStatus.pending and self.request is UpdateRequest.testing \ | |||
and self.karma < 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that we should only do this if autokarma is turned on. Do you agree? If so, rather than testing for negative karma perhaps we could test to see if the negative karma threshold is reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bowlofeggs Yeah I agree with autokarma turned on
.
Okay one more query regarding negative karma. Do we want to check negative karma from recent comment like we did has_negative_karma
or just checking unstable_karma(negative_karma) threshold
would be choice here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trishnaguha I think just checking that method should be fine. Does that method not account for users who changed their minds? If it doesn't, let's file a separate issue (and separate PR) for that and we can fix it later.
Can you rebase your commit? |
@@ -1955,6 +1955,33 @@ def test_revoke_action_for_testing_request(self, publish, *args): | |||
publish.assert_called_with( | |||
topic='update.request.revoke', msg=mock.ANY) | |||
|
|||
@mock.patch(**mock_valid_requirements) | |||
@mock.patch('bodhi.notifications.publish') | |||
def test_obsolete_update_on_pending_state(self, publish, *args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with the rest of the tests in this area, so can you please ensure that these five conditions are covered by tests that are either new or existing? There are 4 conditions that will be tested in the new if statement, so we could conceivably test 5 conditions. The first is a positive case (basically, what you have here but modified to set the autokarma and reach the negative threshold), and the other four just ensure the negative cases:
- The update is pending, is marked for testing, has autokarma true, and has reached the negative karma threshold. This update should get obsoleted.
- All of the first test, but the update isn't pending.
- All of the first test, but the update isn't marked for testing (this one should probably also be obsoleted, but by another function in the code. I also bet there's already a test for this.)
- All of the above, but autokarma is off.
- All of the above, but the karma is not beyond the thresholds.
You don't necessarily have to write the above tests if they already exist, but please ensure that they do exist.
e6bb0bb
to
197198c
Compare
Updated the patch. I will make sure that we have enough testcases for the patch. |
197198c
to
c8b419c
Compare
@bowlofeggs I have updated the test set. Can you please explain about the test you mentioned at no. 3? |
On Wed, 2016-09-21 at 02:09 -0700, Trishna Guha wrote:
Basically that we should test behavior when Overall, I want to ensure we hit all the bits that are anded in the if |
@bowlofeggs Sure I got you :). |
@bowlofeggs I just debugged that When we are not making request to testing on pending status it by default gets set to testing. Does it make sense to make request to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just two more changes and we'll be good to go:
- Indent that one line so it is visually separated from the code below it.
- Clarify the docblocks on the two very similar tests.
Nice work!
threshold, make sure it gets obsoleted. | ||
""" | ||
if self.autokarma and self.status is UpdateStatus.pending and self.request is UpdateRequest.testing \ | ||
and self.unstable_karma not in (0, None) and self.karma <= self.unstable_karma: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add one more level of indentation to this line so that it's visually separated from the code below?
up = self.db.query(Update).filter_by(title=nvr).one() | ||
self.assertEquals(up.karma, -1) | ||
self.assertEquals(up.status, UpdateStatus.pending) | ||
self.assertNotEquals(up.status, UpdateStatus.obsolete) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the first assertion implies the second assertion, so if it were me I would leave only the assertEqual and drop the assertNotEquals. That said, there's also obviously no direct harm in leaving this assertion, but less lines of code is preferable in my book ☺ You can leave it as is if you want, just a suggestion.
|
||
up = self.db.query(Update).filter_by(title=nvr).one() | ||
self.assertEquals(up.karma, -1) | ||
self.assertNotEquals(up.status, UpdateStatus.obsolete) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea here, I think it's slightly cleaner to have one less line of code and keep only the assertEquals instead of this assertNotEquals. Again, it's preference so you can leave it if you want.
def test_obsolete_if_unstable_with_autopush_enabled_when_testing(self, publish, *args): | ||
""" | ||
Send update to obsolete state if it reaches unstable karma threshold on | ||
testing state when Autopush is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the main difference between this test and the first one is that this one has up.request set to stable and the other has up.request set to testing. Can you clarify that difference in the docblocks of both tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The first test makes sure that the update doesn't go to testing(should be obsoleted) if it receives negative karma on the pending state where request is testing when autopush is enabled.
- This test makes sure that the update doesn't got to stable(should be obsoleted) if it receives negative karma on the testing state where request is stable when autopush is enabled.
Yes I will update the PR with that :).
…reshold on pending state
c8b419c
to
f033c74
Compare
Thanks :-). |
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by fedora-infra#901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, fedora-infra#1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before fedora-infra#901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. fedora-infra#901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after fedora-infra#901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer fedora-infra#1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by #901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, #1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com>
Before #901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. #901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after #901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer #1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com>
`obsolete_if_unstable` was introduced by #901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, #1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 3f21fd3)
Before #901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. #901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after #901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer #1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 25200ad)
`obsolete_if_unstable` was introduced by #901 to cover one path: obsoleting a 'pending' update if it reached its negative karma threshold. At the time, `check_karma_thresholds` only reached its negative karma check for updates in 'testing' state, it did not run on updates in 'pending' state. However, #1556 extended `check_karma_thresholds` to also run on updates in 'pending' state, which actually rendered `obsolete_if_unstable` entirely redundant, except in one case - calling `comment()` with `check_karma` set to `False` - which was introduced solely to make it possible to test `obsolete_if_unstable`. Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 3f21fd3)
Before #901, we obsoleted updates that reached their unstable_karma threshold regardless of autokarma setting, but only for updates in 'testing' status, not 'pending' status. #901 intended to fix that. In the review, @bowlofeggs said "we should only do this [obsolete updates in pending state that reach their unstable_karma threshold] if autokarma is turned on", but he did not apparently realize that was inconsistent with the existing behavior in the testing state. So after #901, we would obsolete updates from pending only if autokarma was enabled, but we would always obsolete updates from testing regardless of the autokarma setting. This behaviour remained the same afer #1556. I don't think it makes any sense to preserve this inconsistent behavior. This PR comes down on the side of always obsoleting regardless of the setting of autokarma, as I think in practice this happens most often to updates in 'testing' state not updates in 'pending' state, so it's the most similar behaviour. It's also the older behaviour. It would be easy to flip it to only ever unpush if autokarma is enabled, if we decide that's better. Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 25200ad)
Fixes #880