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

cli/connect: misc UX improvements #64941

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

knz
Copy link
Contributor

@knz knz commented May 10, 2021

I found these improvements useful while doing QA work for #63492.

@knz knz requested review from itsbilal and a team May 10, 2021 15:16
@knz knz requested a review from a team as a code owner May 10, 2021 15:16
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz added this to In progress in DB Server & Security via automation May 10, 2021
@knz knz force-pushed the 20210510-connect-improvements branch from a5b7e20 to a43623d Compare May 10, 2021 15:20
@knz
Copy link
Contributor Author

knz commented Jun 4, 2021

@itsbilal do you think you could still review this? (If not, we'll figure something else out)

Copy link
Contributor

@rauchenstein rauchenstein left a comment

Choose a reason for hiding this comment

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

Nice clarification of the English and errors. The 'report' argument feels wrong to me, but I want to understand your thought process.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal and @knz)


pkg/cli/connect_join.go, line 57 at r3 (raw file):

	ctx context.Context,
	stopper *stop.Stopper,
	report func(string, ...interface{}),

At first glance, I liked this, but the longer I look the more it feels wrong.

I don't quite see the motivation. If it's for logging, use logging; if it's for interactive feedback, do we expect this to do anything other than print to stdout anytime soon? (And if we do expect that, it would be a system-wide thing and little pre-refactors like this might actually get in the way.)

It feels almost like you wanted the non-existent fmt.Printfln function, defined it as a utility lambda somewhere, then decided you wanted called functions to have access to it too, so you passed it as an arg instead of factoring it into a utility function.

Well, I'm speculating too much on what you were thinking when I ought to just ask you. What justifies passing a report function like this?

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

Sorry for missing this earlier! Getting to it now.

:lgtm: from my end, only things I could point out in addition to what @rauchenstein has already pointed out, is a suggestion to explicitly mention connect's interaction with start in the help text. But otherwise, looks good.

Reviewed 2 of 2 files at r1, 1 of 1 files at r2, 1 of 1 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @knz)


pkg/cli/connect.go, line 52 at r1 (raw file):

	Long: `
Connects to other instances of the 'connect init' command and negotiates
a package of TLS certificates for use with secure inter-node connections.

Maybe we could add how this command is usually followed with a start (or start-single-node) call, and how a lot of the flags are the same?


pkg/cli/connect_join.go, line 43 at r1 (raw file):

and obtain a package of TLS certificates for use with secure inter-node connections.

The TLS certificates are saved in the configured target directory.

Ditto, could repeat the part about this command preparing the certs directory for a successive call to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
DB Server & Security
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants