From 9a79011f8e62b60b0ed3d92d34ebbea92974a099 Mon Sep 17 00:00:00 2001 From: Bianca Date: Fri, 20 May 2022 12:44:20 +0100 Subject: [PATCH 1/4] Remove extra print statement --- internal/cli/atlas/quickstart/quick_start.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/cli/atlas/quickstart/quick_start.go b/internal/cli/atlas/quickstart/quick_start.go index 484536d927..9fdea8ab26 100644 --- a/internal/cli/atlas/quickstart/quick_start.go +++ b/internal/cli/atlas/quickstart/quick_start.go @@ -189,8 +189,6 @@ func (opts *Opts) Run() error { return er } - fmt.Print(quickstartTemplateCluster) - fmt.Print("Cluster created.") if err := opts.loadSampleData(); err != nil { From 065b59cdeb77744281e529690f15977c0702d4f6 Mon Sep 17 00:00:00 2001 From: Bianca Date: Fri, 20 May 2022 14:19:26 +0100 Subject: [PATCH 2/4] Design feedback --- .../cli/atlas/quickstart/confirm_cluster_setup.go | 2 +- .../cli/atlas/quickstart/confirm_default_setup.go | 5 +++-- internal/cli/atlas/quickstart/quick_start.go | 12 +++++++++--- internal/cli/auth/login.go | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/cli/atlas/quickstart/confirm_cluster_setup.go b/internal/cli/atlas/quickstart/confirm_cluster_setup.go index 7ef3afcda8..aa38d304cb 100644 --- a/internal/cli/atlas/quickstart/confirm_cluster_setup.go +++ b/internal/cli/atlas/quickstart/confirm_cluster_setup.go @@ -52,7 +52,7 @@ Cluster Disk Size (GiB): %.1f`, opts.Tier, diskSize) [Confirm cluster settings] Cluster Name: %s%s Cloud Provider and Region: %s -Database Username: %s +Database User Username: %s Allow connections from (IP Address): %s%s `, opts.ClusterName, diff --git a/internal/cli/atlas/quickstart/confirm_default_setup.go b/internal/cli/atlas/quickstart/confirm_default_setup.go index a9294fe1dc..6c75a1c634 100644 --- a/internal/cli/atlas/quickstart/confirm_default_setup.go +++ b/internal/cli/atlas/quickstart/confirm_default_setup.go @@ -47,10 +47,11 @@ Load sample data: Yes` Cluster Tier: %s Cluster Disk Size (GiB): %.1f`, opts.Tier, diskSize) } - fmt.Printf(`[Default Settings] + fmt.Printf(` +[Default Settings] Cluster Name: %s%s Cloud Provider and Region: %s -Database Username: %s +Database User Username: %s Allow connections from (IP Address): %s%s`, values.ClusterName, clusterTier+clusterDisk, diff --git a/internal/cli/atlas/quickstart/quick_start.go b/internal/cli/atlas/quickstart/quick_start.go index 9fdea8ab26..9ee1eaacf8 100644 --- a/internal/cli/atlas/quickstart/quick_start.go +++ b/internal/cli/atlas/quickstart/quick_start.go @@ -51,8 +51,8 @@ Enter 'atlas cluster watch %s' to learn when your cluster is available. const quickstartTemplateStoreWarning = ` Please store your database authentication access details in a secure location: -username: %s -password: %s +Database User Username: %s +Database User Password: %s ` const quickstartTemplateIntro = `Press [Enter] to use the default values. @@ -177,7 +177,8 @@ func (opts *Opts) Run() error { return err } - fmt.Printf(`We are deploying %s...`, opts.ClusterName) + fmt.Printf(`We are deploying %s... +`, opts.ClusterName) fmt.Printf(quickstartTemplateStoreWarning, opts.DBUsername, opts.DBUserPassword) opts.setupCloseHandler() @@ -198,6 +199,11 @@ func (opts *Opts) Run() error { if err := opts.askMongoShellQuestion(); err != nil { return err } + + // If user does not want to open MongoShell, skip everything below + if !opts.Confirm { + return nil + } // Get cluster's connection string cluster, err := opts.store.AtlasCluster(opts.ConfigProjectID(), opts.ClusterName) if err != nil { diff --git a/internal/cli/auth/login.go b/internal/cli/auth/login.go index e1838cc7f1..c478463d70 100644 --- a/internal/cli/auth/login.go +++ b/internal/cli/auth/login.go @@ -49,7 +49,7 @@ type LoginConfig interface { const ( AlreadyAuthenticatedMsg = "you are already authenticated with an API key (Public key: %s)" - AlreadyAuthenticatedEmailMsg = "you are already authenticated with an email (%s)" + AlreadyAuthenticatedEmailMsg = "you are already authenticated with an account (%s)" LoginWithProfileMsg = `run "atlas auth login --profile " to authenticate using your Atlas username and password on a new profile` LogoutToLoginAccountMsg = `run "atlas auth logout" first if you want to login with another Atlas account on the same Atlas CLI profile` ) From e8f9cbe02001748cd1e756de0c64a2bca05d6ce3 Mon Sep 17 00:00:00 2001 From: Bianca Date: Fri, 20 May 2022 15:41:39 +0100 Subject: [PATCH 3/4] Move snyk out of code_health --- build/ci/evergreen.yml | 12 ++++++++++-- internal/cli/atlas/quickstart/quick_start.go | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build/ci/evergreen.yml b/build/ci/evergreen.yml index afea1bfef7..9a03507aa3 100644 --- a/build/ci/evergreen.yml +++ b/build/ci/evergreen.yml @@ -348,7 +348,7 @@ tasks: - func: "install golangci-lint" - func: "lint" - name: snyk_scan - tags: ["code_health"] + tags: ["snyk"] commands: - func: "clone" - func: "install snyk" @@ -1339,6 +1339,14 @@ buildvariants: go_bin: "/opt/golang/go1.18/bin" tasks: - name: ".ops-manager-50" - + - name: snyk + display_name: "Snyk" + run_on: + - rhel80-small + expansions: + go_root: "/opt/golang/go1.18" + go_bin: "/opt/golang/go1.18/bin" + tasks: + - name: .snyk include: - filename: build/ci/release.yml diff --git a/internal/cli/atlas/quickstart/quick_start.go b/internal/cli/atlas/quickstart/quick_start.go index 9ee1eaacf8..459e874de1 100644 --- a/internal/cli/atlas/quickstart/quick_start.go +++ b/internal/cli/atlas/quickstart/quick_start.go @@ -201,7 +201,7 @@ func (opts *Opts) Run() error { } // If user does not want to open MongoShell, skip everything below - if !opts.Confirm { + if !opts.runMongoShell { return nil } // Get cluster's connection string From 65b9975f975aa1a688c42ba0d99a8d60236cca78 Mon Sep 17 00:00:00 2001 From: Bianca Date: Fri, 20 May 2022 15:47:29 +0100 Subject: [PATCH 4/4] Fix test --- internal/cli/atlas/quickstart/quick_start_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cli/atlas/quickstart/quick_start_test.go b/internal/cli/atlas/quickstart/quick_start_test.go index a3635fe63e..633e80ba56 100644 --- a/internal/cli/atlas/quickstart/quick_start_test.go +++ b/internal/cli/atlas/quickstart/quick_start_test.go @@ -56,6 +56,8 @@ func TestQuickstartOpts_Run(t *testing.T) { Confirm: true, } + opts.runMongoShell = true + projectIPAccessList := opts.newProjectIPAccessList() mockStore.