From 5449ee1cda71313ce82fed8408d14edc1b355118 Mon Sep 17 00:00:00 2001 From: bote795 Date: Wed, 7 Jul 2021 11:01:40 -0500 Subject: [PATCH 01/28] fix typo for update --- messages/messages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/messages.go b/messages/messages.go index fc9593a62..fb16a67fa 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -12,7 +12,7 @@ var ( CLI_CURR_VERSION_DATE = CLI_CURR_VERSION + " (%s)" CLI_LATEST_VERSION = "Astro CLI Latest: %s" CLI_LATEST_VERSION_DATE = CLI_LATEST_VERSION + " (%s)" - CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" + CLI_INSTALL_CMD = "\t$ curl -sSL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" CLI_RUNNING_LATEST = "You are running the latest version." CLI_CHOOSE_WORKSPACE = "Please choose a workspace:" CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" From 6423b221213c6a632e126982474c4333e133f214 Mon Sep 17 00:00:00 2001 From: Julie Rutherford Date: Wed, 7 Jul 2021 12:36:00 -0700 Subject: [PATCH 02/28] Update message on upgrade no-op, add unit tests (#417) --- CHANGELOG.md | 2 + cmd/deployment_test.go | 47 ++++---- deployment/deployment.go | 20 ++-- deployment/deployment_test.go | 212 +++++++++++++++++++++++++--------- 4 files changed, 198 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ce51af05..7b209c934 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog All notable changes to this project will be documented in this file. +## [0.25.2] - 2021-06-23 +- Add error message for airflow upgrade no-op #3055 (#417) ## [0.23.1] - 2020-11-25 diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 4096e61fd..5a6d5af20 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -485,16 +485,22 @@ func TestDeploymentAirflowUpgradeCommand(t *testing.T) { testUtil.InitTestConfig() expectedOut := `The upgrade from Airflow 1.10.5 to 1.10.10 has been started. To complete this process, add an Airflow 1.10.10 image to your Dockerfile and deploy to Astronomer.` - okResponse := `{"data": { - "appConfig": {"nfsMountDagDeployment": false}, - "updateDeploymentAirflow": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.5", - "desiredAirflowVersion": "1.10.10" - } - } - }` + okResponse := `{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deployment": { + "id": "ckggzqj5f4157qtc9lescmehm", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + }, + "updateDeploymentAirflow": { + "id": "ckggzqj5f4157qtc9lescmehm", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ @@ -514,16 +520,17 @@ func TestDeploymentAirflowUpgradeCancelCommand(t *testing.T) { testUtil.InitTestConfig() expectedOut := `Airflow upgrade process has been successfully canceled. Your Deployment was not interrupted and you are still running Airflow 1.10.5.` - okResponse := `{"data": { - "appConfig": {"nfsMountDagDeployment": false}, - "deployment": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.5", - "desiredAirflowVersion": "1.10.10" - } - } - }` + okResponse := `{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deployment": { + "id": "ckggzqj5f4157qtc9lescmehm", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + } + } +}` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ diff --git a/deployment/deployment.go b/deployment/deployment.go index 2ecfd9e4c..2be14cad8 100644 --- a/deployment/deployment.go +++ b/deployment/deployment.go @@ -245,7 +245,6 @@ func AirflowUpgrade(id, desiredAirflowVersion string, client *houston.Client, ou } desiredAirflowVersion = selectedVersion } - err = meetsAirflowUpgradeReqs(deployment.AirflowVersion, desiredAirflowVersion) if err != nil { return err @@ -385,19 +384,26 @@ func meetsAirflowUpgradeReqs(airflowVersion string, desiredAirflowVersion string return err } + currentVersion, err := semver.NewVersion(airflowVersion) + if err != nil { + return err + } + + if currentVersion.Compare(desiredVersion) == 0 { + errorMessage := fmt.Sprintf("Error: You tried to set --desired-airflow-version to %s, but this Airflow Deployment "+ + "is already running %s. Please indicate a higher version of Airflow and try again.", desiredVersion, currentVersion) + return errors.New(errorMessage) + } + if airflowUpgradeVersion.Compare(desiredVersion) < 1 { minUpgrade, err := semver.NewVersion(minRequiredVersion) if err != nil { return err } - currentVersion, err := semver.NewVersion(airflowVersion) - if err != nil { - return err - } - if currentVersion.Compare(minUpgrade) < 0 { - errorMessage := fmt.Sprintf("Airflow 2.0 has breaking changes. To upgrade to Airflow 2.0, upgrade to %s first and make sure your DAGs and configs are 2.0 compatible", minRequiredVersion) + errorMessage := fmt.Sprintf("Airflow 2.0 has breaking changes. To upgrade to Airflow 2.0, upgrade to %s first "+ + "and make sure your DAGs and configs are 2.0 compatible.", minRequiredVersion) return errors.New(errorMessage) } } diff --git a/deployment/deployment_test.go b/deployment/deployment_test.go index 027d28f64..4b5ee87d7 100644 --- a/deployment/deployment_test.go +++ b/deployment/deployment_test.go @@ -427,15 +427,21 @@ func TestUpdateError(t *testing.T) { func TestAirflowUpgrade(t *testing.T) { testUtil.InitTestConfig() - okResponse := `{"data": { - "updateDeploymentAirflow": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.5", - "desiredAirflowVersion": "1.10.10" - } - } - }` + okResponse := `{ + "data": { + "deployment": { + "id": "ckbv818oa00r107606ywhoqtw", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + }, + "updateDeploymentAirflow": { + "id": "ckbv818oa00r107606ywhoqtw", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, @@ -451,7 +457,7 @@ func TestAirflowUpgrade(t *testing.T) { err := AirflowUpgrade(deploymentId, desiredAirflowVersion, api, buf) assert.NoError(t, err) expected := ` NAME DEPLOYMENT NAME ASTRO DEPLOYMENT ID AIRFLOW VERSION - test v ckggzqj5f4157qtc9lescmehm 1.10.5 + test v ckbv818oa00r107606ywhoqtw 1.10.5 The upgrade from Airflow 1.10.5 to 1.10.10 has been started. To complete this process, add an Airflow 1.10.10 image to your Dockerfile and deploy to Astronomer. To cancel, run: @@ -485,15 +491,16 @@ func TestAirflowUpgradeCancel(t *testing.T) { testUtil.InitTestConfig() deploymentId := "ckggzqj5f4157qtc9lescmehm" - okResponse := `{"data": { - "deployment": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.5", - "desiredAirflowVersion": "1.10.10" - } - } - }` + okResponse := `{ + "data": { + "deployment": { + "id": "ckggzqj5f4157qtc9lescmehm", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ @@ -529,17 +536,89 @@ func TestAirflowUpgradeCancelError(t *testing.T) { assert.Error(t, err, "API error (500):") } +func TestAirflowUpgradeEmptyDesiredVersion(t *testing.T) { + testUtil.InitTestConfig() + okResponse := `{ + "data": { + "deployment": { + "id": "ckbv818oa00r107606ywhoqtw", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + }, + "updateDeploymentAirflow": { + "id": "ckbv818oa00r107606ywhoqtw", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + }, + "deploymentConfig": { + "airflowVersions": [ + "1.10.7", + "1.10.10", + "1.10.12" + ]} + } + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewBufferString(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + deploymentId := "ckggzqj5f4157qtc9lescmehm" + desiredAirflowVersion := "" + + // mock os.Stdin for when prompted by getAirflowVersionSelection() + input := []byte("2") + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + _, err = w.Write(input) + if err != nil { + t.Error(err) + } + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + + buf := new(bytes.Buffer) + err = AirflowUpgrade(deploymentId, desiredAirflowVersion, api, buf) + t.Log(buf.String()) // Log the buffer so that this test is recognized by go test + + assert.NoError(t, err) + expected := `# AIRFLOW VERSION +1 1.10.7 +2 1.10.10 +3 1.10.12 + NAME DEPLOYMENT NAME ASTRO DEPLOYMENT ID AIRFLOW VERSION + test v ckbv818oa00r107606ywhoqtw 1.10.5 + +The upgrade from Airflow 1.10.5 to 1.10.10 has been started. To complete this process, add an Airflow 1.10.10 image to your Dockerfile and deploy to Astronomer. +To cancel, run: + $ astro deployment airflow upgrade --cancel + +` + assert.Equal(t, buf.String(), expected) +} + func Test_getDeployment(t *testing.T) { testUtil.InitTestConfig() - okResponse := `{"data": { - "deployment": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.5", - "desiredAirflowVersion": "1.10.10" - } - } - }` + okResponse := `{ + "data": { + "deployment": { + "id": "ckggzqj5f4157qtc9lescmehm", + "label": "test", + "airflowVersion": "1.10.5", + "desiredAirflowVersion": "1.10.10" + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, @@ -569,28 +648,28 @@ func Test_getDeploymentError(t *testing.T) { deploymentId := "ckbv818oa00r107606ywhoqtw" _, err := getDeployment(deploymentId, api) - assert.Error(t, err, "tes") + assert.Error(t, err, "test") } func Test_getAirflowVersionSelection(t *testing.T) { testUtil.InitTestConfig() - okResponse := `{"data": { - "deployment": { - "id": "ckggzqj5f4157qtc9lescmehm", - "label": "test", - "airflowVersion": "1.10.7", - "desiredAirflowVersion": "1.10.10" - }, - "deploymentConfig": { - "airflowVersions": [ - "1.10.7", - "1.10.10", - "1.10.12" - ] - } - } - } - }` + okResponse := `{ + "data": { + "deployment": { + "id": "ckggzqj5f4157qtc9lescmehm", + "label": "test", + "airflowVersion": "1.10.7", + "desiredAirflowVersion": "1.10.10" + }, + "deploymentConfig": { + "airflowVersions": [ + "1.10.7", + "1.10.10", + "1.10.12" + ]} + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, @@ -618,6 +697,7 @@ func Test_getAirflowVersionSelection(t *testing.T) { os.Stdin = r airflowVersion, err := getAirflowVersionSelection("1.10.7", api, buf) + t.Log(buf.String()) // Log the buffer so that this test is recognized by go test assert.NoError(t, err) assert.Equal(t, airflowVersion, "1.10.12") } @@ -644,6 +724,14 @@ func Test_meetsAirflowUpgradeReqs(t *testing.T) { desiredAirflowVersion := "2.0.0" err := meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) assert.Error(t, err) + assert.EqualError(t, err, "Airflow 2.0 has breaking changes. To upgrade to Airflow 2.0, upgrade to 1.10.14 "+ + "first and make sure your DAGs and configs are 2.0 compatible.") + + airflowVersion = "2.0.0" + err = meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) + assert.Error(t, err) + assert.EqualError(t, err, "Error: You tried to set --desired-airflow-version to 2.0.0, but this Airflow Deployment "+ + "is already running 2.0.0. Please indicate a higher version of Airflow and try again.") airflowVersion = "1.10.14" err = meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) @@ -653,6 +741,18 @@ func Test_meetsAirflowUpgradeReqs(t *testing.T) { desiredAirflowVersion = "1.10.10" err = meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) assert.NoError(t, err) + + airflowVersion = "-1.10.12" + desiredAirflowVersion = "2.0.0" + err = meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) + assert.Error(t, err) + assert.EqualError(t, err, "Invalid Semantic Version") + + airflowVersion = "1.10.12" + desiredAirflowVersion = "-2.0.0" + err = meetsAirflowUpgradeReqs(airflowVersion, desiredAirflowVersion) + assert.Error(t, err) + assert.EqualError(t, err, "Invalid Semantic Version") } func TestCheckNFSMountDagDeploymentError(t *testing.T) { @@ -671,16 +771,16 @@ func TestCheckNFSMountDagDeploymentError(t *testing.T) { func TestCheckNFSMountDagDeploymentSuccess(t *testing.T) { testUtil.InitTestConfig() okResponse := `{ - "data": { - "appConfig": { - "version": "0.15.1", - "baseDomain": "local.astronomer.io", - "smtpConfigured": true, - "manualReleaseNames": false, - "nfsMountDagDeployment": true - } - } -}` + "data": { + "appConfig": { + "version": "0.15.1", + "baseDomain": "local.astronomer.io", + "smtpConfigured": true, + "manualReleaseNames": false, + "nfsMountDagDeployment": true + } + } + }` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ From 934afbb203b9f353aa893775168ec33d689c7199 Mon Sep 17 00:00:00 2001 From: bote795 Date: Wed, 7 Jul 2021 15:11:37 -0500 Subject: [PATCH 03/28] add hard deployment and test --- cmd/deployment.go | 15 +- cmd/deployment_test.go | 34 ++ deployment/deployment.go | 4 +- deployment/deployment_test.go | 22 +- fmtcoverage.html | 901 ++++++++++++++++++++++++++++++++++ houston/queries.go | 10 +- messages/messages.go | 1 + 7 files changed, 981 insertions(+), 6 deletions(-) create mode 100644 fmtcoverage.html diff --git a/cmd/deployment.go b/cmd/deployment.go index 1a76be9c5..b9e8e5f86 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -1,11 +1,14 @@ package cmd import ( + "fmt" "io" "strings" "github.com/astronomer/astro-cli/deployment" "github.com/astronomer/astro-cli/houston" + "github.com/astronomer/astro-cli/messages" + "github.com/astronomer/astro-cli/pkg/input" sa "github.com/astronomer/astro-cli/serviceaccount" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -14,6 +17,7 @@ import ( var ( allDeployments bool cancel bool + hardDelete bool executor string deploymentId string desiredAirflowVersion string @@ -143,6 +147,7 @@ func newDeploymentDeleteCmd(client *houston.Client, out io.Writer) *cobra.Comman return deploymentDelete(cmd, args, client, out) }, } + cmd.Flags().BoolVar(&hardDelete, "hard", false, "This will permanently delete this resource") return cmd } @@ -409,8 +414,16 @@ func deploymentCreate(cmd *cobra.Command, args []string, client *houston.Client, func deploymentDelete(cmd *cobra.Command, args []string, client *houston.Client, out io.Writer) error { // Silence Usage as we have now validated command input cmd.SilenceUsage = true + if hardDelete { + i, _ := input.InputConfirm( + fmt.Sprintf(messages.CLI_DEPLOYMENT_HARD_DELETE_PROMPT)) - return deployment.Delete(args[0], client, out) + if !i { + fmt.Println("Not permanently deleting...") + hardDelete = false + } + } + return deployment.Delete(args[0], hardDelete, client, out) } func deploymentList(cmd *cobra.Command, args []string, client *houston.Client, out io.Writer) error { diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 4096e61fd..9b2f784c2 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -538,3 +538,37 @@ func TestDeploymentAirflowUpgradeCancelCommand(t *testing.T) { assert.NoError(t, err) assert.Contains(t, output, expectedOut) } + +func TestDeploymentDelete(t *testing.T){ + testUtil.InitTestConfig() + expectedOut := `Successfully deleted deployment` + okResponse := `{ + "data": { + "deleteDeployment": { + "id": "ckqh2dmzc43548h9hxzspysyi", + "type": "airflow", + "label": "test2", + "description": "", + "releaseName": "combusting-radiant-1610", + "version": "0.17.1", + "workspace": { + "id": "ckqh2d9zh40758h9h650gf8dc" + }, + "createdAt": "2021-06-28T20:19:03.193Z", + "updatedAt": "2021-07-07T18:16:52.118Z" + } + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + + _, output, err := executeCommandC(api, "deployment", "delete", "ckqh2dmzc43548h9hxzspysyi") + assert.NoError(t, err) + assert.Contains(t, output, expectedOut) +} diff --git a/deployment/deployment.go b/deployment/deployment.go index 2ecfd9e4c..aabdbd42a 100644 --- a/deployment/deployment.go +++ b/deployment/deployment.go @@ -135,10 +135,10 @@ func Create(label, ws, releaseName, cloudRole, executor, airflowVersion, dagDepl return nil } -func Delete(id string, client *houston.Client, out io.Writer) error { +func Delete(id string, hardDelete bool, client *houston.Client, out io.Writer) error { req := houston.Request{ Query: houston.DeploymentDeleteRequest, - Variables: map[string]interface{}{"deploymentId": id}, + Variables: map[string]interface{}{"deploymentId": id, "deploymentHardDelete": hardDelete}, } _, err := req.DoWithClient(client) diff --git a/deployment/deployment_test.go b/deployment/deployment_test.go index 027d28f64..4dcc0eb63 100644 --- a/deployment/deployment_test.go +++ b/deployment/deployment_test.go @@ -291,7 +291,27 @@ func TestDelete(t *testing.T) { deploymentId := "ckbv818oa00r107606ywhoqtw" buf := new(bytes.Buffer) - err := Delete(deploymentId, api, buf) + err := Delete(deploymentId, false, api, buf) + assert.NoError(t, err) + assert.Contains(t, buf.String(), "Successfully deleted deployment") +} + +func TestDeleteHard(t *testing.T) { + testUtil.InitTestConfig() + okResponse := `{"data":{"deleteDeployment":{"id":"ckbv818oa00r107606ywhoqtw"}}} +` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewBufferString(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + deploymentId := "ckbv818oa00r107606ywhoqtw" + + buf := new(bytes.Buffer) + err := Delete(deploymentId, true, api, buf) assert.NoError(t, err) assert.Contains(t, buf.String(), "Successfully deleted deployment") } diff --git a/fmtcoverage.html b/fmtcoverage.html new file mode 100644 index 000000000..302947823 --- /dev/null +++ b/fmtcoverage.html @@ -0,0 +1,901 @@ +mode: set +fmt/errors.go:17.52,23.25 6 1 +fmt/errors.go:28.2,29.12 2 1 +fmt/errors.go:23.25,25.3 1 1 +fmt/errors.go:25.8,27.3 1 1 +fmt/errors.go:37.36,39.2 1 1 +fmt/errors.go:41.36,43.2 1 1 +fmt/format.go:54.28,56.2 1 1 +fmt/format.go:58.33,61.2 2 1 +fmt/format.go:64.35,65.12 1 1 +fmt/format.go:68.2,72.23 4 1 +fmt/format.go:77.2,78.12 2 1 +fmt/format.go:82.2,83.25 2 1 +fmt/format.go:86.2,86.23 1 1 +fmt/format.go:65.12,67.3 1 1 +fmt/format.go:72.23,75.3 2 0 +fmt/format.go:78.12,80.3 1 1 +fmt/format.go:83.25,85.3 1 1 +fmt/format.go:90.29,91.33 1 1 +fmt/format.go:95.2,96.14 2 1 +fmt/format.go:91.33,94.3 2 1 +fmt/format.go:96.14,100.3 2 1 +fmt/format.go:100.8,104.3 2 1 +fmt/format.go:108.35,109.33 1 1 +fmt/format.go:113.2,114.14 2 1 +fmt/format.go:109.33,112.3 2 1 +fmt/format.go:114.14,118.3 2 1 +fmt/format.go:118.8,122.3 2 1 +fmt/format.go:126.34,127.7 1 1 +fmt/format.go:127.7,129.3 1 1 +fmt/format.go:129.8,131.3 1 1 +fmt/format.go:135.36,142.33 3 1 +fmt/format.go:152.2,155.62 2 1 +fmt/format.go:166.2,166.14 1 1 +fmt/format.go:172.2,176.15 4 1 +fmt/format.go:182.2,190.18 8 1 +fmt/format.go:142.33,146.23 3 1 +fmt/format.go:146.23,148.4 1 1 +fmt/format.go:155.62,164.3 8 1 +fmt/format.go:166.14,171.3 4 1 +fmt/format.go:176.15,180.3 3 1 +fmt/format.go:194.87,196.14 2 1 +fmt/format.go:200.2,203.35 2 1 +fmt/format.go:215.2,216.19 2 1 +fmt/format.go:236.2,239.14 2 1 +fmt/format.go:268.2,270.33 3 1 +fmt/format.go:276.2,276.13 1 1 +fmt/format.go:297.2,297.17 1 1 +fmt/format.go:304.2,304.14 1 1 +fmt/format.go:317.2,320.18 4 1 +fmt/format.go:196.14,198.3 1 1 +fmt/format.go:203.35,206.23 2 1 +fmt/format.go:206.23,209.4 1 1 +fmt/format.go:216.19,219.26 2 1 +fmt/format.go:219.26,225.4 5 1 +fmt/format.go:226.8,226.35 1 1 +fmt/format.go:226.35,228.36 2 1 +fmt/format.go:228.36,230.4 1 1 +fmt/format.go:240.10,241.15 1 1 +fmt/format.go:247.10,248.15 1 1 +fmt/format.go:253.9,254.14 1 1 +fmt/format.go:259.9,260.14 1 1 +fmt/format.go:265.10,266.43 1 0 +fmt/format.go:241.15,246.4 4 1 +fmt/format.go:248.15,252.4 3 1 +fmt/format.go:254.14,258.4 3 1 +fmt/format.go:260.14,264.4 3 1 +fmt/format.go:270.33,273.3 2 1 +fmt/format.go:276.13,277.15 1 1 +fmt/format.go:278.10,283.16 4 1 +fmt/format.go:284.10,285.21 1 1 +fmt/format.go:289.11,294.16 4 1 +fmt/format.go:285.21,288.5 2 1 +fmt/format.go:297.17,302.3 4 1 +fmt/format.go:304.14,307.3 2 1 +fmt/format.go:307.8,307.19 1 1 +fmt/format.go:307.19,310.3 2 1 +fmt/format.go:310.8,310.20 1 1 +fmt/format.go:310.20,313.3 2 1 +fmt/format.go:324.47,325.19 1 1 +fmt/format.go:334.2,334.10 1 1 +fmt/format.go:325.19,327.20 2 1 +fmt/format.go:327.20,329.13 2 1 +fmt/format.go:329.13,331.5 1 1 +fmt/format.go:338.41,339.19 1 1 +fmt/format.go:353.2,353.10 1 1 +fmt/format.go:339.19,341.27 2 1 +fmt/format.go:341.27,343.13 2 1 +fmt/format.go:346.4,347.29 2 1 +fmt/format.go:350.4,350.12 1 1 +fmt/format.go:343.13,345.5 1 1 +fmt/format.go:347.29,349.5 1 1 +fmt/format.go:357.30,360.2 2 1 +fmt/format.go:363.31,366.2 2 1 +fmt/format.go:369.57,371.14 2 1 +fmt/format.go:376.2,376.38 1 1 +fmt/format.go:380.2,381.15 2 1 +fmt/format.go:400.2,400.47 1 1 +fmt/format.go:404.2,405.13 2 1 +fmt/format.go:409.2,410.30 2 1 +fmt/format.go:427.2,429.46 2 1 +fmt/format.go:371.14,374.3 1 1 +fmt/format.go:376.38,378.3 1 1 +fmt/format.go:381.15,382.14 1 1 +fmt/format.go:382.14,384.15 1 1 +fmt/format.go:388.4,388.23 1 1 +fmt/format.go:384.15,386.5 1 1 +fmt/format.go:389.9,389.21 1 1 +fmt/format.go:389.21,392.4 1 1 +fmt/format.go:393.8,394.19 1 1 +fmt/format.go:397.3,397.9 1 1 +fmt/format.go:394.19,396.4 1 1 +fmt/format.go:400.47,402.3 1 1 +fmt/format.go:405.13,408.3 1 1 +fmt/format.go:410.30,411.23 1 1 +fmt/format.go:419.3,419.15 1 1 +fmt/format.go:425.3,425.49 1 1 +fmt/format.go:411.23,414.15 2 1 +fmt/format.go:414.15,417.5 1 1 +fmt/format.go:419.15,421.4 1 1 +fmt/format.go:421.9,423.4 1 1 +fmt/format.go:429.46,431.3 1 1 +fmt/format.go:435.39,437.2 1 1 +fmt/format.go:440.46,442.2 1 1 +fmt/format.go:447.30,449.40 2 1 +fmt/format.go:453.2,454.12 2 1 +fmt/format.go:449.40,452.3 2 1 +fmt/format.go:454.12,456.3 1 1 +fmt/format.go:456.8,458.3 1 1 +fmt/format.go:463.30,465.22 2 1 +fmt/format.go:468.2,470.16 3 1 +fmt/format.go:465.22,467.3 1 1 +fmt/format.go:475.31,477.22 2 1 +fmt/format.go:480.2,481.12 2 1 +fmt/format.go:477.22,479.3 1 1 +fmt/format.go:481.12,483.3 1 1 +fmt/format.go:483.8,485.3 1 1 +fmt/format.go:490.66,492.19 1 1 +fmt/format.go:496.2,497.36 2 1 +fmt/format.go:504.2,504.41 1 1 +fmt/format.go:509.2,509.36 1 1 +fmt/format.go:522.2,522.28 1 1 +fmt/format.go:579.2,579.29 1 1 +fmt/format.go:592.2,592.16 1 1 +fmt/format.go:492.19,494.3 1 1 +fmt/format.go:497.36,499.3 1 1 +fmt/format.go:499.8,501.3 1 1 +fmt/format.go:504.41,506.3 1 1 +fmt/format.go:509.36,513.43 3 1 +fmt/format.go:516.3,518.9 3 1 +fmt/format.go:513.43,515.4 1 1 +fmt/format.go:522.28,524.15 2 1 +fmt/format.go:535.3,541.33 5 1 +fmt/format.go:565.3,565.23 1 1 +fmt/format.go:572.3,572.18 1 1 +fmt/format.go:576.3,576.29 1 1 +fmt/format.go:525.27,528.20 2 1 +fmt/format.go:528.20,530.5 1 1 +fmt/format.go:541.33,542.18 1 1 +fmt/format.go:543.13,544.27 1 1 +fmt/format.go:545.18,547.18 2 1 +fmt/format.go:548.18,549.35 1 1 +fmt/format.go:554.5,554.16 1 1 +fmt/format.go:555.12,556.22 1 1 +fmt/format.go:560.5,560.24 1 1 +fmt/format.go:549.35,552.11 3 1 +fmt/format.go:556.22,558.6 1 1 +fmt/format.go:560.24,562.6 1 1 +fmt/format.go:565.23,567.38 1 1 +fmt/format.go:570.4,570.26 1 1 +fmt/format.go:567.38,569.5 1 1 +fmt/format.go:572.18,575.4 2 1 +fmt/format.go:579.29,582.49 1 1 +fmt/format.go:588.3,589.9 2 1 +fmt/format.go:582.49,587.4 4 1 +fmt/print.go:77.34,79.2 1 1 +fmt/print.go:81.40,83.2 1 1 +fmt/print.go:85.36,87.2 1 1 +fmt/print.go:89.37,90.23 1 1 +fmt/print.go:95.2,97.29 3 1 +fmt/print.go:100.2,101.15 2 1 +fmt/print.go:90.23,93.3 2 1 +fmt/print.go:97.29,99.3 1 0 +fmt/print.go:132.26,132.44 1 1 +fmt/print.go:136.23,143.2 6 1 +fmt/print.go:146.21,153.25 1 1 +fmt/print.go:157.2,161.15 5 1 +fmt/print.go:153.25,155.3 1 0 +fmt/print.go:164.41,164.79 1 1 +fmt/print.go:166.46,166.86 1 1 +fmt/print.go:168.31,169.11 1 1 +fmt/print.go:181.2,181.14 1 1 +fmt/print.go:170.11,171.21 1 1 +fmt/print.go:172.11,173.35 1 1 +fmt/print.go:174.11,175.37 1 1 +fmt/print.go:176.11,177.21 1 1 +fmt/print.go:178.11,179.20 1 1 +fmt/print.go:186.51,189.2 2 1 +fmt/print.go:193.57,196.2 2 1 +fmt/print.go:202.79,208.2 5 1 +fmt/print.go:212.65,214.2 1 1 +fmt/print.go:217.54,223.2 5 1 +fmt/print.go:230.63,236.2 5 1 +fmt/print.go:241.49,243.2 1 1 +fmt/print.go:247.38,253.2 5 1 +fmt/print.go:262.65,268.2 5 1 +fmt/print.go:273.51,275.2 1 1 +fmt/print.go:279.40,285.2 5 1 +fmt/print.go:290.53,292.53 2 1 +fmt/print.go:295.2,295.12 1 1 +fmt/print.go:292.53,294.3 1 1 +fmt/print.go:300.27,303.2 2 1 +fmt/print.go:306.73,307.18 1 1 +fmt/print.go:310.2,310.75 1 1 +fmt/print.go:317.2,317.8 1 1 +fmt/print.go:307.18,309.3 1 1 +fmt/print.go:310.75,311.20 1 1 +fmt/print.go:314.3,315.15 2 1 +fmt/print.go:311.20,313.4 1 1 +fmt/print.go:320.43,321.18 1 0 +fmt/print.go:325.2,327.22 3 0 +fmt/print.go:321.18,324.3 2 0 +fmt/print.go:330.33,335.9 5 1 +fmt/print.go:347.2,348.20 2 1 +fmt/print.go:336.20,339.25 3 1 +fmt/print.go:340.25,343.32 3 1 +fmt/print.go:344.10,345.36 1 1 +fmt/print.go:351.41,352.14 1 1 +fmt/print.go:353.16,354.22 1 1 +fmt/print.go:355.10,356.18 1 1 +fmt/print.go:362.48,367.2 4 1 +fmt/print.go:370.61,371.14 1 1 +fmt/print.go:372.11,373.32 1 1 +fmt/print.go:378.11,379.51 1 1 +fmt/print.go:380.11,381.50 1 1 +fmt/print.go:382.16,383.50 1 1 +fmt/print.go:384.11,385.51 1 1 +fmt/print.go:386.11,387.51 1 1 +fmt/print.go:388.11,389.16 1 1 +fmt/print.go:390.11,391.17 1 1 +fmt/print.go:392.11,393.22 1 1 +fmt/print.go:394.10,395.18 1 1 +fmt/print.go:373.32,375.4 1 1 +fmt/print.go:375.9,377.4 1 1 +fmt/print.go:401.55,402.14 1 1 +fmt/print.go:403.11,404.35 1 1 +fmt/print.go:405.31,406.36 1 1 +fmt/print.go:407.21,408.35 1 1 +fmt/print.go:409.11,410.34 1 1 +fmt/print.go:411.10,412.18 1 1 +fmt/print.go:419.60,422.14 1 1 +fmt/print.go:423.56,431.23 7 1 +fmt/print.go:432.10,433.18 1 1 +fmt/print.go:437.45,438.14 1 1 +fmt/print.go:439.11,440.19 1 1 +fmt/print.go:445.11,446.16 1 1 +fmt/print.go:447.11,448.26 1 1 +fmt/print.go:449.11,450.26 1 1 +fmt/print.go:451.11,452.16 1 1 +fmt/print.go:453.10,454.18 1 1 +fmt/print.go:440.19,442.4 1 1 +fmt/print.go:442.9,444.4 1 1 +fmt/print.go:458.63,459.14 1 1 +fmt/print.go:460.16,461.19 1 1 +fmt/print.go:485.11,486.17 1 1 +fmt/print.go:487.11,488.26 1 1 +fmt/print.go:489.11,490.26 1 1 +fmt/print.go:491.11,492.24 1 1 +fmt/print.go:493.10,494.44 1 1 +fmt/print.go:461.19,463.16 2 1 +fmt/print.go:467.4,468.24 2 1 +fmt/print.go:474.4,474.24 1 1 +fmt/print.go:463.16,466.5 2 1 +fmt/print.go:468.24,469.14 1 1 +fmt/print.go:472.5,472.31 1 1 +fmt/print.go:469.14,471.6 1 1 +fmt/print.go:475.9,477.24 2 1 +fmt/print.go:483.4,483.24 1 1 +fmt/print.go:477.24,478.14 1 1 +fmt/print.go:481.5,481.61 1 1 +fmt/print.go:478.14,480.6 1 1 +fmt/print.go:498.57,500.22 2 1 +fmt/print.go:508.2,508.14 1 1 +fmt/print.go:501.98,502.22 1 1 +fmt/print.go:503.10,505.9 2 1 +fmt/print.go:509.11,510.19 1 1 +fmt/print.go:527.11,528.37 1 1 +fmt/print.go:529.31,530.42 1 1 +fmt/print.go:531.10,532.18 1 1 +fmt/print.go:510.19,514.14 4 1 +fmt/print.go:519.4,519.24 1 1 +fmt/print.go:514.14,516.5 1 1 +fmt/print.go:516.10,518.5 1 1 +fmt/print.go:520.9,521.14 1 1 +fmt/print.go:521.14,523.5 1 1 +fmt/print.go:523.10,525.5 1 1 +fmt/print.go:536.68,537.34 1 1 +fmt/print.go:537.34,541.70 1 1 +fmt/print.go:547.3,547.18 1 1 +fmt/print.go:552.3,566.28 12 1 +fmt/print.go:541.70,544.4 2 1 +fmt/print.go:547.18,549.14 1 0 +fmt/print.go:570.54,571.16 1 1 +fmt/print.go:574.2,574.17 1 1 +fmt/print.go:590.2,590.44 1 1 +fmt/print.go:598.2,598.18 1 1 +fmt/print.go:631.2,631.14 1 1 +fmt/print.go:571.16,573.3 1 1 +fmt/print.go:574.17,578.48 2 1 +fmt/print.go:584.3,586.13 2 1 +fmt/print.go:578.48,583.4 4 1 +fmt/print.go:590.44,595.3 4 1 +fmt/print.go:598.18,599.45 1 1 +fmt/print.go:599.45,605.4 4 1 +fmt/print.go:606.8,610.15 1 1 +fmt/print.go:611.32,616.29 1 1 +fmt/print.go:617.15,621.11 4 1 +fmt/print.go:623.18,627.11 4 1 +fmt/print.go:634.51,638.16 3 1 +fmt/print.go:650.2,650.14 1 1 +fmt/print.go:660.2,660.25 1 1 +fmt/print.go:638.16,639.15 1 1 +fmt/print.go:645.3,645.9 1 1 +fmt/print.go:640.17,641.35 1 1 +fmt/print.go:642.11,643.19 1 1 +fmt/print.go:651.11,653.9 2 1 +fmt/print.go:654.11,656.9 2 1 +fmt/print.go:661.12,662.21 1 1 +fmt/print.go:663.15,664.35 1 1 +fmt/print.go:665.15,666.26 1 1 +fmt/print.go:667.17,668.40 1 1 +fmt/print.go:669.18,670.29 1 1 +fmt/print.go:671.11,672.40 1 1 +fmt/print.go:673.12,674.40 1 1 +fmt/print.go:675.13,676.40 1 1 +fmt/print.go:677.13,678.40 1 1 +fmt/print.go:679.13,680.40 1 1 +fmt/print.go:681.12,682.42 1 1 +fmt/print.go:683.13,684.42 1 1 +fmt/print.go:685.14,686.42 1 1 +fmt/print.go:687.14,688.42 1 1 +fmt/print.go:689.14,690.34 1 1 +fmt/print.go:691.15,692.42 1 1 +fmt/print.go:693.14,694.23 1 1 +fmt/print.go:695.14,696.32 1 1 +fmt/print.go:697.21,700.38 1 1 +fmt/print.go:706.3,706.27 1 1 +fmt/print.go:707.10,709.29 1 1 +fmt/print.go:700.38,702.29 2 1 +fmt/print.go:702.29,704.5 1 1 +fmt/print.go:709.29,713.4 1 1 +fmt/print.go:719.68,721.58 1 1 +fmt/print.go:727.2,730.34 3 1 +fmt/print.go:721.58,723.28 2 1 +fmt/print.go:723.28,725.4 1 1 +fmt/print.go:731.23,732.17 1 1 +fmt/print.go:742.20,743.28 1 1 +fmt/print.go:744.78,745.46 1 1 +fmt/print.go:746.100,747.41 1 1 +fmt/print.go:748.23,749.34 1 1 +fmt/print.go:750.23,751.34 1 1 +fmt/print.go:752.25,753.38 1 1 +fmt/print.go:754.26,755.39 1 1 +fmt/print.go:756.22,757.32 1 1 +fmt/print.go:758.19,759.19 1 1 +fmt/print.go:769.3,770.34 2 1 +fmt/print.go:782.3,782.19 1 1 +fmt/print.go:787.22,788.19 1 1 +fmt/print.go:791.3,792.37 2 1 +fmt/print.go:808.3,808.23 1 1 +fmt/print.go:809.25,811.23 2 1 +fmt/print.go:821.36,822.15 1 1 +fmt/print.go:845.3,845.19 1 1 +fmt/print.go:869.19,872.37 1 1 +fmt/print.go:880.3,880.14 1 1 +fmt/print.go:881.57,882.24 1 1 +fmt/print.go:883.10,884.19 1 0 +fmt/print.go:732.17,734.4 1 1 +fmt/print.go:734.9,735.16 1 0 +fmt/print.go:736.13,737.38 1 0 +fmt/print.go:738.12,739.20 1 0 +fmt/print.go:759.19,761.17 2 1 +fmt/print.go:765.4,765.24 1 1 +fmt/print.go:761.17,764.5 2 1 +fmt/print.go:766.9,768.4 1 1 +fmt/print.go:770.34,771.13 1 1 +fmt/print.go:778.4,780.48 3 1 +fmt/print.go:771.13,772.21 1 1 +fmt/print.go:772.21,774.6 1 1 +fmt/print.go:774.11,776.6 1 1 +fmt/print.go:782.19,784.4 1 1 +fmt/print.go:784.9,786.4 1 1 +fmt/print.go:788.19,790.4 1 1 +fmt/print.go:792.37,793.13 1 1 +fmt/print.go:800.4,800.35 1 1 +fmt/print.go:806.4,806.47 1 1 +fmt/print.go:793.13,794.21 1 1 +fmt/print.go:794.21,796.6 1 1 +fmt/print.go:796.11,798.6 1 1 +fmt/print.go:800.35,801.51 1 1 +fmt/print.go:801.51,804.6 2 1 +fmt/print.go:811.23,812.20 1 1 +fmt/print.go:812.20,815.5 2 1 +fmt/print.go:815.10,817.5 1 1 +fmt/print.go:818.9,820.4 1 1 +fmt/print.go:823.27,826.40 2 1 +fmt/print.go:826.40,828.34 2 1 +fmt/print.go:841.5,842.11 2 1 +fmt/print.go:828.34,830.6 1 1 +fmt/print.go:830.11,830.27 1 1 +fmt/print.go:830.27,832.6 1 1 +fmt/print.go:832.11,837.27 2 1 +fmt/print.go:837.27,839.7 1 1 +fmt/print.go:845.19,847.46 2 1 +fmt/print.go:851.4,852.33 2 1 +fmt/print.go:858.4,858.24 1 1 +fmt/print.go:847.46,850.5 2 1 +fmt/print.go:852.33,853.14 1 1 +fmt/print.go:856.5,856.44 1 1 +fmt/print.go:853.14,855.6 1 1 +fmt/print.go:859.9,861.33 2 1 +fmt/print.go:867.4,867.24 1 1 +fmt/print.go:861.33,862.14 1 1 +fmt/print.go:865.5,865.44 1 1 +fmt/print.go:862.14,864.6 1 1 +fmt/print.go:872.37,873.35 1 1 +fmt/print.go:874.67,877.11 3 1 +fmt/print.go:889.83,891.21 2 1 +fmt/print.go:918.2,918.8 1 1 +fmt/print.go:891.21,893.13 2 1 +fmt/print.go:912.3,913.20 2 1 +fmt/print.go:893.13,895.53 1 1 +fmt/print.go:896.80,898.27 2 1 +fmt/print.go:902.102,904.45 2 1 +fmt/print.go:908.12,908.12 0 1 +fmt/print.go:898.27,901.6 2 1 +fmt/print.go:904.45,907.6 2 1 +fmt/print.go:913.20,916.4 2 1 +fmt/print.go:927.66,929.21 1 1 +fmt/print.go:934.2,934.35 1 1 +fmt/print.go:943.2,943.20 1 0 +fmt/print.go:929.21,931.3 1 1 +fmt/print.go:934.35,935.23 1 1 +fmt/print.go:935.23,937.24 2 1 +fmt/print.go:940.4,940.33 1 1 +fmt/print.go:937.24,939.5 1 1 +fmt/print.go:949.105,950.42 1 1 +fmt/print.go:953.2,955.41 3 1 +fmt/print.go:958.2,959.28 2 1 +fmt/print.go:950.42,952.3 1 1 +fmt/print.go:955.41,957.3 1 1 +fmt/print.go:962.35,966.2 3 1 +fmt/print.go:968.36,972.2 3 1 +fmt/print.go:974.55,980.23 5 1 +fmt/print.go:1130.2,1130.37 1 1 +fmt/print.go:980.23,983.35 3 1 +fmt/print.go:986.3,986.16 1 1 +fmt/print.go:989.3,989.15 1 1 +fmt/print.go:995.3,1000.22 3 1 +fmt/print.go:1037.3,1040.34 2 1 +fmt/print.go:1064.3,1064.36 1 1 +fmt/print.go:1091.3,1091.18 1 1 +fmt/print.go:1095.3,1095.15 1 1 +fmt/print.go:1100.3,1101.28 2 1 +fmt/print.go:1104.3,1106.10 2 1 +fmt/print.go:983.35,985.4 1 1 +fmt/print.go:986.16,988.4 1 1 +fmt/print.go:989.15,991.9 1 1 +fmt/print.go:1000.22,1002.13 2 1 +fmt/print.go:1003.13,1004.23 1 1 +fmt/print.go:1005.13,1006.30 1 1 +fmt/print.go:1007.13,1008.22 1 1 +fmt/print.go:1009.13,1011.23 2 1 +fmt/print.go:1012.13,1013.23 1 1 +fmt/print.go:1014.12,1017.48 1 1 +fmt/print.go:1032.5,1032.23 1 1 +fmt/print.go:1017.48,1018.18 1 1 +fmt/print.go:1026.6,1029.25 4 1 +fmt/print.go:1018.18,1025.7 4 1 +fmt/print.go:1040.34,1044.25 3 1 +fmt/print.go:1050.4,1050.21 1 1 +fmt/print.go:1055.4,1055.22 1 1 +fmt/print.go:1044.25,1046.5 1 1 +fmt/print.go:1050.21,1054.5 3 1 +fmt/print.go:1056.9,1058.38 2 1 +fmt/print.go:1058.38,1060.5 1 1 +fmt/print.go:1064.36,1066.18 2 1 +fmt/print.go:1069.4,1070.35 2 1 +fmt/print.go:1066.18,1068.5 1 1 +fmt/print.go:1070.35,1074.23 3 1 +fmt/print.go:1078.5,1078.27 1 1 +fmt/print.go:1081.5,1081.23 1 1 +fmt/print.go:1074.23,1077.6 2 1 +fmt/print.go:1078.27,1080.6 1 1 +fmt/print.go:1082.10,1084.27 2 1 +fmt/print.go:1084.27,1087.6 2 1 +fmt/print.go:1091.18,1093.4 1 1 +fmt/print.go:1095.15,1097.9 2 1 +fmt/print.go:1101.28,1103.4 1 1 +fmt/print.go:1107.20,1108.24 1 1 +fmt/print.go:1109.22,1110.21 1 1 +fmt/print.go:1111.25,1112.22 1 1 +fmt/print.go:1113.20,1120.15 5 1 +fmt/print.go:1121.11,1123.12 2 1 +fmt/print.go:1130.37,1133.34 3 1 +fmt/print.go:1145.3,1145.23 1 1 +fmt/print.go:1133.34,1134.13 1 1 +fmt/print.go:1137.4,1137.18 1 1 +fmt/print.go:1134.13,1136.5 1 0 +fmt/print.go:1137.18,1139.5 1 1 +fmt/print.go:1139.10,1143.5 3 1 +fmt/print.go:1149.39,1151.29 2 1 +fmt/print.go:1151.29,1154.45 2 1 +fmt/print.go:1157.3,1158.24 2 1 +fmt/print.go:1154.45,1156.4 1 1 +fmt/print.go:1164.41,1165.29 1 1 +fmt/print.go:1171.2,1171.23 1 1 +fmt/print.go:1165.29,1166.17 1 1 +fmt/print.go:1169.3,1169.23 1 1 +fmt/print.go:1166.17,1168.4 1 1 +fmt/scan.go:63.48,65.2 1 0 +fmt/scan.go:69.50,71.2 1 0 +fmt/scan.go:80.64,82.2 1 0 +fmt/scan.go:86.58,89.12 3 1 +fmt/scan.go:92.2,92.8 1 1 +fmt/scan.go:89.12,91.3 1 1 +fmt/scan.go:99.61,101.2 1 1 +fmt/scan.go:105.63,107.2 1 1 +fmt/scan.go:113.77,115.2 1 1 +fmt/scan.go:121.62,126.2 4 1 +fmt/scan.go:130.64,135.2 4 1 +fmt/scan.go:141.78,146.2 4 1 +fmt/scan.go:179.50,181.2 1 0 +fmt/scan.go:183.55,184.38 1 1 +fmt/scan.go:189.2,190.16 2 1 +fmt/scan.go:198.2,198.8 1 1 +fmt/scan.go:184.38,187.3 2 1 +fmt/scan.go:190.16,192.29 2 1 +fmt/scan.go:192.29,194.4 1 1 +fmt/scan.go:195.8,195.26 1 1 +fmt/scan.go:195.26,197.3 1 1 +fmt/scan.go:201.41,202.25 1 0 +fmt/scan.go:205.2,205.23 1 0 +fmt/scan.go:202.25,204.3 1 0 +fmt/scan.go:210.33,212.16 2 1 +fmt/scan.go:218.2,218.8 1 1 +fmt/scan.go:212.16,213.20 1 1 +fmt/scan.go:216.3,216.15 1 0 +fmt/scan.go:213.20,215.4 1 1 +fmt/scan.go:224.38,226.14 2 1 +fmt/scan.go:229.2,229.8 1 1 +fmt/scan.go:226.14,228.3 1 1 +fmt/scan.go:232.33,237.2 4 1 +fmt/scan.go:239.31,240.23 1 1 +fmt/scan.go:243.38,244.35 1 1 +fmt/scan.go:247.79,248.15 1 1 +fmt/scan.go:257.2,257.14 1 1 +fmt/scan.go:260.2,262.8 3 1 +fmt/scan.go:248.15,249.31 1 1 +fmt/scan.go:249.31,250.35 1 0 +fmt/scan.go:250.35,252.5 1 0 +fmt/scan.go:252.10,253.13 1 0 +fmt/scan.go:257.14,259.3 1 1 +fmt/scan.go:280.27,281.16 1 1 +fmt/scan.go:284.2,285.28 2 1 +fmt/scan.go:293.2,293.14 1 1 +fmt/scan.go:281.16,283.3 1 1 +fmt/scan.go:285.28,286.18 1 1 +fmt/scan.go:289.3,289.19 1 1 +fmt/scan.go:286.18,288.4 1 1 +fmt/scan.go:289.19,291.4 1 1 +fmt/scan.go:297.28,299.2 1 1 +fmt/scan.go:314.51,315.19 1 1 +fmt/scan.go:321.2,322.12 2 1 +fmt/scan.go:325.2,325.26 1 1 +fmt/scan.go:315.19,320.3 4 1 +fmt/scan.go:322.12,324.3 1 1 +fmt/scan.go:330.62,331.21 1 1 +fmt/scan.go:337.2,338.16 2 1 +fmt/scan.go:341.2,341.30 1 1 +fmt/scan.go:348.2,349.44 2 1 +fmt/scan.go:359.2,360.14 2 1 +fmt/scan.go:365.2,366.8 2 1 +fmt/scan.go:331.21,336.3 4 1 +fmt/scan.go:338.16,340.3 1 1 +fmt/scan.go:341.30,347.3 4 1 +fmt/scan.go:349.44,351.17 2 1 +fmt/scan.go:351.17,352.21 1 1 +fmt/scan.go:356.4,356.10 1 0 +fmt/scan.go:352.21,354.10 2 1 +fmt/scan.go:360.14,363.3 2 1 +fmt/scan.go:369.39,370.21 1 1 +fmt/scan.go:374.2,375.12 2 1 +fmt/scan.go:370.21,372.3 1 0 +fmt/scan.go:379.26,379.44 1 1 +fmt/scan.go:383.76,385.38 2 1 +fmt/scan.go:390.2,398.8 9 1 +fmt/scan.go:385.38,387.3 1 1 +fmt/scan.go:387.8,389.3 1 1 +fmt/scan.go:402.30,404.19 1 1 +fmt/scan.go:409.2,409.23 1 1 +fmt/scan.go:412.2,414.15 3 1 +fmt/scan.go:404.19,407.3 2 0 +fmt/scan.go:409.23,411.3 1 0 +fmt/scan.go:420.26,421.6 1 1 +fmt/scan.go:421.6,423.15 2 1 +fmt/scan.go:426.3,426.32 1 1 +fmt/scan.go:429.3,429.16 1 1 +fmt/scan.go:436.3,436.18 1 1 +fmt/scan.go:423.15,425.4 1 1 +fmt/scan.go:426.32,427.12 1 0 +fmt/scan.go:429.16,430.19 1 1 +fmt/scan.go:433.4,434.10 2 1 +fmt/scan.go:430.19,431.13 1 1 +fmt/scan.go:436.18,438.9 2 1 +fmt/scan.go:446.62,447.15 1 1 +fmt/scan.go:451.2,451.6 1 1 +fmt/scan.go:462.2,462.14 1 1 +fmt/scan.go:447.15,449.3 1 1 +fmt/scan.go:451.6,453.15 2 1 +fmt/scan.go:456.3,456.12 1 1 +fmt/scan.go:460.3,460.21 1 1 +fmt/scan.go:453.15,454.9 1 1 +fmt/scan.go:456.12,458.9 2 1 +fmt/scan.go:468.38,469.22 1 1 +fmt/scan.go:474.2,474.11 1 1 +fmt/scan.go:469.22,470.13 1 1 +fmt/scan.go:470.13,472.4 1 1 +fmt/scan.go:479.51,481.14 2 1 +fmt/scan.go:484.2,484.27 1 1 +fmt/scan.go:490.2,490.24 1 1 +fmt/scan.go:493.2,493.14 1 1 +fmt/scan.go:481.14,483.3 1 1 +fmt/scan.go:484.27,485.13 1 1 +fmt/scan.go:488.3,488.14 1 1 +fmt/scan.go:485.13,487.4 1 1 +fmt/scan.go:490.24,492.3 1 1 +fmt/scan.go:497.35,499.14 2 1 +fmt/scan.go:502.2,502.30 1 1 +fmt/scan.go:499.14,501.3 1 1 +fmt/scan.go:505.23,507.32 1 1 +fmt/scan.go:510.2,510.16 1 1 +fmt/scan.go:507.32,508.16 1 1 +fmt/scan.go:515.37,517.2 1 1 +fmt/scan.go:520.58,521.28 1 1 +fmt/scan.go:526.2,527.14 2 1 +fmt/scan.go:521.28,522.16 1 1 +fmt/scan.go:522.16,524.4 1 1 +fmt/scan.go:531.39,534.38 3 1 +fmt/scan.go:538.2,538.21 1 1 +fmt/scan.go:554.2,554.14 1 0 +fmt/scan.go:534.38,536.3 1 0 +fmt/scan.go:539.11,540.15 1 0 +fmt/scan.go:541.11,542.14 1 0 +fmt/scan.go:543.16,544.61 1 1 +fmt/scan.go:547.3,547.14 1 1 +fmt/scan.go:548.16,549.80 1 1 +fmt/scan.go:552.3,552.15 1 1 +fmt/scan.go:544.61,546.4 1 0 +fmt/scan.go:549.80,551.4 1 0 +fmt/scan.go:569.59,573.14 4 1 +fmt/scan.go:584.2,584.8 1 1 +fmt/scan.go:574.11,576.24 2 1 +fmt/scan.go:577.11,579.23 2 1 +fmt/scan.go:580.21,582.29 2 1 +fmt/scan.go:588.64,589.17 1 1 +fmt/scan.go:595.2,595.23 1 1 +fmt/scan.go:597.2,597.22 1 1 +fmt/scan.go:589.17,591.24 2 1 +fmt/scan.go:591.24,593.4 1 0 +fmt/scan.go:595.24,596.3 0 1 +fmt/scan.go:601.42,606.19 5 1 +fmt/scan.go:609.2,609.17 1 1 +fmt/scan.go:606.19,608.3 1 1 +fmt/scan.go:615.73,616.18 1 1 +fmt/scan.go:619.2,621.9 2 1 +fmt/scan.go:616.18,618.3 1 1 +fmt/scan.go:622.20,624.37 2 1 +fmt/scan.go:625.20,627.36 2 1 +fmt/scan.go:628.20,630.42 2 1 +fmt/scan.go:631.10,632.36 1 1 +fmt/scan.go:638.52,639.17 1 1 +fmt/scan.go:642.2,646.17 5 1 +fmt/scan.go:656.2,658.16 3 1 +fmt/scan.go:661.2,663.12 3 1 +fmt/scan.go:666.2,666.10 1 1 +fmt/scan.go:639.17,641.3 1 1 +fmt/scan.go:646.17,647.55 1 1 +fmt/scan.go:647.55,649.4 1 0 +fmt/scan.go:650.8,652.18 2 1 +fmt/scan.go:652.18,654.4 1 1 +fmt/scan.go:658.16,660.3 1 0 +fmt/scan.go:663.12,665.3 1 1 +fmt/scan.go:671.54,672.17 1 1 +fmt/scan.go:675.2,679.17 5 1 +fmt/scan.go:686.2,688.16 3 1 +fmt/scan.go:691.2,693.12 3 1 +fmt/scan.go:696.2,696.10 1 1 +fmt/scan.go:672.17,674.3 1 1 +fmt/scan.go:679.17,680.55 1 1 +fmt/scan.go:680.55,682.4 1 0 +fmt/scan.go:683.8,683.24 1 1 +fmt/scan.go:683.24,685.3 1 1 +fmt/scan.go:688.16,690.3 1 0 +fmt/scan.go:693.12,695.3 1 1 +fmt/scan.go:702.34,705.56 2 1 +fmt/scan.go:709.2,711.56 2 1 +fmt/scan.go:714.2,716.37 3 1 +fmt/scan.go:721.2,721.23 1 1 +fmt/scan.go:724.2,724.22 1 1 +fmt/scan.go:730.2,730.19 1 1 +fmt/scan.go:737.2,737.22 1 1 +fmt/scan.go:705.56,707.3 1 1 +fmt/scan.go:711.56,713.3 1 1 +fmt/scan.go:716.37,719.3 2 1 +fmt/scan.go:721.24,722.3 0 1 +fmt/scan.go:724.22,726.24 1 1 +fmt/scan.go:726.25,727.4 0 1 +fmt/scan.go:730.19,734.37 2 1 +fmt/scan.go:734.38,735.4 0 1 +fmt/scan.go:743.50,749.21 4 1 +fmt/scan.go:753.2,755.20 3 1 +fmt/scan.go:758.2,758.30 1 1 +fmt/scan.go:761.2,761.30 1 1 +fmt/scan.go:749.21,751.3 1 0 +fmt/scan.go:755.20,757.3 1 0 +fmt/scan.go:758.30,760.3 1 0 +fmt/scan.go:764.26,765.30 1 1 +fmt/scan.go:770.2,770.14 1 1 +fmt/scan.go:765.30,766.33 1 1 +fmt/scan.go:766.33,768.4 1 1 +fmt/scan.go:774.54,778.52 1 1 +fmt/scan.go:799.2,800.16 2 1 +fmt/scan.go:803.2,803.10 1 1 +fmt/scan.go:778.52,782.17 2 1 +fmt/scan.go:789.3,790.17 2 1 +fmt/scan.go:797.3,797.26 1 1 +fmt/scan.go:782.17,784.44 1 0 +fmt/scan.go:787.4,787.16 1 0 +fmt/scan.go:784.44,786.5 1 0 +fmt/scan.go:790.17,792.44 1 0 +fmt/scan.go:795.4,795.16 1 0 +fmt/scan.go:792.44,794.5 1 0 +fmt/scan.go:800.16,802.3 1 1 +fmt/scan.go:810.55,811.44 1 1 +fmt/scan.go:814.2,819.28 6 1 +fmt/scan.go:811.44,813.3 1 0 +fmt/scan.go:824.52,825.40 1 1 +fmt/scan.go:828.2,830.14 3 1 +fmt/scan.go:838.2,838.8 1 1 +fmt/scan.go:825.40,827.3 1 0 +fmt/scan.go:831.11,832.25 1 1 +fmt/scan.go:833.16,834.22 1 1 +fmt/scan.go:835.10,836.40 1 1 +fmt/scan.go:842.36,845.15 3 1 +fmt/scan.go:879.2,879.11 1 0 +fmt/scan.go:846.11,848.7 1 1 +fmt/scan.go:855.3,855.23 1 1 +fmt/scan.go:856.11,859.7 2 1 +fmt/scan.go:871.3,872.17 2 1 +fmt/scan.go:875.3,875.16 1 1 +fmt/scan.go:876.10,877.42 1 0 +fmt/scan.go:848.7,850.18 2 1 +fmt/scan.go:853.4,853.22 1 1 +fmt/scan.go:850.18,851.10 1 1 +fmt/scan.go:859.7,862.17 3 1 +fmt/scan.go:862.17,867.5 1 1 +fmt/scan.go:867.10,867.23 1 1 +fmt/scan.go:867.23,868.10 1 1 +fmt/scan.go:872.17,874.4 1 0 +fmt/scan.go:883.35,885.15 2 1 +fmt/scan.go:893.2,893.18 1 1 +fmt/scan.go:886.56,887.27 1 1 +fmt/scan.go:888.36,889.32 1 1 +fmt/scan.go:890.36,891.32 1 1 +fmt/scan.go:899.42,901.18 2 1 +fmt/scan.go:904.2,905.9 2 1 +fmt/scan.go:909.2,910.9 2 1 +fmt/scan.go:914.2,914.39 1 1 +fmt/scan.go:901.18,903.3 1 1 +fmt/scan.go:905.9,908.3 2 1 +fmt/scan.go:910.9,913.3 2 1 +fmt/scan.go:918.33,920.6 2 1 +fmt/scan.go:927.2,927.21 1 1 +fmt/scan.go:931.2,931.22 1 1 +fmt/scan.go:920.6,922.10 2 1 +fmt/scan.go:925.3,925.21 1 1 +fmt/scan.go:922.10,923.9 1 1 +fmt/scan.go:927.21,930.3 2 0 +fmt/scan.go:944.28,947.20 3 1 +fmt/scan.go:947.20,949.3 1 1 +fmt/scan.go:953.50,957.32 3 1 +fmt/scan.go:968.2,968.25 1 1 +fmt/scan.go:957.32,959.17 2 1 +fmt/scan.go:965.3,965.9 1 1 +fmt/scan.go:959.17,960.21 1 1 +fmt/scan.go:963.4,963.16 1 1 +fmt/scan.go:960.21,962.5 1 1 +fmt/scan.go:969.13,970.24 1 1 +fmt/scan.go:971.18,972.42 1 1 +fmt/scan.go:973.19,974.32 1 1 +fmt/scan.go:975.12,976.37 1 1 +fmt/scan.go:977.13,978.32 1 1 +fmt/scan.go:979.14,980.34 1 1 +fmt/scan.go:981.14,982.34 1 1 +fmt/scan.go:983.14,984.27 1 1 +fmt/scan.go:985.13,986.39 1 1 +fmt/scan.go:987.14,988.34 1 1 +fmt/scan.go:989.15,990.36 1 1 +fmt/scan.go:991.15,992.36 1 1 +fmt/scan.go:993.15,994.28 1 1 +fmt/scan.go:995.16,996.46 1 0 +fmt/scan.go:999.16,1000.44 1 1 +fmt/scan.go:1005.16,1006.44 1 1 +fmt/scan.go:1011.15,1012.29 1 1 +fmt/scan.go:1013.15,1016.37 1 1 +fmt/scan.go:1017.10,1020.32 3 1 +fmt/scan.go:1024.3,1024.36 1 1 +fmt/scan.go:1000.44,1004.4 3 1 +fmt/scan.go:1006.44,1010.4 3 1 +fmt/scan.go:1020.32,1023.4 2 1 +fmt/scan.go:1025.21,1026.31 1 1 +fmt/scan.go:1027.79,1028.46 1 1 +fmt/scan.go:1029.101,1030.48 1 1 +fmt/scan.go:1031.23,1032.38 1 1 +fmt/scan.go:1033.22,1036.42 2 1 +fmt/scan.go:1039.4,1041.34 3 1 +fmt/scan.go:1044.41,1047.63 3 1 +fmt/scan.go:1048.46,1049.54 1 1 +fmt/scan.go:1050.11,1051.60 1 0 +fmt/scan.go:1036.42,1038.5 1 0 +fmt/scan.go:1041.34,1043.5 1 1 +fmt/scan.go:1057.32,1058.30 1 1 +fmt/scan.go:1058.30,1059.34 1 1 +fmt/scan.go:1059.34,1061.4 1 1 +fmt/scan.go:1061.9,1061.55 1 1 +fmt/scan.go:1061.55,1063.4 1 1 +fmt/scan.go:1063.9,1064.12 1 0 +fmt/scan.go:1070.68,1072.24 2 1 +fmt/scan.go:1077.2,1077.15 1 1 +fmt/scan.go:1089.2,1089.8 1 1 +fmt/scan.go:1072.24,1075.3 2 1 +fmt/scan.go:1077.15,1078.7 1 1 +fmt/scan.go:1078.7,1080.29 2 1 +fmt/scan.go:1083.4,1083.19 1 1 +fmt/scan.go:1080.29,1081.10 1 1 +fmt/scan.go:1083.19,1085.10 2 1 +fmt/scan.go:1100.45,1101.22 1 1 +fmt/scan.go:1176.2,1176.8 1 1 +fmt/scan.go:1101.22,1110.20 2 1 +fmt/scan.go:1155.3,1155.18 1 1 +fmt/scan.go:1169.3,1170.21 2 1 +fmt/scan.go:1174.3,1174.9 1 1 +fmt/scan.go:1110.20,1113.41 3 1 +fmt/scan.go:1123.4,1123.34 1 1 +fmt/scan.go:1132.4,1132.21 1 1 +fmt/scan.go:1151.4,1151.12 1 1 +fmt/scan.go:1113.41,1114.21 1 1 +fmt/scan.go:1120.5,1121.50 2 1 +fmt/scan.go:1114.21,1117.6 2 1 +fmt/scan.go:1117.11,1119.6 1 1 +fmt/scan.go:1123.34,1125.43 2 1 +fmt/scan.go:1128.5,1128.40 1 1 +fmt/scan.go:1125.43,1127.6 1 1 +fmt/scan.go:1128.40,1130.6 1 1 +fmt/scan.go:1132.21,1134.22 2 1 +fmt/scan.go:1144.5,1144.43 1 1 +fmt/scan.go:1147.5,1147.22 1 1 +fmt/scan.go:1134.22,1137.43 1 1 +fmt/scan.go:1140.6,1140.24 1 1 +fmt/scan.go:1137.43,1139.7 1 1 +fmt/scan.go:1140.24,1142.7 1 1 +fmt/scan.go:1144.43,1146.6 1 1 +fmt/scan.go:1147.22,1149.6 1 1 +fmt/scan.go:1155.18,1157.26 1 1 +fmt/scan.go:1161.4,1162.20 2 1 +fmt/scan.go:1165.4,1165.10 1 1 +fmt/scan.go:1157.26,1159.5 1 1 +fmt/scan.go:1162.20,1164.5 1 1 +fmt/scan.go:1170.21,1173.4 2 1 +fmt/scan.go:1181.84,1185.24 3 1 +fmt/scan.go:1234.2,1234.27 1 1 +fmt/scan.go:1237.2,1237.8 1 1 +fmt/scan.go:1185.24,1187.12 2 1 +fmt/scan.go:1192.3,1192.23 1 1 +fmt/scan.go:1200.3,1205.18 4 1 +fmt/scan.go:1209.3,1212.15 3 1 +fmt/scan.go:1215.3,1215.15 1 1 +fmt/scan.go:1219.3,1220.46 2 1 +fmt/scan.go:1224.3,1224.29 1 1 +fmt/scan.go:1228.3,1232.23 4 1 +fmt/scan.go:1187.12,1189.12 2 1 +fmt/scan.go:1192.23,1194.13 1 1 +fmt/scan.go:1198.4,1198.9 1 0 +fmt/scan.go:1194.13,1196.5 1 1 +fmt/scan.go:1205.18,1207.4 1 1 +fmt/scan.go:1212.15,1214.4 1 1 +fmt/scan.go:1215.15,1217.12 2 1 +fmt/scan.go:1220.46,1222.4 1 1 +fmt/scan.go:1224.29,1226.9 2 1 +fmt/scan.go:1234.27,1236.3 1 1 diff --git a/houston/queries.go b/houston/queries.go index e0c549ad4..732d4c5fb 100644 --- a/houston/queries.go +++ b/houston/queries.go @@ -55,8 +55,14 @@ var ( }` DeploymentDeleteRequest = ` - mutation DeleteDeployment($deploymentId: Uuid!) { - deleteDeployment(deploymentUuid: $deploymentId) { + mutation DeleteDeployment( + $deploymentId: Uuid! + $deploymentHardDelete: Boolean + ) { + deleteDeployment( + deploymentUuid: $deploymentId + deploymentHardDelete: $deploymentHardDelete + ) { id type label diff --git a/messages/messages.go b/messages/messages.go index fc9593a62..8f360502e 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -18,6 +18,7 @@ var ( CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" CLI_UPGRADE_PROMPT = "A newer version of the Astronomer CLI is available.\nTo upgrade to latest, run:" CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" + CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nThis operation is irreversible and permanent. Are you sure?" CONFIG_CREATE_DIR_ERROR = "Error creating config directory\n" CONFIG_CREATE_HOME_ERROR = "Error creating default config in home dir: %s" From 98b24434effb795fd93c82543a9e9c23b67b3e0a Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 09:45:02 -0500 Subject: [PATCH 04/28] add tests and remove accidental file added --- cmd/deployment_test.go | 108 ++++- fmtcoverage.html | 901 ----------------------------------------- 2 files changed, 107 insertions(+), 902 deletions(-) delete mode 100644 fmtcoverage.html diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 9b2f784c2..df637af57 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -4,6 +4,7 @@ import ( "bytes" "io/ioutil" "net/http" + "os" "strings" "testing" @@ -539,11 +540,12 @@ func TestDeploymentAirflowUpgradeCancelCommand(t *testing.T) { assert.Contains(t, output, expectedOut) } -func TestDeploymentDelete(t *testing.T){ +func TestDeploymentDelete(t *testing.T) { testUtil.InitTestConfig() expectedOut := `Successfully deleted deployment` okResponse := `{ "data": { + "appConfig": {"nfsMountDagDeployment": false}, "deleteDeployment": { "id": "ckqh2dmzc43548h9hxzspysyi", "type": "airflow", @@ -572,3 +574,107 @@ func TestDeploymentDelete(t *testing.T){ assert.NoError(t, err) assert.Contains(t, output, expectedOut) } + +func TestDeploymentDeleteHardResponseNo(t *testing.T) { + testUtil.InitTestConfig() + expectedOut := `Successfully deleted deployment` + okResponse := `{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deleteDeployment": { + "id": "ckqh2dmzc43548h9hxzspysyi", + "type": "airflow", + "label": "test2", + "description": "", + "releaseName": "combusting-radiant-1610", + "version": "0.17.1", + "workspace": { + "id": "ckqh2d9zh40758h9h650gf8dc" + }, + "createdAt": "2021-06-28T20:19:03.193Z", + "updatedAt": "2021-07-07T18:16:52.118Z" + } + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + + // mock os.Stdin + input := []byte("n") + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + _, err = w.Write(input) + if err != nil { + t.Error(err) + } + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + + + _, output, err := executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") + assert.NoError(t, err) + assert.Contains(t, output, expectedOut) +} + +func TestDeploymentDeleteHardResponseYes(t *testing.T) { + testUtil.InitTestConfig() + expectedOut := `Successfully deleted deployment` + okResponse := `{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deleteDeployment": { + "id": "ckqh2dmzc43548h9hxzspysyi", + "type": "airflow", + "label": "test2", + "description": "", + "releaseName": "combusting-radiant-1610", + "version": "0.17.1", + "workspace": { + "id": "ckqh2d9zh40758h9h650gf8dc" + }, + "createdAt": "2021-06-28T20:19:03.193Z", + "updatedAt": "2021-07-07T18:16:52.118Z" + } + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + + // mock os.Stdin + input := []byte("y") + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + _, err = w.Write(input) + if err != nil { + t.Error(err) + } + w.Close() + stdin := os.Stdin + // Restore stdin right after the test. + defer func() { os.Stdin = stdin }() + os.Stdin = r + + + _, output, err := executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") + assert.NoError(t, err) + assert.Contains(t, output, expectedOut) +} diff --git a/fmtcoverage.html b/fmtcoverage.html deleted file mode 100644 index 302947823..000000000 --- a/fmtcoverage.html +++ /dev/null @@ -1,901 +0,0 @@ -mode: set -fmt/errors.go:17.52,23.25 6 1 -fmt/errors.go:28.2,29.12 2 1 -fmt/errors.go:23.25,25.3 1 1 -fmt/errors.go:25.8,27.3 1 1 -fmt/errors.go:37.36,39.2 1 1 -fmt/errors.go:41.36,43.2 1 1 -fmt/format.go:54.28,56.2 1 1 -fmt/format.go:58.33,61.2 2 1 -fmt/format.go:64.35,65.12 1 1 -fmt/format.go:68.2,72.23 4 1 -fmt/format.go:77.2,78.12 2 1 -fmt/format.go:82.2,83.25 2 1 -fmt/format.go:86.2,86.23 1 1 -fmt/format.go:65.12,67.3 1 1 -fmt/format.go:72.23,75.3 2 0 -fmt/format.go:78.12,80.3 1 1 -fmt/format.go:83.25,85.3 1 1 -fmt/format.go:90.29,91.33 1 1 -fmt/format.go:95.2,96.14 2 1 -fmt/format.go:91.33,94.3 2 1 -fmt/format.go:96.14,100.3 2 1 -fmt/format.go:100.8,104.3 2 1 -fmt/format.go:108.35,109.33 1 1 -fmt/format.go:113.2,114.14 2 1 -fmt/format.go:109.33,112.3 2 1 -fmt/format.go:114.14,118.3 2 1 -fmt/format.go:118.8,122.3 2 1 -fmt/format.go:126.34,127.7 1 1 -fmt/format.go:127.7,129.3 1 1 -fmt/format.go:129.8,131.3 1 1 -fmt/format.go:135.36,142.33 3 1 -fmt/format.go:152.2,155.62 2 1 -fmt/format.go:166.2,166.14 1 1 -fmt/format.go:172.2,176.15 4 1 -fmt/format.go:182.2,190.18 8 1 -fmt/format.go:142.33,146.23 3 1 -fmt/format.go:146.23,148.4 1 1 -fmt/format.go:155.62,164.3 8 1 -fmt/format.go:166.14,171.3 4 1 -fmt/format.go:176.15,180.3 3 1 -fmt/format.go:194.87,196.14 2 1 -fmt/format.go:200.2,203.35 2 1 -fmt/format.go:215.2,216.19 2 1 -fmt/format.go:236.2,239.14 2 1 -fmt/format.go:268.2,270.33 3 1 -fmt/format.go:276.2,276.13 1 1 -fmt/format.go:297.2,297.17 1 1 -fmt/format.go:304.2,304.14 1 1 -fmt/format.go:317.2,320.18 4 1 -fmt/format.go:196.14,198.3 1 1 -fmt/format.go:203.35,206.23 2 1 -fmt/format.go:206.23,209.4 1 1 -fmt/format.go:216.19,219.26 2 1 -fmt/format.go:219.26,225.4 5 1 -fmt/format.go:226.8,226.35 1 1 -fmt/format.go:226.35,228.36 2 1 -fmt/format.go:228.36,230.4 1 1 -fmt/format.go:240.10,241.15 1 1 -fmt/format.go:247.10,248.15 1 1 -fmt/format.go:253.9,254.14 1 1 -fmt/format.go:259.9,260.14 1 1 -fmt/format.go:265.10,266.43 1 0 -fmt/format.go:241.15,246.4 4 1 -fmt/format.go:248.15,252.4 3 1 -fmt/format.go:254.14,258.4 3 1 -fmt/format.go:260.14,264.4 3 1 -fmt/format.go:270.33,273.3 2 1 -fmt/format.go:276.13,277.15 1 1 -fmt/format.go:278.10,283.16 4 1 -fmt/format.go:284.10,285.21 1 1 -fmt/format.go:289.11,294.16 4 1 -fmt/format.go:285.21,288.5 2 1 -fmt/format.go:297.17,302.3 4 1 -fmt/format.go:304.14,307.3 2 1 -fmt/format.go:307.8,307.19 1 1 -fmt/format.go:307.19,310.3 2 1 -fmt/format.go:310.8,310.20 1 1 -fmt/format.go:310.20,313.3 2 1 -fmt/format.go:324.47,325.19 1 1 -fmt/format.go:334.2,334.10 1 1 -fmt/format.go:325.19,327.20 2 1 -fmt/format.go:327.20,329.13 2 1 -fmt/format.go:329.13,331.5 1 1 -fmt/format.go:338.41,339.19 1 1 -fmt/format.go:353.2,353.10 1 1 -fmt/format.go:339.19,341.27 2 1 -fmt/format.go:341.27,343.13 2 1 -fmt/format.go:346.4,347.29 2 1 -fmt/format.go:350.4,350.12 1 1 -fmt/format.go:343.13,345.5 1 1 -fmt/format.go:347.29,349.5 1 1 -fmt/format.go:357.30,360.2 2 1 -fmt/format.go:363.31,366.2 2 1 -fmt/format.go:369.57,371.14 2 1 -fmt/format.go:376.2,376.38 1 1 -fmt/format.go:380.2,381.15 2 1 -fmt/format.go:400.2,400.47 1 1 -fmt/format.go:404.2,405.13 2 1 -fmt/format.go:409.2,410.30 2 1 -fmt/format.go:427.2,429.46 2 1 -fmt/format.go:371.14,374.3 1 1 -fmt/format.go:376.38,378.3 1 1 -fmt/format.go:381.15,382.14 1 1 -fmt/format.go:382.14,384.15 1 1 -fmt/format.go:388.4,388.23 1 1 -fmt/format.go:384.15,386.5 1 1 -fmt/format.go:389.9,389.21 1 1 -fmt/format.go:389.21,392.4 1 1 -fmt/format.go:393.8,394.19 1 1 -fmt/format.go:397.3,397.9 1 1 -fmt/format.go:394.19,396.4 1 1 -fmt/format.go:400.47,402.3 1 1 -fmt/format.go:405.13,408.3 1 1 -fmt/format.go:410.30,411.23 1 1 -fmt/format.go:419.3,419.15 1 1 -fmt/format.go:425.3,425.49 1 1 -fmt/format.go:411.23,414.15 2 1 -fmt/format.go:414.15,417.5 1 1 -fmt/format.go:419.15,421.4 1 1 -fmt/format.go:421.9,423.4 1 1 -fmt/format.go:429.46,431.3 1 1 -fmt/format.go:435.39,437.2 1 1 -fmt/format.go:440.46,442.2 1 1 -fmt/format.go:447.30,449.40 2 1 -fmt/format.go:453.2,454.12 2 1 -fmt/format.go:449.40,452.3 2 1 -fmt/format.go:454.12,456.3 1 1 -fmt/format.go:456.8,458.3 1 1 -fmt/format.go:463.30,465.22 2 1 -fmt/format.go:468.2,470.16 3 1 -fmt/format.go:465.22,467.3 1 1 -fmt/format.go:475.31,477.22 2 1 -fmt/format.go:480.2,481.12 2 1 -fmt/format.go:477.22,479.3 1 1 -fmt/format.go:481.12,483.3 1 1 -fmt/format.go:483.8,485.3 1 1 -fmt/format.go:490.66,492.19 1 1 -fmt/format.go:496.2,497.36 2 1 -fmt/format.go:504.2,504.41 1 1 -fmt/format.go:509.2,509.36 1 1 -fmt/format.go:522.2,522.28 1 1 -fmt/format.go:579.2,579.29 1 1 -fmt/format.go:592.2,592.16 1 1 -fmt/format.go:492.19,494.3 1 1 -fmt/format.go:497.36,499.3 1 1 -fmt/format.go:499.8,501.3 1 1 -fmt/format.go:504.41,506.3 1 1 -fmt/format.go:509.36,513.43 3 1 -fmt/format.go:516.3,518.9 3 1 -fmt/format.go:513.43,515.4 1 1 -fmt/format.go:522.28,524.15 2 1 -fmt/format.go:535.3,541.33 5 1 -fmt/format.go:565.3,565.23 1 1 -fmt/format.go:572.3,572.18 1 1 -fmt/format.go:576.3,576.29 1 1 -fmt/format.go:525.27,528.20 2 1 -fmt/format.go:528.20,530.5 1 1 -fmt/format.go:541.33,542.18 1 1 -fmt/format.go:543.13,544.27 1 1 -fmt/format.go:545.18,547.18 2 1 -fmt/format.go:548.18,549.35 1 1 -fmt/format.go:554.5,554.16 1 1 -fmt/format.go:555.12,556.22 1 1 -fmt/format.go:560.5,560.24 1 1 -fmt/format.go:549.35,552.11 3 1 -fmt/format.go:556.22,558.6 1 1 -fmt/format.go:560.24,562.6 1 1 -fmt/format.go:565.23,567.38 1 1 -fmt/format.go:570.4,570.26 1 1 -fmt/format.go:567.38,569.5 1 1 -fmt/format.go:572.18,575.4 2 1 -fmt/format.go:579.29,582.49 1 1 -fmt/format.go:588.3,589.9 2 1 -fmt/format.go:582.49,587.4 4 1 -fmt/print.go:77.34,79.2 1 1 -fmt/print.go:81.40,83.2 1 1 -fmt/print.go:85.36,87.2 1 1 -fmt/print.go:89.37,90.23 1 1 -fmt/print.go:95.2,97.29 3 1 -fmt/print.go:100.2,101.15 2 1 -fmt/print.go:90.23,93.3 2 1 -fmt/print.go:97.29,99.3 1 0 -fmt/print.go:132.26,132.44 1 1 -fmt/print.go:136.23,143.2 6 1 -fmt/print.go:146.21,153.25 1 1 -fmt/print.go:157.2,161.15 5 1 -fmt/print.go:153.25,155.3 1 0 -fmt/print.go:164.41,164.79 1 1 -fmt/print.go:166.46,166.86 1 1 -fmt/print.go:168.31,169.11 1 1 -fmt/print.go:181.2,181.14 1 1 -fmt/print.go:170.11,171.21 1 1 -fmt/print.go:172.11,173.35 1 1 -fmt/print.go:174.11,175.37 1 1 -fmt/print.go:176.11,177.21 1 1 -fmt/print.go:178.11,179.20 1 1 -fmt/print.go:186.51,189.2 2 1 -fmt/print.go:193.57,196.2 2 1 -fmt/print.go:202.79,208.2 5 1 -fmt/print.go:212.65,214.2 1 1 -fmt/print.go:217.54,223.2 5 1 -fmt/print.go:230.63,236.2 5 1 -fmt/print.go:241.49,243.2 1 1 -fmt/print.go:247.38,253.2 5 1 -fmt/print.go:262.65,268.2 5 1 -fmt/print.go:273.51,275.2 1 1 -fmt/print.go:279.40,285.2 5 1 -fmt/print.go:290.53,292.53 2 1 -fmt/print.go:295.2,295.12 1 1 -fmt/print.go:292.53,294.3 1 1 -fmt/print.go:300.27,303.2 2 1 -fmt/print.go:306.73,307.18 1 1 -fmt/print.go:310.2,310.75 1 1 -fmt/print.go:317.2,317.8 1 1 -fmt/print.go:307.18,309.3 1 1 -fmt/print.go:310.75,311.20 1 1 -fmt/print.go:314.3,315.15 2 1 -fmt/print.go:311.20,313.4 1 1 -fmt/print.go:320.43,321.18 1 0 -fmt/print.go:325.2,327.22 3 0 -fmt/print.go:321.18,324.3 2 0 -fmt/print.go:330.33,335.9 5 1 -fmt/print.go:347.2,348.20 2 1 -fmt/print.go:336.20,339.25 3 1 -fmt/print.go:340.25,343.32 3 1 -fmt/print.go:344.10,345.36 1 1 -fmt/print.go:351.41,352.14 1 1 -fmt/print.go:353.16,354.22 1 1 -fmt/print.go:355.10,356.18 1 1 -fmt/print.go:362.48,367.2 4 1 -fmt/print.go:370.61,371.14 1 1 -fmt/print.go:372.11,373.32 1 1 -fmt/print.go:378.11,379.51 1 1 -fmt/print.go:380.11,381.50 1 1 -fmt/print.go:382.16,383.50 1 1 -fmt/print.go:384.11,385.51 1 1 -fmt/print.go:386.11,387.51 1 1 -fmt/print.go:388.11,389.16 1 1 -fmt/print.go:390.11,391.17 1 1 -fmt/print.go:392.11,393.22 1 1 -fmt/print.go:394.10,395.18 1 1 -fmt/print.go:373.32,375.4 1 1 -fmt/print.go:375.9,377.4 1 1 -fmt/print.go:401.55,402.14 1 1 -fmt/print.go:403.11,404.35 1 1 -fmt/print.go:405.31,406.36 1 1 -fmt/print.go:407.21,408.35 1 1 -fmt/print.go:409.11,410.34 1 1 -fmt/print.go:411.10,412.18 1 1 -fmt/print.go:419.60,422.14 1 1 -fmt/print.go:423.56,431.23 7 1 -fmt/print.go:432.10,433.18 1 1 -fmt/print.go:437.45,438.14 1 1 -fmt/print.go:439.11,440.19 1 1 -fmt/print.go:445.11,446.16 1 1 -fmt/print.go:447.11,448.26 1 1 -fmt/print.go:449.11,450.26 1 1 -fmt/print.go:451.11,452.16 1 1 -fmt/print.go:453.10,454.18 1 1 -fmt/print.go:440.19,442.4 1 1 -fmt/print.go:442.9,444.4 1 1 -fmt/print.go:458.63,459.14 1 1 -fmt/print.go:460.16,461.19 1 1 -fmt/print.go:485.11,486.17 1 1 -fmt/print.go:487.11,488.26 1 1 -fmt/print.go:489.11,490.26 1 1 -fmt/print.go:491.11,492.24 1 1 -fmt/print.go:493.10,494.44 1 1 -fmt/print.go:461.19,463.16 2 1 -fmt/print.go:467.4,468.24 2 1 -fmt/print.go:474.4,474.24 1 1 -fmt/print.go:463.16,466.5 2 1 -fmt/print.go:468.24,469.14 1 1 -fmt/print.go:472.5,472.31 1 1 -fmt/print.go:469.14,471.6 1 1 -fmt/print.go:475.9,477.24 2 1 -fmt/print.go:483.4,483.24 1 1 -fmt/print.go:477.24,478.14 1 1 -fmt/print.go:481.5,481.61 1 1 -fmt/print.go:478.14,480.6 1 1 -fmt/print.go:498.57,500.22 2 1 -fmt/print.go:508.2,508.14 1 1 -fmt/print.go:501.98,502.22 1 1 -fmt/print.go:503.10,505.9 2 1 -fmt/print.go:509.11,510.19 1 1 -fmt/print.go:527.11,528.37 1 1 -fmt/print.go:529.31,530.42 1 1 -fmt/print.go:531.10,532.18 1 1 -fmt/print.go:510.19,514.14 4 1 -fmt/print.go:519.4,519.24 1 1 -fmt/print.go:514.14,516.5 1 1 -fmt/print.go:516.10,518.5 1 1 -fmt/print.go:520.9,521.14 1 1 -fmt/print.go:521.14,523.5 1 1 -fmt/print.go:523.10,525.5 1 1 -fmt/print.go:536.68,537.34 1 1 -fmt/print.go:537.34,541.70 1 1 -fmt/print.go:547.3,547.18 1 1 -fmt/print.go:552.3,566.28 12 1 -fmt/print.go:541.70,544.4 2 1 -fmt/print.go:547.18,549.14 1 0 -fmt/print.go:570.54,571.16 1 1 -fmt/print.go:574.2,574.17 1 1 -fmt/print.go:590.2,590.44 1 1 -fmt/print.go:598.2,598.18 1 1 -fmt/print.go:631.2,631.14 1 1 -fmt/print.go:571.16,573.3 1 1 -fmt/print.go:574.17,578.48 2 1 -fmt/print.go:584.3,586.13 2 1 -fmt/print.go:578.48,583.4 4 1 -fmt/print.go:590.44,595.3 4 1 -fmt/print.go:598.18,599.45 1 1 -fmt/print.go:599.45,605.4 4 1 -fmt/print.go:606.8,610.15 1 1 -fmt/print.go:611.32,616.29 1 1 -fmt/print.go:617.15,621.11 4 1 -fmt/print.go:623.18,627.11 4 1 -fmt/print.go:634.51,638.16 3 1 -fmt/print.go:650.2,650.14 1 1 -fmt/print.go:660.2,660.25 1 1 -fmt/print.go:638.16,639.15 1 1 -fmt/print.go:645.3,645.9 1 1 -fmt/print.go:640.17,641.35 1 1 -fmt/print.go:642.11,643.19 1 1 -fmt/print.go:651.11,653.9 2 1 -fmt/print.go:654.11,656.9 2 1 -fmt/print.go:661.12,662.21 1 1 -fmt/print.go:663.15,664.35 1 1 -fmt/print.go:665.15,666.26 1 1 -fmt/print.go:667.17,668.40 1 1 -fmt/print.go:669.18,670.29 1 1 -fmt/print.go:671.11,672.40 1 1 -fmt/print.go:673.12,674.40 1 1 -fmt/print.go:675.13,676.40 1 1 -fmt/print.go:677.13,678.40 1 1 -fmt/print.go:679.13,680.40 1 1 -fmt/print.go:681.12,682.42 1 1 -fmt/print.go:683.13,684.42 1 1 -fmt/print.go:685.14,686.42 1 1 -fmt/print.go:687.14,688.42 1 1 -fmt/print.go:689.14,690.34 1 1 -fmt/print.go:691.15,692.42 1 1 -fmt/print.go:693.14,694.23 1 1 -fmt/print.go:695.14,696.32 1 1 -fmt/print.go:697.21,700.38 1 1 -fmt/print.go:706.3,706.27 1 1 -fmt/print.go:707.10,709.29 1 1 -fmt/print.go:700.38,702.29 2 1 -fmt/print.go:702.29,704.5 1 1 -fmt/print.go:709.29,713.4 1 1 -fmt/print.go:719.68,721.58 1 1 -fmt/print.go:727.2,730.34 3 1 -fmt/print.go:721.58,723.28 2 1 -fmt/print.go:723.28,725.4 1 1 -fmt/print.go:731.23,732.17 1 1 -fmt/print.go:742.20,743.28 1 1 -fmt/print.go:744.78,745.46 1 1 -fmt/print.go:746.100,747.41 1 1 -fmt/print.go:748.23,749.34 1 1 -fmt/print.go:750.23,751.34 1 1 -fmt/print.go:752.25,753.38 1 1 -fmt/print.go:754.26,755.39 1 1 -fmt/print.go:756.22,757.32 1 1 -fmt/print.go:758.19,759.19 1 1 -fmt/print.go:769.3,770.34 2 1 -fmt/print.go:782.3,782.19 1 1 -fmt/print.go:787.22,788.19 1 1 -fmt/print.go:791.3,792.37 2 1 -fmt/print.go:808.3,808.23 1 1 -fmt/print.go:809.25,811.23 2 1 -fmt/print.go:821.36,822.15 1 1 -fmt/print.go:845.3,845.19 1 1 -fmt/print.go:869.19,872.37 1 1 -fmt/print.go:880.3,880.14 1 1 -fmt/print.go:881.57,882.24 1 1 -fmt/print.go:883.10,884.19 1 0 -fmt/print.go:732.17,734.4 1 1 -fmt/print.go:734.9,735.16 1 0 -fmt/print.go:736.13,737.38 1 0 -fmt/print.go:738.12,739.20 1 0 -fmt/print.go:759.19,761.17 2 1 -fmt/print.go:765.4,765.24 1 1 -fmt/print.go:761.17,764.5 2 1 -fmt/print.go:766.9,768.4 1 1 -fmt/print.go:770.34,771.13 1 1 -fmt/print.go:778.4,780.48 3 1 -fmt/print.go:771.13,772.21 1 1 -fmt/print.go:772.21,774.6 1 1 -fmt/print.go:774.11,776.6 1 1 -fmt/print.go:782.19,784.4 1 1 -fmt/print.go:784.9,786.4 1 1 -fmt/print.go:788.19,790.4 1 1 -fmt/print.go:792.37,793.13 1 1 -fmt/print.go:800.4,800.35 1 1 -fmt/print.go:806.4,806.47 1 1 -fmt/print.go:793.13,794.21 1 1 -fmt/print.go:794.21,796.6 1 1 -fmt/print.go:796.11,798.6 1 1 -fmt/print.go:800.35,801.51 1 1 -fmt/print.go:801.51,804.6 2 1 -fmt/print.go:811.23,812.20 1 1 -fmt/print.go:812.20,815.5 2 1 -fmt/print.go:815.10,817.5 1 1 -fmt/print.go:818.9,820.4 1 1 -fmt/print.go:823.27,826.40 2 1 -fmt/print.go:826.40,828.34 2 1 -fmt/print.go:841.5,842.11 2 1 -fmt/print.go:828.34,830.6 1 1 -fmt/print.go:830.11,830.27 1 1 -fmt/print.go:830.27,832.6 1 1 -fmt/print.go:832.11,837.27 2 1 -fmt/print.go:837.27,839.7 1 1 -fmt/print.go:845.19,847.46 2 1 -fmt/print.go:851.4,852.33 2 1 -fmt/print.go:858.4,858.24 1 1 -fmt/print.go:847.46,850.5 2 1 -fmt/print.go:852.33,853.14 1 1 -fmt/print.go:856.5,856.44 1 1 -fmt/print.go:853.14,855.6 1 1 -fmt/print.go:859.9,861.33 2 1 -fmt/print.go:867.4,867.24 1 1 -fmt/print.go:861.33,862.14 1 1 -fmt/print.go:865.5,865.44 1 1 -fmt/print.go:862.14,864.6 1 1 -fmt/print.go:872.37,873.35 1 1 -fmt/print.go:874.67,877.11 3 1 -fmt/print.go:889.83,891.21 2 1 -fmt/print.go:918.2,918.8 1 1 -fmt/print.go:891.21,893.13 2 1 -fmt/print.go:912.3,913.20 2 1 -fmt/print.go:893.13,895.53 1 1 -fmt/print.go:896.80,898.27 2 1 -fmt/print.go:902.102,904.45 2 1 -fmt/print.go:908.12,908.12 0 1 -fmt/print.go:898.27,901.6 2 1 -fmt/print.go:904.45,907.6 2 1 -fmt/print.go:913.20,916.4 2 1 -fmt/print.go:927.66,929.21 1 1 -fmt/print.go:934.2,934.35 1 1 -fmt/print.go:943.2,943.20 1 0 -fmt/print.go:929.21,931.3 1 1 -fmt/print.go:934.35,935.23 1 1 -fmt/print.go:935.23,937.24 2 1 -fmt/print.go:940.4,940.33 1 1 -fmt/print.go:937.24,939.5 1 1 -fmt/print.go:949.105,950.42 1 1 -fmt/print.go:953.2,955.41 3 1 -fmt/print.go:958.2,959.28 2 1 -fmt/print.go:950.42,952.3 1 1 -fmt/print.go:955.41,957.3 1 1 -fmt/print.go:962.35,966.2 3 1 -fmt/print.go:968.36,972.2 3 1 -fmt/print.go:974.55,980.23 5 1 -fmt/print.go:1130.2,1130.37 1 1 -fmt/print.go:980.23,983.35 3 1 -fmt/print.go:986.3,986.16 1 1 -fmt/print.go:989.3,989.15 1 1 -fmt/print.go:995.3,1000.22 3 1 -fmt/print.go:1037.3,1040.34 2 1 -fmt/print.go:1064.3,1064.36 1 1 -fmt/print.go:1091.3,1091.18 1 1 -fmt/print.go:1095.3,1095.15 1 1 -fmt/print.go:1100.3,1101.28 2 1 -fmt/print.go:1104.3,1106.10 2 1 -fmt/print.go:983.35,985.4 1 1 -fmt/print.go:986.16,988.4 1 1 -fmt/print.go:989.15,991.9 1 1 -fmt/print.go:1000.22,1002.13 2 1 -fmt/print.go:1003.13,1004.23 1 1 -fmt/print.go:1005.13,1006.30 1 1 -fmt/print.go:1007.13,1008.22 1 1 -fmt/print.go:1009.13,1011.23 2 1 -fmt/print.go:1012.13,1013.23 1 1 -fmt/print.go:1014.12,1017.48 1 1 -fmt/print.go:1032.5,1032.23 1 1 -fmt/print.go:1017.48,1018.18 1 1 -fmt/print.go:1026.6,1029.25 4 1 -fmt/print.go:1018.18,1025.7 4 1 -fmt/print.go:1040.34,1044.25 3 1 -fmt/print.go:1050.4,1050.21 1 1 -fmt/print.go:1055.4,1055.22 1 1 -fmt/print.go:1044.25,1046.5 1 1 -fmt/print.go:1050.21,1054.5 3 1 -fmt/print.go:1056.9,1058.38 2 1 -fmt/print.go:1058.38,1060.5 1 1 -fmt/print.go:1064.36,1066.18 2 1 -fmt/print.go:1069.4,1070.35 2 1 -fmt/print.go:1066.18,1068.5 1 1 -fmt/print.go:1070.35,1074.23 3 1 -fmt/print.go:1078.5,1078.27 1 1 -fmt/print.go:1081.5,1081.23 1 1 -fmt/print.go:1074.23,1077.6 2 1 -fmt/print.go:1078.27,1080.6 1 1 -fmt/print.go:1082.10,1084.27 2 1 -fmt/print.go:1084.27,1087.6 2 1 -fmt/print.go:1091.18,1093.4 1 1 -fmt/print.go:1095.15,1097.9 2 1 -fmt/print.go:1101.28,1103.4 1 1 -fmt/print.go:1107.20,1108.24 1 1 -fmt/print.go:1109.22,1110.21 1 1 -fmt/print.go:1111.25,1112.22 1 1 -fmt/print.go:1113.20,1120.15 5 1 -fmt/print.go:1121.11,1123.12 2 1 -fmt/print.go:1130.37,1133.34 3 1 -fmt/print.go:1145.3,1145.23 1 1 -fmt/print.go:1133.34,1134.13 1 1 -fmt/print.go:1137.4,1137.18 1 1 -fmt/print.go:1134.13,1136.5 1 0 -fmt/print.go:1137.18,1139.5 1 1 -fmt/print.go:1139.10,1143.5 3 1 -fmt/print.go:1149.39,1151.29 2 1 -fmt/print.go:1151.29,1154.45 2 1 -fmt/print.go:1157.3,1158.24 2 1 -fmt/print.go:1154.45,1156.4 1 1 -fmt/print.go:1164.41,1165.29 1 1 -fmt/print.go:1171.2,1171.23 1 1 -fmt/print.go:1165.29,1166.17 1 1 -fmt/print.go:1169.3,1169.23 1 1 -fmt/print.go:1166.17,1168.4 1 1 -fmt/scan.go:63.48,65.2 1 0 -fmt/scan.go:69.50,71.2 1 0 -fmt/scan.go:80.64,82.2 1 0 -fmt/scan.go:86.58,89.12 3 1 -fmt/scan.go:92.2,92.8 1 1 -fmt/scan.go:89.12,91.3 1 1 -fmt/scan.go:99.61,101.2 1 1 -fmt/scan.go:105.63,107.2 1 1 -fmt/scan.go:113.77,115.2 1 1 -fmt/scan.go:121.62,126.2 4 1 -fmt/scan.go:130.64,135.2 4 1 -fmt/scan.go:141.78,146.2 4 1 -fmt/scan.go:179.50,181.2 1 0 -fmt/scan.go:183.55,184.38 1 1 -fmt/scan.go:189.2,190.16 2 1 -fmt/scan.go:198.2,198.8 1 1 -fmt/scan.go:184.38,187.3 2 1 -fmt/scan.go:190.16,192.29 2 1 -fmt/scan.go:192.29,194.4 1 1 -fmt/scan.go:195.8,195.26 1 1 -fmt/scan.go:195.26,197.3 1 1 -fmt/scan.go:201.41,202.25 1 0 -fmt/scan.go:205.2,205.23 1 0 -fmt/scan.go:202.25,204.3 1 0 -fmt/scan.go:210.33,212.16 2 1 -fmt/scan.go:218.2,218.8 1 1 -fmt/scan.go:212.16,213.20 1 1 -fmt/scan.go:216.3,216.15 1 0 -fmt/scan.go:213.20,215.4 1 1 -fmt/scan.go:224.38,226.14 2 1 -fmt/scan.go:229.2,229.8 1 1 -fmt/scan.go:226.14,228.3 1 1 -fmt/scan.go:232.33,237.2 4 1 -fmt/scan.go:239.31,240.23 1 1 -fmt/scan.go:243.38,244.35 1 1 -fmt/scan.go:247.79,248.15 1 1 -fmt/scan.go:257.2,257.14 1 1 -fmt/scan.go:260.2,262.8 3 1 -fmt/scan.go:248.15,249.31 1 1 -fmt/scan.go:249.31,250.35 1 0 -fmt/scan.go:250.35,252.5 1 0 -fmt/scan.go:252.10,253.13 1 0 -fmt/scan.go:257.14,259.3 1 1 -fmt/scan.go:280.27,281.16 1 1 -fmt/scan.go:284.2,285.28 2 1 -fmt/scan.go:293.2,293.14 1 1 -fmt/scan.go:281.16,283.3 1 1 -fmt/scan.go:285.28,286.18 1 1 -fmt/scan.go:289.3,289.19 1 1 -fmt/scan.go:286.18,288.4 1 1 -fmt/scan.go:289.19,291.4 1 1 -fmt/scan.go:297.28,299.2 1 1 -fmt/scan.go:314.51,315.19 1 1 -fmt/scan.go:321.2,322.12 2 1 -fmt/scan.go:325.2,325.26 1 1 -fmt/scan.go:315.19,320.3 4 1 -fmt/scan.go:322.12,324.3 1 1 -fmt/scan.go:330.62,331.21 1 1 -fmt/scan.go:337.2,338.16 2 1 -fmt/scan.go:341.2,341.30 1 1 -fmt/scan.go:348.2,349.44 2 1 -fmt/scan.go:359.2,360.14 2 1 -fmt/scan.go:365.2,366.8 2 1 -fmt/scan.go:331.21,336.3 4 1 -fmt/scan.go:338.16,340.3 1 1 -fmt/scan.go:341.30,347.3 4 1 -fmt/scan.go:349.44,351.17 2 1 -fmt/scan.go:351.17,352.21 1 1 -fmt/scan.go:356.4,356.10 1 0 -fmt/scan.go:352.21,354.10 2 1 -fmt/scan.go:360.14,363.3 2 1 -fmt/scan.go:369.39,370.21 1 1 -fmt/scan.go:374.2,375.12 2 1 -fmt/scan.go:370.21,372.3 1 0 -fmt/scan.go:379.26,379.44 1 1 -fmt/scan.go:383.76,385.38 2 1 -fmt/scan.go:390.2,398.8 9 1 -fmt/scan.go:385.38,387.3 1 1 -fmt/scan.go:387.8,389.3 1 1 -fmt/scan.go:402.30,404.19 1 1 -fmt/scan.go:409.2,409.23 1 1 -fmt/scan.go:412.2,414.15 3 1 -fmt/scan.go:404.19,407.3 2 0 -fmt/scan.go:409.23,411.3 1 0 -fmt/scan.go:420.26,421.6 1 1 -fmt/scan.go:421.6,423.15 2 1 -fmt/scan.go:426.3,426.32 1 1 -fmt/scan.go:429.3,429.16 1 1 -fmt/scan.go:436.3,436.18 1 1 -fmt/scan.go:423.15,425.4 1 1 -fmt/scan.go:426.32,427.12 1 0 -fmt/scan.go:429.16,430.19 1 1 -fmt/scan.go:433.4,434.10 2 1 -fmt/scan.go:430.19,431.13 1 1 -fmt/scan.go:436.18,438.9 2 1 -fmt/scan.go:446.62,447.15 1 1 -fmt/scan.go:451.2,451.6 1 1 -fmt/scan.go:462.2,462.14 1 1 -fmt/scan.go:447.15,449.3 1 1 -fmt/scan.go:451.6,453.15 2 1 -fmt/scan.go:456.3,456.12 1 1 -fmt/scan.go:460.3,460.21 1 1 -fmt/scan.go:453.15,454.9 1 1 -fmt/scan.go:456.12,458.9 2 1 -fmt/scan.go:468.38,469.22 1 1 -fmt/scan.go:474.2,474.11 1 1 -fmt/scan.go:469.22,470.13 1 1 -fmt/scan.go:470.13,472.4 1 1 -fmt/scan.go:479.51,481.14 2 1 -fmt/scan.go:484.2,484.27 1 1 -fmt/scan.go:490.2,490.24 1 1 -fmt/scan.go:493.2,493.14 1 1 -fmt/scan.go:481.14,483.3 1 1 -fmt/scan.go:484.27,485.13 1 1 -fmt/scan.go:488.3,488.14 1 1 -fmt/scan.go:485.13,487.4 1 1 -fmt/scan.go:490.24,492.3 1 1 -fmt/scan.go:497.35,499.14 2 1 -fmt/scan.go:502.2,502.30 1 1 -fmt/scan.go:499.14,501.3 1 1 -fmt/scan.go:505.23,507.32 1 1 -fmt/scan.go:510.2,510.16 1 1 -fmt/scan.go:507.32,508.16 1 1 -fmt/scan.go:515.37,517.2 1 1 -fmt/scan.go:520.58,521.28 1 1 -fmt/scan.go:526.2,527.14 2 1 -fmt/scan.go:521.28,522.16 1 1 -fmt/scan.go:522.16,524.4 1 1 -fmt/scan.go:531.39,534.38 3 1 -fmt/scan.go:538.2,538.21 1 1 -fmt/scan.go:554.2,554.14 1 0 -fmt/scan.go:534.38,536.3 1 0 -fmt/scan.go:539.11,540.15 1 0 -fmt/scan.go:541.11,542.14 1 0 -fmt/scan.go:543.16,544.61 1 1 -fmt/scan.go:547.3,547.14 1 1 -fmt/scan.go:548.16,549.80 1 1 -fmt/scan.go:552.3,552.15 1 1 -fmt/scan.go:544.61,546.4 1 0 -fmt/scan.go:549.80,551.4 1 0 -fmt/scan.go:569.59,573.14 4 1 -fmt/scan.go:584.2,584.8 1 1 -fmt/scan.go:574.11,576.24 2 1 -fmt/scan.go:577.11,579.23 2 1 -fmt/scan.go:580.21,582.29 2 1 -fmt/scan.go:588.64,589.17 1 1 -fmt/scan.go:595.2,595.23 1 1 -fmt/scan.go:597.2,597.22 1 1 -fmt/scan.go:589.17,591.24 2 1 -fmt/scan.go:591.24,593.4 1 0 -fmt/scan.go:595.24,596.3 0 1 -fmt/scan.go:601.42,606.19 5 1 -fmt/scan.go:609.2,609.17 1 1 -fmt/scan.go:606.19,608.3 1 1 -fmt/scan.go:615.73,616.18 1 1 -fmt/scan.go:619.2,621.9 2 1 -fmt/scan.go:616.18,618.3 1 1 -fmt/scan.go:622.20,624.37 2 1 -fmt/scan.go:625.20,627.36 2 1 -fmt/scan.go:628.20,630.42 2 1 -fmt/scan.go:631.10,632.36 1 1 -fmt/scan.go:638.52,639.17 1 1 -fmt/scan.go:642.2,646.17 5 1 -fmt/scan.go:656.2,658.16 3 1 -fmt/scan.go:661.2,663.12 3 1 -fmt/scan.go:666.2,666.10 1 1 -fmt/scan.go:639.17,641.3 1 1 -fmt/scan.go:646.17,647.55 1 1 -fmt/scan.go:647.55,649.4 1 0 -fmt/scan.go:650.8,652.18 2 1 -fmt/scan.go:652.18,654.4 1 1 -fmt/scan.go:658.16,660.3 1 0 -fmt/scan.go:663.12,665.3 1 1 -fmt/scan.go:671.54,672.17 1 1 -fmt/scan.go:675.2,679.17 5 1 -fmt/scan.go:686.2,688.16 3 1 -fmt/scan.go:691.2,693.12 3 1 -fmt/scan.go:696.2,696.10 1 1 -fmt/scan.go:672.17,674.3 1 1 -fmt/scan.go:679.17,680.55 1 1 -fmt/scan.go:680.55,682.4 1 0 -fmt/scan.go:683.8,683.24 1 1 -fmt/scan.go:683.24,685.3 1 1 -fmt/scan.go:688.16,690.3 1 0 -fmt/scan.go:693.12,695.3 1 1 -fmt/scan.go:702.34,705.56 2 1 -fmt/scan.go:709.2,711.56 2 1 -fmt/scan.go:714.2,716.37 3 1 -fmt/scan.go:721.2,721.23 1 1 -fmt/scan.go:724.2,724.22 1 1 -fmt/scan.go:730.2,730.19 1 1 -fmt/scan.go:737.2,737.22 1 1 -fmt/scan.go:705.56,707.3 1 1 -fmt/scan.go:711.56,713.3 1 1 -fmt/scan.go:716.37,719.3 2 1 -fmt/scan.go:721.24,722.3 0 1 -fmt/scan.go:724.22,726.24 1 1 -fmt/scan.go:726.25,727.4 0 1 -fmt/scan.go:730.19,734.37 2 1 -fmt/scan.go:734.38,735.4 0 1 -fmt/scan.go:743.50,749.21 4 1 -fmt/scan.go:753.2,755.20 3 1 -fmt/scan.go:758.2,758.30 1 1 -fmt/scan.go:761.2,761.30 1 1 -fmt/scan.go:749.21,751.3 1 0 -fmt/scan.go:755.20,757.3 1 0 -fmt/scan.go:758.30,760.3 1 0 -fmt/scan.go:764.26,765.30 1 1 -fmt/scan.go:770.2,770.14 1 1 -fmt/scan.go:765.30,766.33 1 1 -fmt/scan.go:766.33,768.4 1 1 -fmt/scan.go:774.54,778.52 1 1 -fmt/scan.go:799.2,800.16 2 1 -fmt/scan.go:803.2,803.10 1 1 -fmt/scan.go:778.52,782.17 2 1 -fmt/scan.go:789.3,790.17 2 1 -fmt/scan.go:797.3,797.26 1 1 -fmt/scan.go:782.17,784.44 1 0 -fmt/scan.go:787.4,787.16 1 0 -fmt/scan.go:784.44,786.5 1 0 -fmt/scan.go:790.17,792.44 1 0 -fmt/scan.go:795.4,795.16 1 0 -fmt/scan.go:792.44,794.5 1 0 -fmt/scan.go:800.16,802.3 1 1 -fmt/scan.go:810.55,811.44 1 1 -fmt/scan.go:814.2,819.28 6 1 -fmt/scan.go:811.44,813.3 1 0 -fmt/scan.go:824.52,825.40 1 1 -fmt/scan.go:828.2,830.14 3 1 -fmt/scan.go:838.2,838.8 1 1 -fmt/scan.go:825.40,827.3 1 0 -fmt/scan.go:831.11,832.25 1 1 -fmt/scan.go:833.16,834.22 1 1 -fmt/scan.go:835.10,836.40 1 1 -fmt/scan.go:842.36,845.15 3 1 -fmt/scan.go:879.2,879.11 1 0 -fmt/scan.go:846.11,848.7 1 1 -fmt/scan.go:855.3,855.23 1 1 -fmt/scan.go:856.11,859.7 2 1 -fmt/scan.go:871.3,872.17 2 1 -fmt/scan.go:875.3,875.16 1 1 -fmt/scan.go:876.10,877.42 1 0 -fmt/scan.go:848.7,850.18 2 1 -fmt/scan.go:853.4,853.22 1 1 -fmt/scan.go:850.18,851.10 1 1 -fmt/scan.go:859.7,862.17 3 1 -fmt/scan.go:862.17,867.5 1 1 -fmt/scan.go:867.10,867.23 1 1 -fmt/scan.go:867.23,868.10 1 1 -fmt/scan.go:872.17,874.4 1 0 -fmt/scan.go:883.35,885.15 2 1 -fmt/scan.go:893.2,893.18 1 1 -fmt/scan.go:886.56,887.27 1 1 -fmt/scan.go:888.36,889.32 1 1 -fmt/scan.go:890.36,891.32 1 1 -fmt/scan.go:899.42,901.18 2 1 -fmt/scan.go:904.2,905.9 2 1 -fmt/scan.go:909.2,910.9 2 1 -fmt/scan.go:914.2,914.39 1 1 -fmt/scan.go:901.18,903.3 1 1 -fmt/scan.go:905.9,908.3 2 1 -fmt/scan.go:910.9,913.3 2 1 -fmt/scan.go:918.33,920.6 2 1 -fmt/scan.go:927.2,927.21 1 1 -fmt/scan.go:931.2,931.22 1 1 -fmt/scan.go:920.6,922.10 2 1 -fmt/scan.go:925.3,925.21 1 1 -fmt/scan.go:922.10,923.9 1 1 -fmt/scan.go:927.21,930.3 2 0 -fmt/scan.go:944.28,947.20 3 1 -fmt/scan.go:947.20,949.3 1 1 -fmt/scan.go:953.50,957.32 3 1 -fmt/scan.go:968.2,968.25 1 1 -fmt/scan.go:957.32,959.17 2 1 -fmt/scan.go:965.3,965.9 1 1 -fmt/scan.go:959.17,960.21 1 1 -fmt/scan.go:963.4,963.16 1 1 -fmt/scan.go:960.21,962.5 1 1 -fmt/scan.go:969.13,970.24 1 1 -fmt/scan.go:971.18,972.42 1 1 -fmt/scan.go:973.19,974.32 1 1 -fmt/scan.go:975.12,976.37 1 1 -fmt/scan.go:977.13,978.32 1 1 -fmt/scan.go:979.14,980.34 1 1 -fmt/scan.go:981.14,982.34 1 1 -fmt/scan.go:983.14,984.27 1 1 -fmt/scan.go:985.13,986.39 1 1 -fmt/scan.go:987.14,988.34 1 1 -fmt/scan.go:989.15,990.36 1 1 -fmt/scan.go:991.15,992.36 1 1 -fmt/scan.go:993.15,994.28 1 1 -fmt/scan.go:995.16,996.46 1 0 -fmt/scan.go:999.16,1000.44 1 1 -fmt/scan.go:1005.16,1006.44 1 1 -fmt/scan.go:1011.15,1012.29 1 1 -fmt/scan.go:1013.15,1016.37 1 1 -fmt/scan.go:1017.10,1020.32 3 1 -fmt/scan.go:1024.3,1024.36 1 1 -fmt/scan.go:1000.44,1004.4 3 1 -fmt/scan.go:1006.44,1010.4 3 1 -fmt/scan.go:1020.32,1023.4 2 1 -fmt/scan.go:1025.21,1026.31 1 1 -fmt/scan.go:1027.79,1028.46 1 1 -fmt/scan.go:1029.101,1030.48 1 1 -fmt/scan.go:1031.23,1032.38 1 1 -fmt/scan.go:1033.22,1036.42 2 1 -fmt/scan.go:1039.4,1041.34 3 1 -fmt/scan.go:1044.41,1047.63 3 1 -fmt/scan.go:1048.46,1049.54 1 1 -fmt/scan.go:1050.11,1051.60 1 0 -fmt/scan.go:1036.42,1038.5 1 0 -fmt/scan.go:1041.34,1043.5 1 1 -fmt/scan.go:1057.32,1058.30 1 1 -fmt/scan.go:1058.30,1059.34 1 1 -fmt/scan.go:1059.34,1061.4 1 1 -fmt/scan.go:1061.9,1061.55 1 1 -fmt/scan.go:1061.55,1063.4 1 1 -fmt/scan.go:1063.9,1064.12 1 0 -fmt/scan.go:1070.68,1072.24 2 1 -fmt/scan.go:1077.2,1077.15 1 1 -fmt/scan.go:1089.2,1089.8 1 1 -fmt/scan.go:1072.24,1075.3 2 1 -fmt/scan.go:1077.15,1078.7 1 1 -fmt/scan.go:1078.7,1080.29 2 1 -fmt/scan.go:1083.4,1083.19 1 1 -fmt/scan.go:1080.29,1081.10 1 1 -fmt/scan.go:1083.19,1085.10 2 1 -fmt/scan.go:1100.45,1101.22 1 1 -fmt/scan.go:1176.2,1176.8 1 1 -fmt/scan.go:1101.22,1110.20 2 1 -fmt/scan.go:1155.3,1155.18 1 1 -fmt/scan.go:1169.3,1170.21 2 1 -fmt/scan.go:1174.3,1174.9 1 1 -fmt/scan.go:1110.20,1113.41 3 1 -fmt/scan.go:1123.4,1123.34 1 1 -fmt/scan.go:1132.4,1132.21 1 1 -fmt/scan.go:1151.4,1151.12 1 1 -fmt/scan.go:1113.41,1114.21 1 1 -fmt/scan.go:1120.5,1121.50 2 1 -fmt/scan.go:1114.21,1117.6 2 1 -fmt/scan.go:1117.11,1119.6 1 1 -fmt/scan.go:1123.34,1125.43 2 1 -fmt/scan.go:1128.5,1128.40 1 1 -fmt/scan.go:1125.43,1127.6 1 1 -fmt/scan.go:1128.40,1130.6 1 1 -fmt/scan.go:1132.21,1134.22 2 1 -fmt/scan.go:1144.5,1144.43 1 1 -fmt/scan.go:1147.5,1147.22 1 1 -fmt/scan.go:1134.22,1137.43 1 1 -fmt/scan.go:1140.6,1140.24 1 1 -fmt/scan.go:1137.43,1139.7 1 1 -fmt/scan.go:1140.24,1142.7 1 1 -fmt/scan.go:1144.43,1146.6 1 1 -fmt/scan.go:1147.22,1149.6 1 1 -fmt/scan.go:1155.18,1157.26 1 1 -fmt/scan.go:1161.4,1162.20 2 1 -fmt/scan.go:1165.4,1165.10 1 1 -fmt/scan.go:1157.26,1159.5 1 1 -fmt/scan.go:1162.20,1164.5 1 1 -fmt/scan.go:1170.21,1173.4 2 1 -fmt/scan.go:1181.84,1185.24 3 1 -fmt/scan.go:1234.2,1234.27 1 1 -fmt/scan.go:1237.2,1237.8 1 1 -fmt/scan.go:1185.24,1187.12 2 1 -fmt/scan.go:1192.3,1192.23 1 1 -fmt/scan.go:1200.3,1205.18 4 1 -fmt/scan.go:1209.3,1212.15 3 1 -fmt/scan.go:1215.3,1215.15 1 1 -fmt/scan.go:1219.3,1220.46 2 1 -fmt/scan.go:1224.3,1224.29 1 1 -fmt/scan.go:1228.3,1232.23 4 1 -fmt/scan.go:1187.12,1189.12 2 1 -fmt/scan.go:1192.23,1194.13 1 1 -fmt/scan.go:1198.4,1198.9 1 0 -fmt/scan.go:1194.13,1196.5 1 1 -fmt/scan.go:1205.18,1207.4 1 1 -fmt/scan.go:1212.15,1214.4 1 1 -fmt/scan.go:1215.15,1217.12 2 1 -fmt/scan.go:1220.46,1222.4 1 1 -fmt/scan.go:1224.29,1226.9 2 1 -fmt/scan.go:1234.27,1236.3 1 1 From 1613777b53c6c1914c1995466c8d7da1d6ca9828 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 09:55:56 -0500 Subject: [PATCH 05/28] ran format --- cmd/deployment_test.go | 2 -- messages/messages.go | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index df637af57..d678edd35 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -621,7 +621,6 @@ func TestDeploymentDeleteHardResponseNo(t *testing.T) { defer func() { os.Stdin = stdin }() os.Stdin = r - _, output, err := executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") assert.NoError(t, err) assert.Contains(t, output, expectedOut) @@ -673,7 +672,6 @@ func TestDeploymentDeleteHardResponseYes(t *testing.T) { defer func() { os.Stdin = stdin }() os.Stdin = r - _, output, err := executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") assert.NoError(t, err) assert.Contains(t, output, expectedOut) diff --git a/messages/messages.go b/messages/messages.go index 8f360502e..9a55a82fb 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -6,18 +6,18 @@ var ( ERROR_INVALID_AIRFLOW_VERSION = "Unsupported Airflow Version specified. Please choose from: %s \n" ERROR_NEW_MAJOR_VERSION = "There is an update for Astro CLI. You're using version %s, but %s is the server version.\nPlease upgrade to the matching version before continuing. See https://www.astronomer.io/docs/cli-quickstart for more information.\nTo skip this check use the --skip-version-check flag.\n" - CLI_CMD_DEPRECATE = "Deprecated in favor of %s\n" - CLI_CURR_VERSION = "Astro CLI Version: %s" - CLI_CURR_COMMIT = "Git Commit: %s" - CLI_CURR_VERSION_DATE = CLI_CURR_VERSION + " (%s)" - CLI_LATEST_VERSION = "Astro CLI Latest: %s" - CLI_LATEST_VERSION_DATE = CLI_LATEST_VERSION + " (%s)" - CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" - CLI_RUNNING_LATEST = "You are running the latest version." - CLI_CHOOSE_WORKSPACE = "Please choose a workspace:" - CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" - CLI_UPGRADE_PROMPT = "A newer version of the Astronomer CLI is available.\nTo upgrade to latest, run:" - CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" + CLI_CMD_DEPRECATE = "Deprecated in favor of %s\n" + CLI_CURR_VERSION = "Astro CLI Version: %s" + CLI_CURR_COMMIT = "Git Commit: %s" + CLI_CURR_VERSION_DATE = CLI_CURR_VERSION + " (%s)" + CLI_LATEST_VERSION = "Astro CLI Latest: %s" + CLI_LATEST_VERSION_DATE = CLI_LATEST_VERSION + " (%s)" + CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" + CLI_RUNNING_LATEST = "You are running the latest version." + CLI_CHOOSE_WORKSPACE = "Please choose a workspace:" + CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" + CLI_UPGRADE_PROMPT = "A newer version of the Astronomer CLI is available.\nTo upgrade to latest, run:" + CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nThis operation is irreversible and permanent. Are you sure?" CONFIG_CREATE_DIR_ERROR = "Error creating config directory\n" From 3a95a740b93fbece2a99b61bb05f9ac58f9d6ae0 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 10:23:41 -0500 Subject: [PATCH 06/28] fix exiting when they not sure --- cmd/deployment.go | 6 ++++-- cmd/deployment_test.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index b9e8e5f86..847aec8d9 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "io" + "os" "strings" "github.com/astronomer/astro-cli/deployment" @@ -419,8 +420,9 @@ func deploymentDelete(cmd *cobra.Command, args []string, client *houston.Client, fmt.Sprintf(messages.CLI_DEPLOYMENT_HARD_DELETE_PROMPT)) if !i { - fmt.Println("Not permanently deleting...") - hardDelete = false + fmt.Println("No command was executed") + os.Exit(1) + } } return deployment.Delete(args[0], hardDelete, client, out) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index d678edd35..0655b3935 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -577,7 +577,7 @@ func TestDeploymentDelete(t *testing.T) { func TestDeploymentDeleteHardResponseNo(t *testing.T) { testUtil.InitTestConfig() - expectedOut := `Successfully deleted deployment` + expectedOut := `No command was executed` okResponse := `{ "data": { "appConfig": {"nfsMountDagDeployment": false}, From 34d35866797796fc9071cb2e3dc480d011f5c8fa Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 10:27:46 -0500 Subject: [PATCH 07/28] refactor prompt for hard delete --- messages/messages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/messages.go b/messages/messages.go index 9a55a82fb..ba223d2f1 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -18,7 +18,7 @@ var ( CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" CLI_UPGRADE_PROMPT = "A newer version of the Astronomer CLI is available.\nTo upgrade to latest, run:" CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" - CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nThis operation is irreversible and permanent. Are you sure?" + CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nWarning: This action permanently deletes all data associated with this Deployment.\nYou will not be able to recover any part of your Deployment even with the assistance of Astronomer support.\nProceed with the hard delete?" CONFIG_CREATE_DIR_ERROR = "Error creating config directory\n" CONFIG_CREATE_HOME_ERROR = "Error creating default config in home dir: %s" From 2e8e1674254d4c61f81151f35e0fdddf1514d1c3 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 10:29:47 -0500 Subject: [PATCH 08/28] refactor info message for hard --- cmd/deployment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index 847aec8d9..678a9cbfb 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -148,7 +148,7 @@ func newDeploymentDeleteCmd(client *houston.Client, out io.Writer) *cobra.Comman return deploymentDelete(cmd, args, client, out) }, } - cmd.Flags().BoolVar(&hardDelete, "hard", false, "This will permanently delete this resource") + cmd.Flags().BoolVar(&hardDelete, "hard", false, "Deletes all infrastructure and records for this Deployment") return cmd } From 9edefaf9a4fb102c5df18cbf0a694269d2e4e845 Mon Sep 17 00:00:00 2001 From: Greg Neiheisel <1036482+schnie@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:35:24 -0400 Subject: [PATCH 09/28] Remove @schnie from CODEOWNERS --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 8ff2be1da..3994dc74f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @schnie @andriisoldatenko @adam2k +* @andriisoldatenko @adam2k From 4553c79bc30e5ab538483d63b4e4eb5a8845a952 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 12:17:18 -0500 Subject: [PATCH 10/28] fix tests --- cmd/deployment.go | 4 +--- cmd/deployment_test.go | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index 678a9cbfb..c78ed1a56 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -3,7 +3,6 @@ package cmd import ( "fmt" "io" - "os" "strings" "github.com/astronomer/astro-cli/deployment" @@ -421,8 +420,7 @@ func deploymentDelete(cmd *cobra.Command, args []string, client *houston.Client, if !i { fmt.Println("No command was executed") - os.Exit(1) - + return errors.New("No command was executed"); } } return deployment.Delete(args[0], hardDelete, client, out) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 0655b3935..cb19dce2e 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -621,9 +621,8 @@ func TestDeploymentDeleteHardResponseNo(t *testing.T) { defer func() { os.Stdin = stdin }() os.Stdin = r - _, output, err := executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") - assert.NoError(t, err) - assert.Contains(t, output, expectedOut) + _, _, err = executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") + assert.Contains(t, err, expectedOut) } func TestDeploymentDeleteHardResponseYes(t *testing.T) { From 9cbce0c115340acfd6c269d3d636689c6187105c Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 12:25:47 -0500 Subject: [PATCH 11/28] fix calling string for error in test --- cmd/deployment_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index cb19dce2e..35de0b1df 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -622,7 +622,7 @@ func TestDeploymentDeleteHardResponseNo(t *testing.T) { os.Stdin = r _, _, err = executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") - assert.Contains(t, err, expectedOut) + assert.Contains(t, err.Error(), expectedOut) } func TestDeploymentDeleteHardResponseYes(t *testing.T) { From 3ab6b3d798fbf1e0f49bce04a81cdf4de93080d1 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 12:56:08 -0500 Subject: [PATCH 12/28] refactor text on no --- cmd/deployment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index c78ed1a56..9f58ec0ae 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -419,7 +419,7 @@ func deploymentDelete(cmd *cobra.Command, args []string, client *houston.Client, fmt.Sprintf(messages.CLI_DEPLOYMENT_HARD_DELETE_PROMPT)) if !i { - fmt.Println("No command was executed") + fmt.Println("Exit: This command was not executed and your Deployment was not hard deleted.\n If you want to delete your Deployment but not permanently, try\n $ astro deployment delete without the --hard flag.") return errors.New("No command was executed"); } } From 6777d3e1177fc540d5d17f17af2eeb1f9cfe41d1 Mon Sep 17 00:00:00 2001 From: "Nicolas A. Botello Jr" Date: Thu, 8 Jul 2021 13:33:50 -0500 Subject: [PATCH 13/28] Update messages/messages.go Co-authored-by: Paola Peraza Calderon --- messages/messages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/messages.go b/messages/messages.go index ba223d2f1..e9f6ed476 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -18,7 +18,7 @@ var ( CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n" CLI_UPGRADE_PROMPT = "A newer version of the Astronomer CLI is available.\nTo upgrade to latest, run:" CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" - CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nWarning: This action permanently deletes all data associated with this Deployment.\nYou will not be able to recover any part of your Deployment even with the assistance of Astronomer support.\nProceed with the hard delete?" + CLI_DEPLOYMENT_HARD_DELETE_PROMPT = "\nWarning: This action permanently deletes all data associated with this Deployment, including the database. You will not be able to recover it. Proceed with hard delete?" CONFIG_CREATE_DIR_ERROR = "Error creating config directory\n" CONFIG_CREATE_HOME_ERROR = "Error creating default config in home dir: %s" From 9865c70bf954aaaccc5c6877f4b3143a43abbf11 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 13:49:11 -0500 Subject: [PATCH 14/28] dont throw error shows up on cli output --- cmd/deployment.go | 2 +- cmd/deployment_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index 9f58ec0ae..d37d0170d 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -420,7 +420,7 @@ func deploymentDelete(cmd *cobra.Command, args []string, client *houston.Client, if !i { fmt.Println("Exit: This command was not executed and your Deployment was not hard deleted.\n If you want to delete your Deployment but not permanently, try\n $ astro deployment delete without the --hard flag.") - return errors.New("No command was executed"); + return nil } } return deployment.Delete(args[0], hardDelete, client, out) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 35de0b1df..b711bc930 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -577,7 +577,6 @@ func TestDeploymentDelete(t *testing.T) { func TestDeploymentDeleteHardResponseNo(t *testing.T) { testUtil.InitTestConfig() - expectedOut := `No command was executed` okResponse := `{ "data": { "appConfig": {"nfsMountDagDeployment": false}, @@ -622,7 +621,7 @@ func TestDeploymentDeleteHardResponseNo(t *testing.T) { os.Stdin = r _, _, err = executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") - assert.Contains(t, err.Error(), expectedOut) + assert.Nil(t, err); } func TestDeploymentDeleteHardResponseYes(t *testing.T) { From e4d874b7f1c544033e64f50db2c4f4aa611822b1 Mon Sep 17 00:00:00 2001 From: bote795 Date: Thu, 8 Jul 2021 17:17:31 -0500 Subject: [PATCH 15/28] refactor get sa workspace/deployments new query --- cmd/deployment.go | 7 +--- cmd/workspace.go | 2 +- houston/queries.go | 65 ++++++++++++++++++++++++++++++++ houston/types.go | 5 ++- serviceaccount/serviceaccount.go | 62 ++++++++++++++++++++++++++++++ 5 files changed, 133 insertions(+), 8 deletions(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index 1a76be9c5..7e2d8a2be 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -66,10 +66,7 @@ var ( $ astro deployment service-account create --deployment-id=xxxxx --label=my_label --role=ROLE ` deploymentSaGetExample = ` - # Get deployment service-account - $ astro deployment service-account get --deployment-id= - - # or using deployment-id + # Get deployment service-accounts $ astro deployment service-account get --deployment-id= ` deploymentSaDeleteExample = ` @@ -519,7 +516,7 @@ func deploymentSaGet(cmd *cobra.Command, client *houston.Client, out io.Writer) // Silence Usage as we have now validated command input cmd.SilenceUsage = true - return sa.Get("DEPLOYMENT", deploymentId, client, out) + return sa.GetDeploymentServiceAccounts(deploymentId, client, out) } func deploymentSaDelete(cmd *cobra.Command, args []string, client *houston.Client, out io.Writer) error { diff --git a/cmd/workspace.go b/cmd/workspace.go index f661c7424..260809195 100644 --- a/cmd/workspace.go +++ b/cmd/workspace.go @@ -377,7 +377,7 @@ func workspaceSaGet(cmd *cobra.Command, args []string, client *houston.Client, o // Silence Usage as we have now validated command input cmd.SilenceUsage = true - return sa.Get("WORKSPACE", workspaceId, client, out) + return sa.GetWorkspaceServiceAccounts(workspaceId, client, out) } func workspaceSaDelete(cmd *cobra.Command, args []string, client *houston.Client, out io.Writer) error { diff --git a/houston/queries.go b/houston/queries.go index e0c549ad4..6fa58d1d4 100644 --- a/houston/queries.go +++ b/houston/queries.go @@ -284,6 +284,71 @@ mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $cloudRole: Str } }` + DeploymentServiceAccountGetRequest = ` + query GetDeploymentServiceAccount( + $deploymentUuid: Uuid! + $serviceAccountUuid: Uuid! + ){ + deploymentServiceAccount( + deploymentUuid: $deploymentUuid + serviceAccountUuid: $serviceAccountUuid + ){ + id + apiKey + label + category + entityType + entityUuid + active + createdAt + updatedAt + lastUsedAt + } + } + ` + + DeploymentServiceAccountsGetRequest = ` + query GetDeploymentServiceAccounts( + $deploymentUuid: Uuid! + ){ + deploymentServiceAccounts( + deploymentUuid: $deploymentUuid + ){ + id + apiKey + label + category + entityType + entityUuid + active + createdAt + updatedAt + lastUsedAt + } + } + ` + + WorkspaceServiceAccountsGetRequest = ` + query GetWorkspaceServiceAccounts( + $workspaceUuid: Uuid! + ){ + workspaceServiceAccounts( + workspaceUuid: $workspaceUuid + ){ + id + apiKey + label + category + entityType + entityUuid + active + createdAt + updatedAt + lastUsedAt + } + } + ` + ServiceAccountsGetRequest = ` query GetServiceAccount( $serviceAccountId: Uuid diff --git a/houston/types.go b/houston/types.go index 12b2322da..0a08de5f7 100644 --- a/houston/types.go +++ b/houston/types.go @@ -30,6 +30,9 @@ type Response struct { GetAuthConfig *AuthConfig `json:"authConfig,omitempty"` GetAppConfig *AppConfig `json:"appConfig,omitempty"` GetServiceAccounts []ServiceAccount `json:"serviceAccounts,omitempty"` + GetDeploymentServiceAccounts []ServiceAccount `json:"deploymentServiceAccounts,omitempty"` + GetWorkspaceServiceAccounts []ServiceAccount `json:"workspaceServiceAccounts,omitempty"` + GetDeploymentServiceAccount *ServiceAccount `json:"deploymentServiceAccount,omitempty"` GetUsers []User `json:"users,omitempty"` GetWorkspaces []Workspace `json:"workspaces,omitempty"` UpdateDeployment *Deployment `json:"updateDeployment,omitempty"` @@ -126,8 +129,6 @@ type ServiceAccount struct { ApiKey string `json:"apiKey"` Label string `json:"label"` Category string `json:"category"` - EntityType string `json:"entityType"` - EntityId string `json:"entityUuid"` LastUsedAt string `json:"lastUsedAt"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` diff --git a/serviceaccount/serviceaccount.go b/serviceaccount/serviceaccount.go index 30d44aa41..5db0da41c 100644 --- a/serviceaccount/serviceaccount.go +++ b/serviceaccount/serviceaccount.go @@ -117,3 +117,65 @@ func Get(entityType, id string, client *houston.Client, out io.Writer) error { return tab.Print(out) } + +// get all deployment service accounts +func GetDeploymentServiceAccounts(id string, client *houston.Client, out io.Writer) error { + req := houston.Request{ + Query: houston.DeploymentServiceAccountsGetRequest, + Variables: map[string]interface{}{"deploymentUuid": id}, + } + + resp, err := req.DoWithClient(client) + if err != nil { + return err + } + + sas := resp.Data.GetDeploymentServiceAccounts + fmt.Print(len(sas)) + tab := newTableOut() + for _, sa := range sas { + tab.AddRow([]string{sa.Label, sa.Category, sa.Id, sa.ApiKey}, false) + } + + return tab.Print(out) +} + +// get single deployment service account +func GetDeploymentServiceAccount(deploymentId string, serviceAccountId string, client *houston.Client, out io.Writer) error { + req := houston.Request{ + Query: houston.DeploymentServiceAccountGetRequest, + Variables: map[string]interface{}{"deploymentUuid": deploymentId, "serviceAccountUuid": serviceAccountId}, + } + + resp, err := req.DoWithClient(client) + if err != nil { + return err + } + + sas := resp.Data.GetDeploymentServiceAccount + tab := newTableOut() + tab.AddRow([]string{sas.Label, sas.Category, sas.Id, sas.ApiKey}, false) + + return tab.Print(out) +} + +// get all workspace service accounts +func GetWorkspaceServiceAccounts(id string, client *houston.Client, out io.Writer) error { + req := houston.Request{ + Query: houston.WorkspaceServiceAccountsGetRequest, + Variables: map[string]interface{}{"workspaceUuid": id}, + } + + resp, err := req.DoWithClient(client) + if err != nil { + return err + } + + sas := resp.Data.GetWorkspaceServiceAccounts + tab := newTableOut() + for _, sa := range sas { + tab.AddRow([]string{sa.Label, sa.Category, sa.Id, sa.ApiKey}, false) + } + + return tab.Print(out) +} From 0918ea995a94a2db9ce0c0bdea75224476dba862 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 09:31:01 -0500 Subject: [PATCH 16/28] remove single get service account --- houston/queries.go | 24 ------------------------ houston/types.go | 1 - serviceaccount/serviceaccount.go | 18 ------------------ 3 files changed, 43 deletions(-) diff --git a/houston/queries.go b/houston/queries.go index 6fa58d1d4..ea4724de3 100644 --- a/houston/queries.go +++ b/houston/queries.go @@ -283,30 +283,6 @@ mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $cloudRole: Str } } }` - - DeploymentServiceAccountGetRequest = ` - query GetDeploymentServiceAccount( - $deploymentUuid: Uuid! - $serviceAccountUuid: Uuid! - ){ - deploymentServiceAccount( - deploymentUuid: $deploymentUuid - serviceAccountUuid: $serviceAccountUuid - ){ - id - apiKey - label - category - entityType - entityUuid - active - createdAt - updatedAt - lastUsedAt - } - } - ` - DeploymentServiceAccountsGetRequest = ` query GetDeploymentServiceAccounts( $deploymentUuid: Uuid! diff --git a/houston/types.go b/houston/types.go index 0a08de5f7..16866b91c 100644 --- a/houston/types.go +++ b/houston/types.go @@ -32,7 +32,6 @@ type Response struct { GetServiceAccounts []ServiceAccount `json:"serviceAccounts,omitempty"` GetDeploymentServiceAccounts []ServiceAccount `json:"deploymentServiceAccounts,omitempty"` GetWorkspaceServiceAccounts []ServiceAccount `json:"workspaceServiceAccounts,omitempty"` - GetDeploymentServiceAccount *ServiceAccount `json:"deploymentServiceAccount,omitempty"` GetUsers []User `json:"users,omitempty"` GetWorkspaces []Workspace `json:"workspaces,omitempty"` UpdateDeployment *Deployment `json:"updateDeployment,omitempty"` diff --git a/serviceaccount/serviceaccount.go b/serviceaccount/serviceaccount.go index 5db0da41c..e59153234 100644 --- a/serviceaccount/serviceaccount.go +++ b/serviceaccount/serviceaccount.go @@ -140,24 +140,6 @@ func GetDeploymentServiceAccounts(id string, client *houston.Client, out io.Writ return tab.Print(out) } -// get single deployment service account -func GetDeploymentServiceAccount(deploymentId string, serviceAccountId string, client *houston.Client, out io.Writer) error { - req := houston.Request{ - Query: houston.DeploymentServiceAccountGetRequest, - Variables: map[string]interface{}{"deploymentUuid": deploymentId, "serviceAccountUuid": serviceAccountId}, - } - - resp, err := req.DoWithClient(client) - if err != nil { - return err - } - - sas := resp.Data.GetDeploymentServiceAccount - tab := newTableOut() - tab.AddRow([]string{sas.Label, sas.Category, sas.Id, sas.ApiKey}, false) - - return tab.Print(out) -} // get all workspace service accounts func GetWorkspaceServiceAccounts(id string, client *houston.Client, out io.Writer) error { From 2df8a5b32c62e82702e22cedb9a66fef01ba7d67 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 09:49:14 -0500 Subject: [PATCH 17/28] add tests for service account --- serviceaccount/serviceaccount_test.go | 81 ++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/serviceaccount/serviceaccount_test.go b/serviceaccount/serviceaccount_test.go index 791188f9f..635f398b3 100644 --- a/serviceaccount/serviceaccount_test.go +++ b/serviceaccount/serviceaccount_test.go @@ -2,12 +2,13 @@ package deployment import ( "bytes" - "github.com/astronomer/astro-cli/houston" - testUtil "github.com/astronomer/astro-cli/pkg/testing" - "github.com/stretchr/testify/assert" "io/ioutil" "net/http" "testing" + + "github.com/astronomer/astro-cli/houston" + testUtil "github.com/astronomer/astro-cli/pkg/testing" + "github.com/stretchr/testify/assert" ) func TestCreateUsingDeploymentUUID(t *testing.T) { @@ -147,3 +148,77 @@ func TestDeleteUsingDeploymentUUID(t *testing.T) { ` assert.Equal(t, buf.String(), expectedOut) } + +func TestGetDeploymentServiceAccount(t *testing.T) { + testUtil.InitTestConfig() + okResponse := ` + { + "data": { + "deploymentServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewBufferString(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + deploymentUuid := "ckqvf9spa1189rn9hbh5h439u" + buf := new(bytes.Buffer) + err := GetDeploymentServiceAccounts(deploymentUuid, api, buf) + assert.NoError(t, err) + expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` + assert.Contains(t, buf.String(), expectedOut) +} + +func TestGetWorkspaceServiceAccount(t *testing.T) { + testUtil.InitTestConfig() + okResponse := ` + { + "data": { + "workspaceServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(bytes.NewBufferString(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + deploymentUuid := "ckqvf9spa1189rn9hbh5h439u" + buf := new(bytes.Buffer) + err := GetWorkspaceServiceAccounts(deploymentUuid, api, buf) + assert.NoError(t, err) + expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` + assert.Contains(t, buf.String(), expectedOut) +} From e8b2d3aa10f7bed10cd3f5ae3dc81626b62ac9bd Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:01:58 -0500 Subject: [PATCH 18/28] add test for deployment cmd --- cmd/deployment_test.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 4096e61fd..af2cb9c91 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -538,3 +538,40 @@ func TestDeploymentAirflowUpgradeCancelCommand(t *testing.T) { assert.NoError(t, err) assert.Contains(t, output, expectedOut) } + +func TestDeploymentSAGetCommand(t *testing.T) { + testUtil.InitTestConfig() + expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` + okResponse := ` + { + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deploymentServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + + _, output, err := executeCommandC(api, "deployment", "sa", "get", "--deployment-id=ckqvf9spa1189rn9hbh5h439u") + assert.NoError(t, err) + assert.Contains(t, output, expectedOut) +} From 7d958b3a8319c292900bd7820bac89b2ef1d43b7 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:02:21 -0500 Subject: [PATCH 19/28] refactor text for command --- cmd/deployment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/deployment.go b/cmd/deployment.go index 7e2d8a2be..7024c68c0 100644 --- a/cmd/deployment.go +++ b/cmd/deployment.go @@ -312,8 +312,8 @@ func newDeploymentSaCreateCmd(client *houston.Client, out io.Writer) *cobra.Comm func newDeploymentSaGetCmd(client *houston.Client, out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "get", - Short: "Get a service-account by entity type and entity id", - Long: "Get a service-account by entity type and entity id", + Short: "Get a service-account by deployment id", + Long: "Get a service-account by deployment id", Example: deploymentSaGetExample, RunE: func(cmd *cobra.Command, args []string) error { return deploymentSaGet(cmd, client, out) From 57dbf4bf3ec751565e3d30f6e9d87297e924dcc7 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:28:45 -0500 Subject: [PATCH 20/28] remove old code --- houston/queries.go | 25 ------------------------- houston/types.go | 1 - serviceaccount/serviceaccount.go | 19 ------------------- 3 files changed, 45 deletions(-) diff --git a/houston/queries.go b/houston/queries.go index ea4724de3..310d16ef6 100644 --- a/houston/queries.go +++ b/houston/queries.go @@ -324,31 +324,6 @@ mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $cloudRole: Str } } ` - - ServiceAccountsGetRequest = ` - query GetServiceAccount( - $serviceAccountId: Uuid - $entityId: Uuid - $entityType: EntityType! - ) { - serviceAccounts( - serviceAccountUuid: $serviceAccountId - entityType: $entityType - entityUuid: $entityId - ) { - id - apiKey - label - category - entityType - entityUuid - active - createdAt - updatedAt - lastUsedAt - } - }` - TokenBasicCreateRequest = ` mutation createBasicToken($identity: String, $password: String!) { createToken(identity: $identity, password: $password) { diff --git a/houston/types.go b/houston/types.go index 16866b91c..3362e0d64 100644 --- a/houston/types.go +++ b/houston/types.go @@ -29,7 +29,6 @@ type Response struct { GetDeployments []Deployment `json:"workspaceDeployments,omitempty"` GetAuthConfig *AuthConfig `json:"authConfig,omitempty"` GetAppConfig *AppConfig `json:"appConfig,omitempty"` - GetServiceAccounts []ServiceAccount `json:"serviceAccounts,omitempty"` GetDeploymentServiceAccounts []ServiceAccount `json:"deploymentServiceAccounts,omitempty"` GetWorkspaceServiceAccounts []ServiceAccount `json:"workspaceServiceAccounts,omitempty"` GetUsers []User `json:"users,omitempty"` diff --git a/serviceaccount/serviceaccount.go b/serviceaccount/serviceaccount.go index e59153234..a09541e5c 100644 --- a/serviceaccount/serviceaccount.go +++ b/serviceaccount/serviceaccount.go @@ -98,25 +98,6 @@ func DeleteUsingDeploymentUUID(serviceAccountId, deploymentId string, client *ho return nil } -func Get(entityType, id string, client *houston.Client, out io.Writer) error { - req := houston.Request{ - Query: houston.ServiceAccountsGetRequest, - Variables: map[string]interface{}{"entityId": id, "entityType": entityType}, - } - - resp, err := req.DoWithClient(client) - if err != nil { - return err - } - - sas := resp.Data.GetServiceAccounts - tab := newTableOut() - for _, sa := range sas { - tab.AddRow([]string{sa.Label, sa.Category, sa.Id, sa.ApiKey}, false) - } - - return tab.Print(out) -} // get all deployment service accounts func GetDeploymentServiceAccounts(id string, client *houston.Client, out io.Writer) error { From 912839011f2aa476ef876e92ff5be75abc39f7d4 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:31:50 -0500 Subject: [PATCH 21/28] test for workspaceSAGet --- cmd/workspace_test.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/cmd/workspace_test.go b/cmd/workspace_test.go index 85d544845..71e9cd6ae 100644 --- a/cmd/workspace_test.go +++ b/cmd/workspace_test.go @@ -4,6 +4,7 @@ import ( "bytes" "io/ioutil" "net/http" + "strings" "testing" testUtil "github.com/astronomer/astro-cli/pkg/testing" @@ -92,3 +93,40 @@ Successfully removed user from workspace assert.NoError(t, err) assert.Equal(t, expected, buf.String()) } + +func TestWorkspaceSAGetCommand(t *testing.T) { + testUtil.InitTestConfig() + expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` + okResponse := ` + { + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "workspaceServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } + }` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(okResponse)), + Header: make(http.Header), + } + }) + api := houston.NewHoustonClient(client) + + _, output, err := executeCommandC(api, "workspace", "sa", "get", "-w=ckqvf9spa1189rn9hbh5h439u") + assert.NoError(t, err) + assert.Contains(t, output, expectedOut) +} From 5b9470e1f2ba6f9fb43f3164897b99dca5f5ae68 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:33:24 -0500 Subject: [PATCH 22/28] update workspace sa get msg --- cmd/workspace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/workspace.go b/cmd/workspace.go index 260809195..f5ea3c023 100644 --- a/cmd/workspace.go +++ b/cmd/workspace.go @@ -231,8 +231,8 @@ func newWorkspaceSaCreateCmd(client *houston.Client, out io.Writer) *cobra.Comma func newWorkspaceSaGetCmd(client *houston.Client, out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "get", - Short: "Get a Service Account by entity type and entity id", - Long: "Get a Service Account by entity type and entity id", + Short: "Get a Service Account by workspace", + Long: "Get a Service Account by workspace", Example: workspaceSaGetExample, RunE: func(cmd *cobra.Command, args []string) error { return workspaceSaGet(cmd, args, client, out) From dc78f21bbe1231c827c901fdd268b484aa1195d9 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 10:45:11 -0500 Subject: [PATCH 23/28] remove old test --- cmd/deployment_test.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index af2cb9c91..3c4733860 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -297,42 +297,6 @@ func TestDeploymentSaDeleteRootCommand(t *testing.T) { assert.Contains(t, output, "Service Account my_label (q1w2e3r4t5y6u7i8o9p0) successfully deleted") } -func TestDeploymentSaGetCommand(t *testing.T) { - testUtil.InitTestConfig() - expectedOut := ` NAME CATEGORY ID APIKEY - my_label default q1w2e3r4t5y6u7i8o9p0 000000000000000000000000 -` - okResponse := `{ - "data": { - "appConfig": {"nfsMountDagDeployment": false}, - "serviceAccounts": [{ - "id": "q1w2e3r4t5y6u7i8o9p0", - "apiKey": "000000000000000000000000", - "label": "my_label", - "category": "default", - "entityType": "DEPLOYMENT", - "entityUuid": null, - "active": true, - "createdAt": "2019-10-16T21:14:22.105Z", - "updatedAt": "2019-10-16T21:14:22.105Z", - "lastUsedAt": null - }] - } -}` - client := testUtil.NewTestClient(func(req *http.Request) *http.Response { - return &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewBufferString(okResponse)), - Header: make(http.Header), - } - }) - api := houston.NewHoustonClient(client) - - _, output, err := executeCommandC(api, "deployment", "service-account", "get", "--deployment-id=q1w2e3r4t5y6u7i8o9p0") - assert.NoError(t, err) - assert.Equal(t, expectedOut, output) -} - func TestDeploymentSaCreateCommand(t *testing.T) { testUtil.InitTestConfig() expectedOut := ` NAME CATEGORY ID APIKEY From 83d7a6a80c89b02b604857eb0837cf7c41aea98f Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 11:02:25 -0500 Subject: [PATCH 24/28] refactor spacing for json --- cmd/deployment_test.go | 42 +++++++-------- cmd/workspace_test.go | 42 +++++++-------- serviceaccount/serviceaccount.go | 2 - serviceaccount/serviceaccount_test.go | 73 ++++++++++++++------------- 4 files changed, 80 insertions(+), 79 deletions(-) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 3c4733860..2c2cccfc2 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -507,26 +507,26 @@ func TestDeploymentSAGetCommand(t *testing.T) { testUtil.InitTestConfig() expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` okResponse := ` - { - "data": { - "appConfig": {"nfsMountDagDeployment": false}, - "deploymentServiceAccounts": [ - { - "id": "ckqvfa2cu1468rn9hnr0bqqfk", - "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", - "label": "yooo can u see me test", - "category": "", - "entityType": "DEPLOYMENT", - "entityUuid": null, - "active": true, - "createdAt": "2021-07-08T21:28:57.966Z", - "updatedAt": "2021-07-08T21:28:57.967Z", - "lastUsedAt": null - } - ] - } - }` - client := testUtil.NewTestClient(func(req *http.Request) *http.Response { +{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "deploymentServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } +}` +client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, Body: ioutil.NopCloser(strings.NewReader(okResponse)), @@ -535,7 +535,7 @@ func TestDeploymentSAGetCommand(t *testing.T) { }) api := houston.NewHoustonClient(client) - _, output, err := executeCommandC(api, "deployment", "sa", "get", "--deployment-id=ckqvf9spa1189rn9hbh5h439u") + _, output, err := executeCommandC(api, "deployment", "sa", "get", "--deployment-id=ckqvf9spa1189rn9hbh5h439u") assert.NoError(t, err) assert.Contains(t, output, expectedOut) } diff --git a/cmd/workspace_test.go b/cmd/workspace_test.go index 71e9cd6ae..8765a9cfa 100644 --- a/cmd/workspace_test.go +++ b/cmd/workspace_test.go @@ -98,25 +98,27 @@ func TestWorkspaceSAGetCommand(t *testing.T) { testUtil.InitTestConfig() expectedOut := ` yooo can u see me test ckqvfa2cu1468rn9hnr0bqqfk 658b304f36eaaf19860a6d9eb73f7d8a` okResponse := ` - { - "data": { - "appConfig": {"nfsMountDagDeployment": false}, - "workspaceServiceAccounts": [ - { - "id": "ckqvfa2cu1468rn9hnr0bqqfk", - "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", - "label": "yooo can u see me test", - "category": "", - "entityType": "DEPLOYMENT", - "entityUuid": null, - "active": true, - "createdAt": "2021-07-08T21:28:57.966Z", - "updatedAt": "2021-07-08T21:28:57.967Z", - "lastUsedAt": null - } - ] - } - }` +{ + "data": { + "appConfig": {"nfsMountDagDeployment": false}, + "workspaceServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } +}` + + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, @@ -126,7 +128,7 @@ func TestWorkspaceSAGetCommand(t *testing.T) { }) api := houston.NewHoustonClient(client) - _, output, err := executeCommandC(api, "workspace", "sa", "get", "-w=ckqvf9spa1189rn9hbh5h439u") + _, output, err := executeCommandC(api, "workspace", "sa", "get", "-w=ckqvf9spa1189rn9hbh5h439u") assert.NoError(t, err) assert.Contains(t, output, expectedOut) } diff --git a/serviceaccount/serviceaccount.go b/serviceaccount/serviceaccount.go index a09541e5c..4c40bc47a 100644 --- a/serviceaccount/serviceaccount.go +++ b/serviceaccount/serviceaccount.go @@ -98,7 +98,6 @@ func DeleteUsingDeploymentUUID(serviceAccountId, deploymentId string, client *ho return nil } - // get all deployment service accounts func GetDeploymentServiceAccounts(id string, client *houston.Client, out io.Writer) error { req := houston.Request{ @@ -121,7 +120,6 @@ func GetDeploymentServiceAccounts(id string, client *houston.Client, out io.Writ return tab.Print(out) } - // get all workspace service accounts func GetWorkspaceServiceAccounts(id string, client *houston.Client, out io.Writer) error { req := houston.Request{ diff --git a/serviceaccount/serviceaccount_test.go b/serviceaccount/serviceaccount_test.go index 635f398b3..e31a37987 100644 --- a/serviceaccount/serviceaccount_test.go +++ b/serviceaccount/serviceaccount_test.go @@ -152,24 +152,24 @@ func TestDeleteUsingDeploymentUUID(t *testing.T) { func TestGetDeploymentServiceAccount(t *testing.T) { testUtil.InitTestConfig() okResponse := ` - { - "data": { - "deploymentServiceAccounts": [ - { - "id": "ckqvfa2cu1468rn9hnr0bqqfk", - "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", - "label": "yooo can u see me test", - "category": "", - "entityType": "DEPLOYMENT", - "entityUuid": null, - "active": true, - "createdAt": "2021-07-08T21:28:57.966Z", - "updatedAt": "2021-07-08T21:28:57.967Z", - "lastUsedAt": null - } - ] - } - }` +{ + "data": { + "deploymentServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } +}` client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, @@ -189,24 +189,25 @@ func TestGetDeploymentServiceAccount(t *testing.T) { func TestGetWorkspaceServiceAccount(t *testing.T) { testUtil.InitTestConfig() okResponse := ` - { - "data": { - "workspaceServiceAccounts": [ - { - "id": "ckqvfa2cu1468rn9hnr0bqqfk", - "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", - "label": "yooo can u see me test", - "category": "", - "entityType": "DEPLOYMENT", - "entityUuid": null, - "active": true, - "createdAt": "2021-07-08T21:28:57.966Z", - "updatedAt": "2021-07-08T21:28:57.967Z", - "lastUsedAt": null - } - ] - } - }` +{ + "data": { + "workspaceServiceAccounts": [ + { + "id": "ckqvfa2cu1468rn9hnr0bqqfk", + "apiKey": "658b304f36eaaf19860a6d9eb73f7d8a", + "label": "yooo can u see me test", + "category": "", + "entityType": "DEPLOYMENT", + "entityUuid": null, + "active": true, + "createdAt": "2021-07-08T21:28:57.966Z", + "updatedAt": "2021-07-08T21:28:57.967Z", + "lastUsedAt": null + } + ] + } +}` + client := testUtil.NewTestClient(func(req *http.Request) *http.Response { return &http.Response{ StatusCode: 200, From b3800f2d59d550eb10d4639c42216871e0408545 Mon Sep 17 00:00:00 2001 From: "Nicolas A. Botello Jr" Date: Fri, 9 Jul 2021 11:11:15 -0500 Subject: [PATCH 25/28] Update CODEOWNERS (#424) add myself and alex --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 3994dc74f..7e09ff06a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @andriisoldatenko @adam2k +* @andriisoldatenko @adam2k @bote795 @aliotta From a8c97bc33bff100226688bf38a756bbbff4e6044 Mon Sep 17 00:00:00 2001 From: Andrii Soldatenko Date: Fri, 9 Jul 2021 19:11:34 +0300 Subject: [PATCH 26/28] Add an insecure TLS option (#418) * fixup! * resolve conflicts --- config/config.go | 1 + config/types.go | 1 + houston/houston.go | 2 +- main.go | 7 ++++++- pkg/github/github.go | 4 ---- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index d655862c4..cac8a3784 100644 --- a/config/config.go +++ b/config/config.go @@ -55,6 +55,7 @@ var ( WebserverPort: newCfg("webserver.port", "8080"), ShowWarnings: newCfg("show_warnings", "true"), AirflowReleasesURL: newCfg("airflow_releases_url", "https://updates.astronomer.io/astronomer-certified"), + SkipVerifyTLS: newCfg("skip_verify_tls", "false"), } // viperHome is the viper object in the users home directory diff --git a/config/types.go b/config/types.go index e6e70a490..e5c515a27 100644 --- a/config/types.go +++ b/config/types.go @@ -27,6 +27,7 @@ type cfgs struct { WebserverPort cfg ShowWarnings cfg AirflowReleasesURL cfg + SkipVerifyTLS cfg } // Creates a new cfg struct diff --git a/houston/houston.go b/houston/houston.go index 70f5664cf..2169d2567 100644 --- a/houston/houston.go +++ b/houston/houston.go @@ -35,7 +35,7 @@ type Request struct { Variables map[string]interface{} `json:"variables"` } -//Do (request) is a wrapper to more easily pass variables to a client.Do request +// Do (request) is a wrapper to more easily pass variables to a client.Do request func (r *Request) DoWithClient(api *Client) (*Response, error) { doOpts := httputil.DoOptions{ Data: r, diff --git a/main.go b/main.go index 0fb4f8a3b..81273fd12 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,8 @@ package main import ( + "crypto/tls" + "net/http" "os" "github.com/astronomer/astro-cli/cmd" @@ -11,9 +13,12 @@ import ( ) func main() { - client := houston.NewHoustonClient(httputil.NewHTTPClient()) fs := afero.NewOsFs() config.InitConfig(fs) + httpClient := httputil.NewHTTPClient() + // configure http transport + httpClient.HTTPClient.Transport = &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: config.CFG.SkipVerifyTLS.GetBool()}} + client := houston.NewHoustonClient(httpClient) if err := cmd.NewRootCmd(client, os.Stdout).Execute(); err != nil { os.Exit(1) } diff --git a/pkg/github/github.go b/pkg/github/github.go index c36e7d4ff..8d42b0a4a 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -12,10 +12,6 @@ import ( "github.com/pkg/errors" ) -var ( - httpclient = httputil.NewHTTPClient() -) - // RepoLatestResponse represents a tag info response from Github API type RepoLatestResponse struct { Url string `json:"url"` From 1b90e451804864f746bad3c020f940425a10c19e Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 12:19:32 -0500 Subject: [PATCH 27/28] make format --- cmd/deployment_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/deployment_test.go b/cmd/deployment_test.go index 932ae4847..4217bcce6 100644 --- a/cmd/deployment_test.go +++ b/cmd/deployment_test.go @@ -628,7 +628,7 @@ func TestDeploymentDeleteHardResponseNo(t *testing.T) { os.Stdin = r _, _, err = executeCommandC(api, "deployment", "delete", "--hard", "ckqh2dmzc43548h9hxzspysyi") - assert.Nil(t, err); + assert.Nil(t, err) } func TestDeploymentDeleteHardResponseYes(t *testing.T) { From c774d21fe64d0da9a991ebbab342f8bbd13e9db7 Mon Sep 17 00:00:00 2001 From: bote795 Date: Fri, 9 Jul 2021 12:36:43 -0500 Subject: [PATCH 28/28] fix merge conflict removal and add f --- messages/messages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/messages.go b/messages/messages.go index e9f6ed476..52b60a626 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -12,7 +12,7 @@ var ( CLI_CURR_VERSION_DATE = CLI_CURR_VERSION + " (%s)" CLI_LATEST_VERSION = "Astro CLI Latest: %s" CLI_LATEST_VERSION_DATE = CLI_LATEST_VERSION + " (%s)" - CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" + CLI_INSTALL_CMD = "\t$ curl -fsSL https://install.astronomer.io | sudo bash \nOR for homebrew users:\n\t$ brew install astronomer/tap/astro" CLI_RUNNING_LATEST = "You are running the latest version." CLI_CHOOSE_WORKSPACE = "Please choose a workspace:" CLI_SET_WORKSPACE_EXAMPLE = "\nNo default workspace detected, you can list workspaces with \n\tastro workspace list\nand set your default workspace with \n\tastro workspace switch [WORKSPACEID]\n\n"