Skip to content

Single common fn.Client factory for all commands#824

Merged
knative-prow-robot merged 1 commit intoknative:mainfrom
matejvasek:common-factory
Feb 9, 2022
Merged

Single common fn.Client factory for all commands#824
knative-prow-robot merged 1 commit intoknative:mainfrom
matejvasek:common-factory

Conversation

@matejvasek
Copy link
Copy Markdown
Contributor

@matejvasek matejvasek commented Feb 8, 2022

Added single common factory function of fn.Client for all commands.
This allows to set all important settings at one place.

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label Feb 8, 2022
@matejvasek matejvasek requested a review from lkingland February 8, 2022 22:21
@knative-prow-robot knative-prow-robot added the size/L 🤖 PR changes 100-499 lines, ignoring generated files. label Feb 8, 2022
@knative-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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-robot knative-prow-robot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Feb 8, 2022
@matejvasek
Copy link
Copy Markdown
Contributor Author

matejvasek commented Feb 8, 2022

@lkingland this is how unified fn.Client factory could look like.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 8, 2022

Codecov Report

Merging #824 (31f0800) into main (a2abfca) will increase coverage by 0.23%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   43.02%   43.26%   +0.23%     
==========================================
  Files          47       48       +1     
  Lines        4720     4683      -37     
==========================================
- Hits         2031     2026       -5     
+ Misses       2398     2366      -32     
  Partials      291      291              
Impacted Files Coverage Δ
cmd/client.go 0.00% <0.00%> (ø)
cmd/deploy.go 16.41% <0.00%> (+2.49%) ⬆️
cmd/info.go 26.76% <0.00%> (+2.08%) ⬆️
cmd/invoke.go 33.76% <0.00%> (+0.99%) ⬆️
cmd/list.go 32.75% <0.00%> (+3.07%) ⬆️
cmd/create.go 47.89% <41.17%> (+1.68%) ⬆️
cmd/root.go 66.90% <84.61%> (-0.02%) ⬇️
cmd/build.go 59.63% <100.00%> (-0.07%) ⬇️
cmd/delete.go 60.49% <100.00%> (+9.95%) ⬆️
... and 1 more

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 a2abfca...31f0800. Read the comment docs.

@matejvasek matejvasek force-pushed the common-factory branch 4 times, most recently from d42108f to 27df622 Compare February 9, 2022 00:08
Signed-off-by: Matej Vasek <mvasek@redhat.com>
@knative-prow-robot knative-prow-robot added size/XL 🤖 PR changes 500-999 lines, ignoring generated files. and removed size/L 🤖 PR changes 100-499 lines, ignoring generated files. labels Feb 9, 2022
@matejvasek matejvasek changed the title WIP Single common fn.Client factory for all commands. Feb 9, 2022
@matejvasek matejvasek changed the title Single common fn.Client factory for all commands. Single common fn.Client factory for all commands Feb 9, 2022
@@ -0,0 +1,87 @@
package cmd
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lkingland here is the factory

@matejvasek matejvasek marked this pull request as ready for review February 9, 2022 13:41
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label Feb 9, 2022
Copy link
Copy Markdown
Contributor

@lance lance left a comment

Choose a reason for hiding this comment

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

Overall this lgtm and seems to be a big improvement over the more ad hoc method of instantiating a client within each subcommand. I do have one small question about some interrupt behavior that seems to have been removed. I also have some lingering concern about how we will address additional build strategies (e.g. local or s2i). I wouldn't expect you to have given a lot of thought to that, as it's only recently been discussed. But if you have, I would be interested in how you see that working with this flow.

@matejvasek
Copy link
Copy Markdown
Contributor Author

matejvasek commented Feb 9, 2022

I also have some lingering concern about how we will address additional build strategies (e.g. local or s2i). I wouldn't expect you to have given a lot of thought to that, as it's only recently been discussed.

Indeed I didn't think much about it, but I think these changes shouldn't affect it much.
I mean this PR shouldn't it make it harder.

@lance
Copy link
Copy Markdown
Contributor

lance commented Feb 9, 2022

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm 🤖 PR is ready to be merged. label Feb 9, 2022
@knative-prow-robot knative-prow-robot merged commit 568af71 into knative:main Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants