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

Introduce NewContext, deprecate NewImplFull. #2222

Merged
merged 2 commits into from
Aug 21, 2021

Conversation

mattmoor
Copy link
Member

@mattmoor mattmoor commented Aug 21, 2021

Our generated NewImpl methods have long taken context.Context, but despite many iterations the forms we expose from our controller package never have. This change contains several elements:

  1. Expose a new NewContext method that takes context.Context in addition to the current NewImplFull signature.
  2. Call NewContext instead of the deprecated NewImpl from our generated controller code.
  3. Call NewContext from all our webhook reconcilers.
  4. Introduce a tracker.Interface on controller.Impl now that we can extract the tracker lease from ctx (for use with Create a new ListableTracker ctor taking a tracker.Interface eventing#5651, and Have the addressable resolver take a tracker. #2220 downstream)

/kind cleanup

Release Note

Introduce controller.NewContext and deprecate controller.NewImplFull

Docs


/assign @n3wscott

Our generated `NewImpl` methods have long taken `context.Context`, but despite many iterations the forms we expose from our `controller` package never have.  This change contains several elements:
1. Expose a new `NewContext` method that takes `context.Context` in addition to the current `NewImplFull` signature.
2. Call `NewContext` instead of the deprecated `NewImpl` from our generated controller code.
3. Call `NewContext` from all our webhook reconcilers.
@knative-prow-robot knative-prow-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 21, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 21, 2021
@knative-prow-robot knative-prow-robot 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 Aug 21, 2021
@codecov
Copy link

codecov bot commented Aug 21, 2021

Codecov Report

Merging #2222 (e2a5591) into main (9b9bc2a) will decrease coverage by 0.03%.
The diff coverage is 61.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2222      +/-   ##
==========================================
- Coverage   63.91%   63.88%   -0.04%     
==========================================
  Files         220      220              
  Lines        9525     9536      +11     
==========================================
+ Hits         6088     6092       +4     
- Misses       3165     3169       +4     
- Partials      272      275       +3     
Impacted Files Coverage Δ
.../injection-gen/generators/reconciler_controller.go 0.00% <0.00%> (ø)
controller/controller.go 85.92% <58.33%> (-1.30%) ⬇️
webhook/certificates/controller.go 100.00% <100.00%> (ø)
webhook/configmaps/controller.go 100.00% <100.00%> (ø)
webhook/psbinding/controller.go 100.00% <100.00%> (ø)
webhook/resourcesemantics/conversion/controller.go 83.33% <100.00%> (ø)
webhook/resourcesemantics/defaulting/controller.go 100.00% <100.00%> (ø)
webhook/resourcesemantics/validation/controller.go 100.00% <100.00%> (ø)
test/gcs/mock/mock.go 90.32% <0.00%> (-1.08%) ⬇️

Continue to review full report at Codecov.

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

@mattmoor
Copy link
Member Author

The code style failure is a timeout, the serving downstream failure is a flake, and codecov/project is just always red. If nothing else fails, then this should be RFAL 👀

@mattmoor
Copy link
Member Author

/retest

MetricsExporter flake...

@mattmoor
Copy link
Member Author

Same test 🙃
/retest

Copy link
Contributor

@n3wscott n3wscott 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-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, n3wscott

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

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. cla: yes Indicates the PR's author has signed the CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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.

3 participants