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 for #19066 Print warnings when deprecated options are configured in config file #19148

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

mansoor17syed
Copy link
Contributor

fix for #19066 Print warnings when deprecated options are configured in config file

Issue Details
Add warnings when deprecated options are configured
Problem: Currently, etcd doesn't warn users when they configure deprecated options
Goal: Improve user experience by warning about deprecated configurations before they're removed
Solution Overview

Implementation Location: server/config/config.go

@k8s-ci-robot
Copy link

Hi @mansoor17syed. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@serathius
Copy link
Member

/ok-to-test

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.89%. Comparing base (d5231c7) to head (5c0f709).
Report is 39 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
server/etcdmain/config.go 71.05% <100.00%> (+3.28%) ⬆️

... and 32 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19148      +/-   ##
==========================================
+ Coverage   68.77%   68.89%   +0.12%     
==========================================
  Files         420      420              
  Lines       35640    35641       +1     
==========================================
+ Hits        24510    24556      +46     
+ Misses       9704     9667      -37     
+ Partials     1426     1418       -8     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3388e2b...5c0f709. Read the comment docs.

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

This PR doesn't fix #19066 . Please follow #18998 (comment)

Thanks anyway

@mansoor17syed
Copy link
Contributor Author

Hi @ahrtr

Thank you for the review and feedback!

I initially assumed that the comment in the earlier PR referred specifically to their changes. Could you please confirm if the fix for issue #19066 is intended to address the comment you provided here : #18998 (comment)

Appreciate your clarification!

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

Could you please confirm if the fix for issue #19066 is intended to address the comment you provided here : #18998 (comment)

YES

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

I just realised that we can iterate FlagsExplicitlySet directly in parse(). Both configFromFile and configFromCmdLine populate the data structure with all flags,

FlagsExplicitlySet map[string]bool

sorry for the back and forth.

@mansoor17syed
Copy link
Contributor Author

@ahrtr

Can you Please have a look once now if I have done the right changes
I see one tests failing , but I guess the failure is not because of my changes

Still open for feedback and suggestions
do let me know

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

@mansoor17syed The change looks good. Please squash the commits

@ahrtr
Copy link
Member

ahrtr commented Jan 9, 2025

Could you please also add a test to cover the config file case?

@k8s-ci-robot k8s-ci-robot added size/L and removed size/S labels Jan 9, 2025
@mansoor17syed mansoor17syed force-pushed the issue_19066 branch 3 times, most recently from 98f23c0 to 70b0e50 Compare January 10, 2025 05:14
@mansoor17syed
Copy link
Contributor Author

@ahrtr

can chk now I have added the UT but some seems failing I doubt its because of my changes.
Still open for feedback and suggestions
do let me know

server/etcdmain/config_test.go Outdated Show resolved Hide resolved
server/etcdmain/config_test.go Outdated Show resolved Hide resolved
server/etcdmain/config_test.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

Please squash the commits.

@mansoor17syed
Copy link
Contributor Author

@ahrtr @serathius
can you Please have a look into it now, addressed all the review comments and squashed the commits.

@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

/test pull-etcd-robustness-arm64

@mansoor17syed
Copy link
Contributor Author

I don’t seem to have the permissions to merge this. @ahrtr Could you kindly take care of it?
Thanks so much for all your support and valuable feedback! 😊

@ahrtr
Copy link
Member

ahrtr commented Jan 10, 2025

Usually a PR needs two approval to be merged. Let's wait one of other maintainers or reviewers to take a look. thx

}

// Compare sets of flags
if !reflect.DeepEqual(foundFlags, tc.expectedFlags) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not use assert.Equal?


// Special check for experimental-warning-unary-request-duration
if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 {
t.Log("Note: experimental-warning-unary-request-duration deprecation is handled separately")
Copy link
Member

Choose a reason for hiding this comment

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

Why log here? if we want to leave context a comment would be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok will chk this

@mansoor17syed
Copy link
Contributor Author

@serathius

can you have a look now ?
Do let me know for any rework

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, mansoor17syed, serathius

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

@serathius
Copy link
Member

etcdmain/config_test.go:30: File is not `goimports`-ed with -local go.etcd.io (goimports)
	"github.com/stretchr/testify/assert"
etcdmain/config_test.go:734:4: SA9003: empty branch (staticcheck)
			if tc.configFileYAML.ExperimentalWarningUnaryRequestDuration != 0 {
			^
etcdmain/config_test.go:730:4: formatter: use assert.Equalf (testifylint)
			assert.Equal(t, tc.expectedFlags, foundFlags, "deprecated flags mismatch")

Use minimal config struct for YAML marshaling.
Replace custom mapToSortedSlice with standard library functions.
Fix flag verification for deprecated experimental options.

Fixes etcd-io#19066

Signed-off-by: mansoora <[email protected]>
@mansoor17syed
Copy link
Contributor Author

@serathius

I have addressed the review comments and fixed the issues. However, it seems some tests are still failing, although they don’t appear to be related to my changes. I'm open to any feedback and willing to work on it further if needed. Let me know your thoughts!

@serathius
Copy link
Member

/retest

@mansoor17syed
Copy link
Contributor Author

I don’t seem to have the permissions to merge this. @serathius Could you kindly take care of it?
Thanks so much for all your support and valuable feedback! 😊

@serathius serathius merged commit 5890801 into etcd-io:main Jan 13, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants