Skip to content
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

fix: triggers use correct consumer group id generated from template #3779

Conversation

Cali0707
Copy link
Member

Currently, the triggers will always use a consumer group id generated from the default template. Instead, they should use the most up to date version of the template.

Proposed Changes

  • Add a rekt test to test for regressions here
  • Watch the configmap for changes

Release Note

:bug: triggers now correctly generate the consumer group id from the template, rather than just the default template

Docs

Signed-off-by: Calum Murray <cmurray@redhat.com>
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test labels Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.48%. Comparing base (edf8a50) to head (ed5f687).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3779      +/-   ##
============================================
+ Coverage     48.39%   52.48%   +4.09%     
- Complexity        0      877     +877     
============================================
  Files           243      343     +100     
  Lines         18044    21466    +3422     
  Branches          0      288     +288     
============================================
+ Hits           8732    11267    +2535     
- Misses         8574     9288     +714     
- Partials        738      911     +173     
Flag Coverage Δ
java-unittests 73.96% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Calum Murray <cmurray@redhat.com>
…eatures cm

Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

/cc @matzew @pierDipi

@knative-prow knative-prow bot requested review from matzew and pierDipi March 21, 2024 15:32
@Cali0707
Copy link
Member Author

/cc @maschmid

@knative-prow knative-prow bot requested a review from maschmid March 21, 2024 15:33
@Cali0707
Copy link
Member Author

/cherry-pick release-1.13

@knative-prow-robot
Copy link
Contributor

@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.13 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.13

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Cali0707
Copy link
Member Author

/cherry-pick release-1.12

@knative-prow-robot
Copy link
Contributor

@Cali0707: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.12

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: Calum Murray <cmurray@redhat.com>
}
}

func WithTriggerConsumerGroupIDTemplate(template string) manifest.CfgFn {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@matzew matzew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

/retest

@knative-prow knative-prow bot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Mar 21, 2024
@Cali0707
Copy link
Member Author

Looks like that may have been a real failure

/cc @matzew

@knative-prow knative-prow bot requested a review from matzew March 21, 2024 17:52
@Cali0707 Cali0707 force-pushed the watch-kafka-config-features-on-trigger branch from 43a014a to 57a7e44 Compare March 21, 2024 17:54
Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707 Cali0707 force-pushed the watch-kafka-config-features-on-trigger branch from 57a7e44 to d78a6f7 Compare March 21, 2024 18:32
Signed-off-by: Calum Murray <cmurray@redhat.com>
…features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>
@Cali0707
Copy link
Member Author

/retest-required

@matzew
Copy link
Contributor

matzew commented Mar 22, 2024

/retest

Copy link
Contributor

@matzew matzew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2024
Copy link

knative-prow bot commented Mar 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, matzew

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot merged commit bf38772 into knative-extensions:main Mar 22, 2024
34 of 37 checks passed
@knative-prow-robot
Copy link
Contributor

@Cali0707: #3779 failed to apply on top of branch "release-1.13":

Applying: add rekt test to catch trigger cg being wrong
Using index info to reconstruct a base tree...
M	test/e2e_new/broker_sasl_ssl_test.go
M	test/rekt/features/broker_auth.go
Falling back to patching base and 3-way merge...
Auto-merging test/rekt/features/broker_auth.go
Auto-merging test/e2e_new/broker_sasl_ssl_test.go
CONFLICT (content): Merge conflict in test/e2e_new/broker_sasl_ssl_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add rekt test to catch trigger cg being wrong
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.13

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@Cali0707: #3779 failed to apply on top of branch "release-1.12":

Applying: add rekt test to catch trigger cg being wrong
Using index info to reconstruct a base tree...
M	test/e2e_new/broker_sasl_ssl_test.go
M	test/rekt/features/broker_auth.go
Falling back to patching base and 3-way merge...
Auto-merging test/rekt/features/broker_auth.go
Auto-merging test/e2e_new/broker_sasl_ssl_test.go
CONFLICT (content): Merge conflict in test/e2e_new/broker_sasl_ssl_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add rekt test to catch trigger cg being wrong
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.12

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request Mar 22, 2024
…native-extensions#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
openshift-merge-bot bot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request Mar 25, 2024
… from template (knative-extensions#3779) (#1038)

* fix: triggers use correct consumer group id generated from template (knative-extensions#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* cleanup: consumergroup template test does not modify configmap now (knative-extensions#3782)

* cleanup: consumergroup template test does not modify configmap now

Signed-off-by: Calum Murray <cmurray@redhat.com>

* account for different possible cm keys

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* update configmap in CI to test non default values

Signed-off-by: Calum Murray <cmurray@redhat.com>

* Update openshift/e2e-common.sh

* clone correct SO branch

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request Mar 25, 2024
… from template (knative-extensions#3779) (knative-extensions#1038)

* fix: triggers use correct consumer group id generated from template (knative-extensions#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* cleanup: consumergroup template test does not modify configmap now (knative-extensions#3782)

* cleanup: consumergroup template test does not modify configmap now

Signed-off-by: Calum Murray <cmurray@redhat.com>

* account for different possible cm keys

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* update configmap in CI to test non default values

Signed-off-by: Calum Murray <cmurray@redhat.com>

* Update openshift/e2e-common.sh

* clone correct SO branch

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@Cali0707
Copy link
Member Author

Cali0707 commented Apr 2, 2024

/cherry-pick release-1.13

@Cali0707
Copy link
Member Author

Cali0707 commented Apr 2, 2024

/cherry-pick release-1.12

@knative-prow-robot
Copy link
Contributor

@Cali0707: #3779 failed to apply on top of branch "release-1.13":

Applying: add rekt test to catch trigger cg being wrong
Applying: fix cm key name
Applying: fix: trigger controller now watches for changes to the config-kafka-features cm
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/trigger/controller.go
Falling back to patching base and 3-way merge...
Auto-merging control-plane/pkg/reconciler/trigger/controller.go
CONFLICT (content): Merge conflict in control-plane/pkg/reconciler/trigger/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 fix: trigger controller now watches for changes to the config-kafka-features cm
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.13

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@Cali0707: #3779 failed to apply on top of branch "release-1.12":

Applying: add rekt test to catch trigger cg being wrong
Using index info to reconstruct a base tree...
M	test/e2e_new/broker_sasl_ssl_test.go
M	test/rekt/features/broker_auth.go
Falling back to patching base and 3-way merge...
Auto-merging test/rekt/features/broker_auth.go
Auto-merging test/e2e_new/broker_sasl_ssl_test.go
CONFLICT (content): Merge conflict in test/e2e_new/broker_sasl_ssl_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add rekt test to catch trigger cg being wrong
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.12

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request Apr 2, 2024
…native-extensions#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request Apr 2, 2024
…native-extensions#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
knative-prow bot pushed a commit that referenced this pull request Apr 3, 2024
…from template (#3779) (#3800)

* fix: triggers use correct consumer group id generated from template (#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* cleanup: consumergroup template test does not modify configmap now (#3782)

* cleanup: consumergroup template test does not modify configmap now

Signed-off-by: Calum Murray <cmurray@redhat.com>

* account for different possible cm keys

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
knative-prow bot pushed a commit that referenced this pull request Apr 30, 2024
…from template (#3779) (#3801)

* fix: triggers use correct consumer group id generated from template (#3779)

* add rekt test to catch trigger cg being wrong

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix cm key name

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fix: trigger controller now watches for changes to the config-kafka-features cm

Signed-off-by: Calum Murray <cmurray@redhat.com>

* fixed unit test

Signed-off-by: Calum Murray <cmurray@redhat.com>

* also watch cm for namespaced triggers

Signed-off-by: Calum Murray <cmurray@redhat.com>

* goimports

Signed-off-by: Calum Murray <cmurray@redhat.com>

* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

* cleanup: consumergroup template test does not modify configmap now (#3782)

* cleanup: consumergroup template test does not modify configmap now

Signed-off-by: Calum Murray <cmurray@redhat.com>

* account for different possible cm keys

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>

---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
pierDipi added a commit to openshift-knative/eventing-kafka-broker that referenced this pull request May 7, 2024
… from template (knative-extensions#3779) (#1038) (#1041)

* fix: triggers use correct consumer group id generated from template (knative-extensions#3779)

* add rekt test to catch trigger cg being wrong



* fix cm key name



* fix: trigger controller now watches for changes to the config-kafka-features cm



* fixed unit test



* also watch cm for namespaced triggers



* goimports



* don't use manifest.InstallYamlFS because it deletes the config-kafka-features cm after the test



---------



* cleanup: consumergroup template test does not modify configmap now (knative-extensions#3782)

* cleanup: consumergroup template test does not modify configmap now



* account for different possible cm keys



---------



* update configmap in CI to test non default values



* Update openshift/e2e-common.sh

* clone correct SO branch



---------

Signed-off-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane area/test lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants