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

[featuregate] add Gate.featureGateEnableFunc for --feature-gates registered #9964

Closed
wants to merge 5 commits into from

Conversation

li-zeyuan
Copy link

Description:

fix bug: collector start fail with '--feature-gates=logs.jsonParserArray'

how to fix: add Gate.featureGateEnableFunc, called when --feature-gates registered

Link to tracking Issue:
#32313

Testing:

Documentation:

Please delete paragraphs that you did not use before submitting.

@li-zeyuan li-zeyuan requested a review from a team as a code owner April 15, 2024 09:47
@li-zeyuan li-zeyuan requested a review from dmitryax April 15, 2024 09:47
@li-zeyuan
Copy link
Author

li-zeyuan commented Apr 15, 2024

@djaglowski
Copy link
Member

Thanks @li-zeyuan. Please add a changelog entry.

@li-zeyuan
Copy link
Author

Thanks @li-zeyuan. Please add a changelog entry.

Thank you for your review. I have added the changelog

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 91.70%. Comparing base (9731ea3) to head (1eb28d0).

Files Patch % Lines
featuregate/registry.go 50.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9964      +/-   ##
==========================================
- Coverage   91.72%   91.70%   -0.03%     
==========================================
  Files         359      359              
  Lines       16634    16642       +8     
==========================================
+ Hits        15257    15261       +4     
- Misses       1053     1055       +2     
- Partials      324      326       +2     

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

@@ -107,6 +107,18 @@ func WithRegisterToVersion(toVersion string) RegisterOption {
})
}

// WithRegisterFeatureGateEnableFunc is used to set the Gate "featureGateEnableFunc".
func WithRegisterFeatureGateEnableFunc(f func()) RegisterOption {
Copy link
Member

Choose a reason for hiding this comment

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

It isn't clear to me what this new public option does. Can you expand in the godoc comments when you would use this option?

Comment on lines +209 to +210
if enabled && g.featureGateEnableFunc != nil {
g.featureGateEnableFunc()
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a unit test that hits this condition?

@li-zeyuan
Copy link
Author

@djaglowski @TylerHelmuth
Sorry, I thought of another implementation method, resubmit a MR

@li-zeyuan li-zeyuan closed this Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants