Updating validation tests to follow the spec for spec.subscriber#5762
Conversation
|
@lionelvillard @evankanderson folks if you can also point me to where in the docs this should be updated that will be great .. I am happy to send a PR there if I find where this change is relevant. |
evankanderson
left a comment
There was a problem hiding this comment.
I'm just realizing this doesn't include a flag / controller environment variable to bridge over the 0.26 and prior behavior.
See https://github.com/knative/eventing/blob/main/pkg/apis/duck/v1/delivery_types.go#L79 for an example of a flag-controlled validation.
|
@evankanderson regarding the flag, I can see that for features, but for this change.. what is the expected behavior? To achieve this, we need to have the old logic and the new logic as well and we need a new flag. I couldn't find anything related to versions.. and it feels bad to create a flag called "ConformantToNewSpec". @lionelvillard @evankanderson Can you share some advice? PS: I see that there are some tests failing still.. but let's settle on how this should work so I can go and fix those tests. |
|
@salaboy the reference doc is generated from https://github.com/knative/eventing/blob/main/pkg/apis/messaging/v1/subscription_types.go#L97 I quickly look at the rest of the documentation and I didn't find anything else. |
|
IMO, the way to incrementally get Knative eventing conformant is to add a new experimental flag. It's not ideal, since this is not an experimental feature, but at least it gives you a framework to work with. I propose to call the flag Here a good example of how to add a new experimental flag: #5440 Proposed timeline:
X is the release number in 1 year (~35?) WDYT? |
|
@lionelvillard after thinking about this overnight, I woke up decided to implement the flag. Your explanation makes my life way much easier and thanks for the references. I will be working on this today and tomorrow hopefully I will have an updated PR by then. |
|
By the way.. you also solved the naming problem ( |
|
@lionelvillard I've added the feature flag, disabled by default and I have a test testing a bunch of scenarios with strict-subscriber. Let me wait for CI to see which tests are failing |
Codecov Report
@@ Coverage Diff @@
## main #5762 +/- ##
==========================================
- Coverage 82.52% 82.41% -0.11%
==========================================
Files 203 204 +1
Lines 6374 6460 +86
==========================================
+ Hits 5260 5324 +64
- Misses 768 778 +10
- Partials 346 358 +12
Continue to review full report at Codecov.
|
|
We don't have e2e tests for the new behavior, but it's currently off by default. I'm fine with that in this PR and then subsequently trying to convince Lionel to skip the alpha phase for this flag and adding e2e tests then if he agrees. So, /lgtm from me, but I'm going to let Lionel approve when he's happy. (At the very least, I think checking this in as flag-off-by-default is the right choice for this PR to enable small incremental progress.) |
|
I restarted the kind actions, to see if the failure was a flake. |
|
/lgtm
I'm worried that if we skip the alpha phase we risk breaking existing applications, in particular the ones that dynamically create Subscription objects. If we find a solution to this problem, then yes I think we can skip the alpha phase. |
|
/hold You also need to add the feature in this configmap: https://github.com/knative/eventing/blob/main/config/core/configmaps/features.yaml We may want to document it here: https://knative.dev/docs/eventing/experimental-features/. Do you mind opening an issue in the docs repo? |
|
@lionelvillard better than an issue is a PR: knative/docs#4311 |
|
@salaboy great! Can you make the linter happy and then it should be ready to be merged. Thanks! |
|
@salaboy ^ |
|
@pierDipi sorry.. I don't know why I missed this one.. linter should be happy now. |
|
The following is the coverage report on the affected files.
|
|
/cc @lionelvillard @evankanderson Can you please review this again? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson, salaboy 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 |
|
/unhold |
Fixes #5756 As per knative/specs#30 the spec was changed from requiring one of `spec.subscriber` or `spec.reply` to be set to require that `spec.subscriber` is set. As part of this change the `strict-subscriber` feature flag was introduced to disable this validation (#5762) and promoted to beta (enabled by default) in 1.7 (#6473). :broom: This commit removes this feature flag again so the validation can't be disabled anymore. ## Proposed Changes * Remove `strict-subscriber` feature flag * Promote strict subscriber validation to GA ### Pre-review Checklist - [ ] **At least 80% unit test coverage** - [ ] **E2E tests** for any new behavior - [ ] **Docs PR** for any user-facing impact - [ ] **Spec PR** for any new API feature - [ ] **Conformance test** for any change to the spec **Release Note** ```release-note Remove the possibility to disable strict subscriber validation. When the reply field is specified without a subscriber, the reply field won't be used as a subscriber by default and the subscriber validation will fail. ``` Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
Fixes #5756
Proposed Changes
🧹 Update or clean up current behavior
This Pull Request updates the validation of Subscription resources requiring the
spec.subscriberto be set for all subscriptions. This is based on the spec update linked in #5756 .This PR removes 2 old validation tests which were creating previously valid Subscriptions without
spec.subscriber. These tests are no longer needed.This PR also removes the resource validation of the
spec.replyproperty as it is no longer required by the spec.Pre-review Checklist
Release Note
Docs