client icon indicating copy to clipboard operation
client copied to clipboard

Move shared code to knative/client-pkg

Open rhuss opened this issue 3 years ago • 5 comments

Since we have now knative/client-pkg for holding shared client code that can be used by kn but also plugins, we should move the client API to this repository (and while doing so, thinking about cleaning it up)

rhuss avatar Jan 27 '22 15:01 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Apr 28 '22 01:04 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Apr 28 '22 06:04 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jul 28 '22 01:07 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Jul 28 '22 08:07 rhuss

We discussed this with @dsimansk on today's WG meeting. There are some areas which are even broader in scope than client, and are related to command line apps in general, like:

  1. Cobra integration and testing (see example PR https://github.com/knative-sandbox/kn-plugin-event/pull/205)
  2. Logging - verbosity, format json,yaml,human, stderr by default
  3. Regular output - format json,yaml,human, stdout by default
  4. Fatal error reporting - all debug logs despite verbosity, error with stack, all in nice file to upload

Maybe others as well. All of this are command line related, and there are other command line tools that we have apart from client and plugins: test-infra tools, hack tools. Just in last week, I've added 3 command line tools: https://github.com/knative/test-infra/pull/3513, https://github.com/knative/test-infra/pull/2995, https://github.com/knative/hack/pull/222.

So, I think we could benefit from knative's commandline package. At the same time, adding those to client-pkg isn't helping as client has deps which simple command line tools don't need.

I had an idea to fix this. We could use Go 1.18 workspaces, and hack's support for it https://github.com/knative/hack/pull/205 to create commandline package in knative.dev/pkg with its own go.mod file. Also, we could fold client-pkg into knative.dev/pkg/client Go module with own deps. The go.work would reference both - simplifying the release process considerably.

go 1.18

use (
  .
  client
  commandline
)

cardil avatar Sep 13 '22 15:09 cardil