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).~~
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 todetermine 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).~~