-
Notifications
You must be signed in to change notification settings - Fork 4
[PF-1854] Alert user when there is no terra sshkey as they add a git repo reference #292
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
base: main
Are you sure you want to change the base?
Changes from all commits
3f21a2d
f223b51
b15edf3
26c1947
91bfc5e
05acbaa
8ceff66
b67d4b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,8 +30,7 @@ protected void execute() { | |
| confirmationPrompt.confirmOrThrow( | ||
| "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://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)?", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this change? I followed 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 when I set up my key For me, it was helpful that cli printed 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| "Generating new SSH key is aborted"); | ||
| var ecmService = ExternalCredentialsManagerService.fromContext(); | ||
| var sshKeyPair = ecmService.generateSshKeyPair(SshKeyPairType.GITHUB); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,9 @@ static List<UFGitRepo> listGitRepoResourcesWithName(String resourceName) | |
| void listDescribeReflectAdd() throws IOException { | ||
| workspaceCreator.login(); | ||
|
|
||
| // Generate ssh key to avoid prompt about ssh key | ||
| TestCommand.runCommandExpectSuccess("user", "ssh-key", "generate", "--quiet"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. // Generate ssh key to avoid prompt about ssh key |
||
|
|
||
| // `terra workspace set --id=$id` | ||
| TestCommand.runCommandExpectSuccess("workspace", "set", "--id=" + getUserFacingId()); | ||
|
|
||
|
|
@@ -103,13 +106,8 @@ void resolve() throws IOException { | |
|
|
||
| // `terra resource add-ref git-repo --name=$name --repo-url=$repoUrl | ||
| String name = "resolve"; | ||
| TestCommand.runAndParseCommandExpectSuccess( | ||
| UFGitRepo.class, | ||
| "resource", | ||
| "add-ref", | ||
| "git-repo", | ||
| "--name=" + name, | ||
| "--repo-url=" + GIT_REPO_SSH_URL); | ||
| TestCommand.runCommandExpectSuccess( | ||
| "resource", "add-ref", "git-repo", "--name=" + name, "--repo-url=" + GIT_REPO_SSH_URL); | ||
|
|
||
| // `terra resource resolve --name=$name --format=json` | ||
| JSONObject resolved = | ||
|
|
@@ -130,13 +128,8 @@ void listReflectsDelete() throws IOException { | |
|
|
||
| // `terra resource add-ref git-repo --name=$name --repo-url=$repoUrl | ||
| String name = "listReflectsDelete"; | ||
| TestCommand.runAndParseCommandExpectSuccess( | ||
| UFGitRepo.class, | ||
| "resource", | ||
| "add-ref", | ||
| "git-repo", | ||
| "--name=" + name, | ||
| "--repo-url=" + GIT_REPO_SSH_URL); | ||
| TestCommand.runCommandExpectSuccess( | ||
| "resource", "add-ref", "git-repo", "--name=" + name, "--repo-url=" + GIT_REPO_SSH_URL); | ||
|
|
||
| // `terra resource delete --name=$name --format=json` | ||
| TestCommand.runCommandExpectSuccess("resource", "delete", "--name=" + name, "--quiet"); | ||
|
|
@@ -206,8 +199,7 @@ void updateIndividualProperties() throws IOException { | |
| // `terra resource add-ref git-repo --name=$name --repo-url=$repoUrl --description=$description` | ||
| String name = "updateIndividualProperties"; | ||
| String description = "updateDescription"; | ||
| TestCommand.runAndParseCommandExpectSuccess( | ||
| UFGitRepo.class, | ||
| TestCommand.runCommandExpectSuccess( | ||
| "resource", | ||
| "add-ref", | ||
| "git-repo", | ||
|
|
@@ -286,8 +278,7 @@ void updateMultipleOrNoProperties() throws IOException { | |
| // --repo-url=$gitUrl | ||
| String name = "updateMultipleOrNoProperties"; | ||
| String description = "updateDescription"; | ||
| TestCommand.runAndParseCommandExpectSuccess( | ||
| UFGitRepo.class, | ||
| TestCommand.runCommandExpectSuccess( | ||
| "resource", | ||
| "add-ref", | ||
| "git-repo", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought instructions were at 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 ?