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

Don't override default values when applying partial features.yaml configmap #7379

Merged

Conversation

pierDipi
Copy link
Member

Fixes #7254

Proposed Changes

  • Don't override default values when applying partial features.yaml configmap

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

It is now possible to specify a subset of features in `config-features` without overriding default values

Docs

@knative-prow
Copy link

knative-prow bot commented Oct 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi

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 added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 18, 2023
@pierDipi
Copy link
Member Author

/cc @Leo6Leo @Cali0707

@pierDipi
Copy link
Member Author

/cherry-pick release-1.11

@knative-prow-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-1.11

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.

@pierDipi
Copy link
Member Author

/cherry-pick release-1.10

@knative-prow-robot
Copy link
Contributor

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

In response to this:

/cherry-pick release-1.10

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.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (5168dc3) 76.87% compared to head (0f3e1de) 76.72%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7379      +/-   ##
==========================================
- Coverage   76.87%   76.72%   -0.15%     
==========================================
  Files         252      253       +1     
  Lines       13822    13903      +81     
==========================================
+ Hits        10625    10667      +42     
- Misses       2667     2702      +35     
- Partials      530      534       +4     
Files Coverage Δ
pkg/apis/feature/features.go 66.66% <82.35%> (+11.40%) ⬆️

... and 6 files with indirect coverage changes

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

require.Nil(t, err)
require.NotNil(t, f)

if !f.IsDisabled(KReferenceGroup) && !f.IsEnabled(KReferenceGroup) {
Copy link
Member

@Leo6Leo Leo6Leo Oct 19, 2023

Choose a reason for hiding this comment

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

@pierDipi , I've reviewed the part where we call NewFlagsConfigFromMap with an empty string map. If I understand correctly, this will return an empty flag. Wouldn't this potentially cause an issue at line 65? (nvm, it only checks for nil. The flag is empty, and it doesn't mean it is nil)

Also, I noted that with use of KReferenceGroup as a feature flag name. Is this specifically for testing purposes? Why we are using KReferenceGroup? And the if statement here is used to validate that KReferenceGroup only allow values from "Disabled" or "Enabled" right? How can that be related to "TestShouldNotOverrideDefaults"?

Thanks for helping me clarify this!

Copy link
Member Author

Choose a reason for hiding this comment

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

I've reviewed the part where we call NewFlagsConfigFromMap with an empty string map. If I understand correctly, this will return an empty flag. Wouldn't this potentially cause an issue at line 65? (nvm, it only checks for nil. The flag is empty, and it doesn't mean it is nil)

Exactly

Also, I noted that with use of KReferenceGroup as a feature flag name. Is this specifically for testing purposes? Why we are using KReferenceGroup? And the if statement here is used to validate that KReferenceGroup only allow values from "Disabled" or "Enabled" right? How can that be related to "TestShouldNotOverrideDefaults"?

This assertion is the "regression test" for the original issue and if you remove the solution this assertion will fail, there is no specific reason for using that feature flag KReferenceGroup, another one would have worked as well

@pierDipi
Copy link
Member Author

Thanks for the reviews @Leo6Leo @Cali0707 @creydr, I've made the changes

Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2023
@Cali0707
Copy link
Member

/test upgrade-tests

@knative-prow knative-prow bot merged commit 16a3986 into knative:main Oct 20, 2023
30 of 34 checks passed
@knative-prow-robot
Copy link
Contributor

@pierDipi: new pull request created: #7385

In response to this:

/cherry-pick release-1.11

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

@pierDipi: new pull request created: #7386

In response to this:

/cherry-pick release-1.10

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.

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. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Applying partial features.yaml configmap overrides default values
5 participants