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

✨ Deprecate Inject interface #1322

Merged

Conversation

varshaprasad96
Copy link
Member

@varshaprasad96 varshaprasad96 commented Jan 7, 2021

Deprecate inject interface

cc: @estroz

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 7, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @varshaprasad96. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 7, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 7, 2021
@coderanger
Copy link
Contributor

Might want to explain a bit about why it is being deprecated?

@varshaprasad96
Copy link
Member Author

@vincepri @alvaroaleman : Have only added a comment as a deprecation warning above the interface. Is there logging required anywhere else?

@vincepri
Copy link
Member

vincepri commented Jan 8, 2021

@coderanger The code injection code is going to be deprecated and removed in a future code, it's hard to maintain this codebase and it's highly error prone for users. In addition, when making breaking changes users might not see any compile time errors and some code might start to fail silently, which isn't great.

@varshaprasad96 In terms of deprecation, we'd want to deprecate all of the injectors, not just the client one. We should also add a log line when any of the injection paths is used to warn users that this functionality is going to be removed in v0.10.x

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 8, 2021
@vincepri
Copy link
Member

vincepri commented Jan 8, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2021
@vincepri
Copy link
Member

vincepri commented Jan 8, 2021

/retest

@coderanger
Copy link
Contributor

I would strongly recommend pulling the log into a helper function and making an env var that can be set on CI to turn these into fatal errors. Normal go test runners don't show output unless the test fails.

@estroz
Copy link
Contributor

estroz commented Jan 8, 2021

@coderanger defining an env var in the manner you suggest seems like a rather heavy-handed approach to a simple deprecation, which I believe has been done in the past just fine.

@varshaprasad96
Copy link
Member Author

/retest

@coderanger
Copy link
Contributor

@estroz Why not make it better though? Makes it much easier to check if you are clear on deprecation warnings if you can DEPRECATIONS_AS_ERRORS=1 make test and call it done :)

@estroz
Copy link
Contributor

estroz commented Jan 8, 2021

@coderanger that's what linters are for, which will fail if deprecated functions/packages are used.

@coderanger
Copy link
Contributor

coderanger commented Jan 8, 2021

@estroz That works too, but is a lot more work to write a custom kubebuilder linter. Compared to make a logDeprecation() helper function somewhere.

@estroz
Copy link
Contributor

estroz commented Jan 8, 2021

golangci-lint will do this for you with staticcheck. Regardless the feature you suggest should be done in a separate PR. This PR should only contain log messages and a deprecation comment IMO.

@coderanger
Copy link
Contributor

I'm not sure that would work since the calls for these functions are not in user code, but I'll try and make a repro and see.

@alvaroaleman
Copy link
Member

alvaroaleman commented Jan 8, 2021

@varshaprasad96 can you rename the pull to clarify that this is about deprecating all the Inject functionality and not just the client?

This was referenced Mar 15, 2021
@DirectXMan12
Copy link
Contributor

For next time we do this: there should be a corresponding issue or something, and as coderanger noted, there needs to be a more in-depth explanation in the PR & commit messages -- "deprecate XYZ" is insufficient. People need to be able to look back on PRs and issues to figure out what is going on.

@hiddeco
Copy link

hiddeco commented Mar 15, 2021

For next time we do this: there should be a corresponding issue or something, and as coderanger noted, there needs to be a more in-depth explanation in the PR & commit messages -- "deprecate XYZ" is insufficient.

Unsolicited consumer advice / perspective:

Tracing this back was actually pretty easy for us, but we do keep a close eye on reading the changelog to understand what's changed. The fact that we were unable to do anything about it, other than commenting here that we ran into deprecation notices we could not do anything about was however not pleasant to our end-users.

So IMHO the issue is/was not with (the ability of) looking back, but looking forward to the impact of changes, so that changes are made in stages (or all at once) without having an impact on consumers.

Lastly, thanks all involved for rolling out the patch release, we have updated most of our controllers today. 🌻

@DirectXMan12
Copy link
Contributor

@hiddeco yeah, totally agree on the impact of this change (log messages passed on to end users w/o any fix). This was not our best moment, unfortunately, but we'll certainly try to do better in the future.

My comment re: explanation is mainly for folks looking back in the future as to why something was changed. We certainly also need forward-looking impact too though :-).

@varshaprasad96
Copy link
Member Author

varshaprasad96 commented Mar 17, 2021

I'm sorry for the inconvenience caused here. I agree, this PR was premature, and doesn’t explain the reason for deprecating the functionality either. I am starting a discussion on this in the issue, so that we can plan the next steps on removing the inject interface usage internally first and then remove it later for the users.

RainbowMango pushed a commit to RainbowMango/controller-runtime that referenced this pull request Sep 1, 2021
…code

Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants