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

feat(datahub-cli): datahub init & docs for it #3062

Merged
merged 5 commits into from
Aug 10, 2021

Conversation

gabe-lyons
Copy link
Contributor

@gabe-lyons gabe-lyons commented Aug 9, 2021

Add an easy way to configure datahub cli for remote instances.

(venv) ➜  datahub init
Configure which datahub instance to connect to
Enter your DataHub host [http://localhost:8080]: 
(Optional) Enter your DataHub access token []: 
Written to /Users/gabe/.datahubenv

(venv) ➜ datahub init
/Users/gabe/.datahubenv already exists. Overwrite? [y/N]: y
Configure which datahub instance to connect to
Enter your DataHub host [http://localhost:8080]: 
(Optional) Enter your DataHub access token []: 
Written to /Users/gabe/.datahubenv

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

config = {
"gms": {
"server": host,
"token": token,
Copy link
Contributor

Choose a reason for hiding this comment

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

will this write "token": None if token is not provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shirshanka If token is None, then no Authorization header will be attached


The CLI will point to localhost DataHub by default. Running

```aidl
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is aidl used for syntax here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good question- intellij used this as the default and I didn't remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

@@ -2,11 +2,23 @@

There are a two ways to delete data from DataHub.


Copy link
Collaborator

Choose a reason for hiding this comment

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

Would love a dedicated CLI doc, that this doc simply points to :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!! I dont want to expand the scope of this PR, but completely agree.


click.echo("Configure which datahub instance to connect to")
host = click.prompt(
"Enter your DataHub host", type=str, default="http://localhost:8080"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's specify that this is GMS API server

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some users might not know what GMS is, but I'll add a line in the docs to clarify this :)

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Overall looks great!

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit 4e15c7a into datahub-project:master Aug 10, 2021
rahulbsw pushed a commit to rahulbsw/datahub that referenced this pull request Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants