Fix spec #4515#4654
Conversation
|
@slinkydeveloper just reviewing PR's from before the break, has this been brought up in the delivery WG? |
|
@lberk It was on 15/12/20, but there were just a bunch of people there |
e5fdfc3 to
4e29622
Compare
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
4e29622 to
624528b
Compare
|
/kind enhancement |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
|
What's the migration strategy for users here ? Asking b/c we have Let's define a proper one... or move this to something like /hold |
This is an actual bug of the v1 spec. To be specific, the field BrokerSpec.Delivery remains, but changes the meaning to avoid leaking internal details (which is the meaning people assumed downstream). We could just keep the actual mtbroker implementation, but then it would be a non-compliant implementation i guess?
I think we can create a script for mtbroker users that just moves the delivery field for them to somewhere else |
|
/unhold thanks for addressing my comments, Slinky |
| The `BrokerSpec.Delivery` field is global across all the Triggers registered with that particular | ||
| Broker, while the `TriggerSpec.Delivery`, if configured, fully overrides `BrokerSpec.Delivery` for | ||
| that particular Trigger. | ||
|
|
There was a problem hiding this comment.
I just want to understand how this is supposed to work with the wording about defaulting fields. It's more of an implementation question but has implications on when the defaulting happens and if it even should happen. The PR description seems to say that we default the triggerspec.delivery field, so if that's how we're going to implement it then it matters when the defaulting applies. If however you implement it by not actually updating the triggerspec.delivery but look at the brokerspec.delivery if triggerspec.delivery is missing then the behaviour is different.
In particular, it would be good to clarify that, for example, what happens in the following scenarios:
-
Create Broker, no delivery
-
Create Trigger, no delivery
-
Update Broker, configure delivery, what happens here?
-
Create Broker, with delivery
-
Create Trigger, no delivery -> defaulting happens
-
Update Broker, delete/update broker delivery -> what happens to trigger above
-
Create Trigger2, no delivery, will it match what Trigger from 2 has?
Just want to understand that behaviour little better about what "defaulting" really means and what the expected behaviour is.
As I said, depending on how this is implemented and if we actually modify the triggerspec.delivery vs. treating missing triggerspec.delivery as 'use brokerspec.delivery' has different semantics potentially and certainly makes the implementation more tricky depending on how it's implemented.
There was a problem hiding this comment.
From the PR description, this is what I'm trying to understand with the description on the spec.
Now Broker.Delivery defaults the Trigger.Delivery field. Note: this is a breaking change for mtbroker users that are using the Broker.Delivery field, because this field, even if it remains the same, will change meaning for them (in a followup I'll perform the actual change)
There was a problem hiding this comment.
Defaulting basically means that the trigger delivery spec, if any, wins on the broker delivery spec, exactly as it works today with subscription and channel delivery fields. So the result of the above cases:
-
defaults to Broker.Delivery -> no delivery
-
defaults to Broker.Delivery -> delivery from Broker.Delivery
-
defaults to Broker.Delivery -> delivery from Broker.Delivery
-
defaults to Broker.Delivery -> delivery from Broker.Delivery (no delivery if Broker.Delivery was removed)
-
defaults to Broker.Delivery -> delivery from Broker.Delivery (no delivery if Broker.Delivery was removed)
Another case:
- Create Trigger3, with delivery -> delivery from Trigger3.Delivery
There was a problem hiding this comment.
I can provide the implementation for mtbroker to show how that works, but I don't see any particular implementation issues with it
There was a problem hiding this comment.
Right, so I think it was (as I tried to say) how it's worded about "defaulting" since typically defaulting means filling in the fields and if that's how you were going to implement it, it could get confusing. If you remove the word defaulting I think I'd be much happier. What I tried to say :) was that spec seems ok, but your PR description confused me wrt. using words defaulting.
If you say:
If triggerspec.delivery is specified it is used. If triggerspec.delivery does not exist brokerspec.delivery is used. Nothing about defaulting :)
There was a problem hiding this comment.
How about now? I removed the default word everywhere and added some wording to the spec
Added more wording in the spec Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
|
If we backport this to v1 I'm thinking we should also backport it to v1beta1 as well. Looks like the roundtrippers are failing when it's trying to go from v1->v1beta1->v1 and the field is not surviving that. So I think:
|
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
|
The following is the coverage report on the affected files.
|
Codecov Report
@@ Coverage Diff @@
## master #4654 +/- ##
==========================================
- Coverage 81.25% 81.15% -0.11%
==========================================
Files 291 292 +1
Lines 8281 8311 +30
==========================================
+ Hits 6729 6745 +16
- Misses 1143 1152 +9
- Partials 409 414 +5
Continue to review full report at Codecov.
|
|
It seems like downstream tests are passing but failing in the license phase, for some reason not related to this PR: |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: slinkydeveloper, vaikas The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Francesco Guardiani francescoguard@gmail.com
PR to modify the spec according to #4515
Proposed Changes
Release Note
Docs