Skip to content

Conversation

@yuhuyoyo
Copy link
Contributor

@yuhuyoyo yuhuyoyo commented Jul 27, 2022

example user flow:

yuhuyoyo-macbookpro3% terra resource add-ref git-repo --name=cli --repo-url=git@github.com:DataBiosphere/terra-cli.git           
Successfully added referenced git repo.
Name:         cli
Description:  
Type:         GIT_REPO
Stewardship:  REFERENCED
Cloning:      COPY_REFERENCE
Git repo Url: git@github.com:DataBiosphere/terra-cli.git
You do not have a Terra ssh key, cloning the git repo in the GCP notebook will fail. Please run `terra user ssh-key generate` and store the output (public key) in your GitHub account https://github.com/settings/keys.
yuhuyoyo-macbookpro3% terra user ssh-key generate
Generating a new Terra SSH key will replace the old Terra SSH key if it exists. You must associate the new SSH public key with your GitHub account using https://github.com/settings/keys. Are you sure you want to proceed (y/N)? y
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDfPJ57YEhhbty5bDYQcnmP4Z0UfJVWlsx8LWceyTIZRNMnVybXUV7Vv2msz5vcTmAL5J1QRxnLYi7IZbGE+PSs7/nw0jO6Obqeefzlgse4KZ0LGtSKjzfLDrONIjjs1wyp6Z/+vAX9OqYJ6uBTvdoTgXxIyQ1YCkqXEj8jn66ZPm2hQg7U2MNC22NteCziJ8ye8XEZplOem5TkDV6R9nk4tfyBX1ZAGmvHhGIGmzb9bh95XjUUMzMXSFinnxyo/h3OF0x4S3yWX3spW/8Ue7ju4x5Se8vmSARSG/98zmFpBrA1mtkJibZLzH69CkzNz+2ex0bn1mdW2UWwKsivfYG740vBP+Xr7sjeV4zWvfCX7P4d9HgIEOPfydHpeHEC3xKRUhNUlijdHMpmhyBBS3Jgxo3kL4u01KW5GVGHviviXH5EMhdOYlj+4DuOYsWP/lrdJ4jt/MtJpEaR39MPfv+AuxTqxRN6UBW5iw2otKOlwqVHBpDjzGSMSKWw3HRUMinFLeTl5mCxqQUExMGXYW99+VKaKVMa/9LCImgj+k9eKk87+hwU4I63XPCGBZyZvCqdrPts6gXl3nG/znV/02q7Jk6vvhYOQu/25G55NWrRpuCZABeXT2QgWkUMaN4YN4/1FZMawnc4sRG8LCewolagzRRrQAVJb188koWXIf49cQ== yuhuyoyo@google.com
yuhuyoyo-macbookpro3% terra resource add-ref git-repo --name=terra_ui --repo-url=git@github.com:verily-src/terra-ui.git
Successfully added referenced git repo.
Name:         terra_ui
Description:  
Type:         GIT_REPO
Stewardship:  REFERENCED
Cloning:      COPY_REFERENCE
Git repo Url: git@github.com:verily-src/terra-ui.git

@yuhuyoyo yuhuyoyo marked this pull request as ready for review July 27, 2022 14:47
@yuhuyoyo yuhuyoyo changed the title Alert user when there is no terra sshkey as they add a git repo reference [PF-1854] Alert user when there is no terra sshkey as they add a git repo reference Jul 27, 2022
@yuhuyoyo yuhuyoyo requested review from cbookg and melissachang July 27, 2022 14:57
Copy link
Contributor

@melissachang melissachang left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

+ "You must associate the new SSH public key with your GitHub account using "
+ "https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent. "
+ "Are you sure you want to proceed (y/N)?",
+ "https://github.com/settings/keys. Are you sure you want to proceed (y/N)?",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i thought it's more straightforward to just go to https://github.com/settings/keys to add your key? step 1 and 2 should be automatically covered by the notebook startup script.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, is adding a key to https://github.com/settings/keys the same as ssh-add -K ~/.ssh/id_ed25519 ? If so, SG, thanks

throw new UserActionableException(
"You do not have a Terra ssh key, cloning the git repo in the GCP notebook will"
+ " fail. Please run `terra user ssh-key generate` and store the output (public key) in"
+ " your GitHub account https://github.com/settings/keys.");
Copy link
Contributor

Choose a reason for hiding this comment

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

@DisplayName("list and describe reflect adding a new referenced git repo")
void listDescribeReflectAdd() throws IOException {
workspaceCreator.login();
TestCommand.runCommandExpectSuccess("user", "ssh-key", "generate", "--quiet");
Copy link
Contributor

Choose a reason for hiding this comment

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

// Generate ssh key to avoid prompt about ssh key

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.

3 participants