#105 Change publication logic.
Merged by ralph. Opened by ralph.
only-if-really-changed  into  master

Download 105.patch
  • This is related to and likely conflicts with #103.
  • This is an attempt to fix #104.

This changes our publication logic such that we only publish a message
for every decision context and product-version combination that we
know about instead of publishing for every policy and product-version
combination
.

I think this is the right way to go since it is how other systems will
be calling greenwave. They call with a decision context in their
question, not with a particular policy in mind. We might have 10
different policies which all apply to the same context -- but it is the
context that the external system cares about. Policies should be a more
or less internal implementation detail for greenwave.


~~Importantly, this PR also changes the != comparison logic used to
determine if we should publish a message or not. We used to publish for
every subtle change in decision: i.e., if the decision used to fail
because 2 of 3 tests were absent, but now it fails because 1 of 3 tests
are absent.. we would still publish a "change". The new logic here only
publishes if the overall decision changes from True to False (or vice
versa).~~

Hmm. I think we do need to publish a message even if the overall decision stays the same, but the exact status differs. Because (at least in the original design that I recall) Bodhi is using that message to update the info it shows to the user. So each time a new test starts passing we want Bodhi to notice so that the UI reflects that.

Or does Bodhi not work like that?

Cool, that makes sense to me.

@dcallagh is correct - Bodhi does display the greenwave summary string to the user when the gating decision is no-go:

https://github.com/fedora-infra/bodhi/blob/3.0.0/bodhi/server/templates/update.html#L87-L94

correct

OK, will revise to still publish on every subtle change.

rebased onto d1c4c3cc012bad8dc0c950995626fa299bcbfb88

Ok - it should be doing the right thing now. @dcallagh, @mjia - look good to you?

:thumbsup:

:+1: nice, thanks @ralph

Pull-Request has been merged by ralph

Metadata