diff --git a/cmd/cnbBuild.go b/cmd/cnbBuild.go index a06e29202..90af9fe1d 100644 --- a/cmd/cnbBuild.go +++ b/cmd/cnbBuild.go @@ -432,7 +432,7 @@ func runCnbBuild(config *cnbBuildOptions, telemetryData *telemetry.CustomData, t log.SetErrorCategory(log.ErrorConfiguration) return errors.Wrap(err, "failed to retrieve target image configuration") } - customTelemetryData.Buildpacks.Overall = config.Buildpacks + customTelemetryData.Buildpacks.Overall = privacy.FilterBuildpacks(config.Buildpacks) customTelemetryData.BuildEnv.KeyValues = privacy.FilterEnv(config.BuildEnvVars) telemetry.Data = append(telemetry.Data, customTelemetryData) diff --git a/cmd/cnbBuild_test.go b/cmd/cnbBuild_test.go index 9a1c34aed..6935f86e3 100644 --- a/cmd/cnbBuild_test.go +++ b/cmd/cnbBuild_test.go @@ -520,7 +520,7 @@ uri = "some-buildpack" assert.Equal(t, "11", customData.Data[0].BuildEnv.KeyValues["BP_NODE_VERSION"]) assert.NotContains(t, customData.Data[0].BuildEnv.KeyValues, "PROJECT_KEY") - assert.Contains(t, customData.Data[0].Buildpacks.Overall, "some-buildpack") + assert.Contains(t, customData.Data[0].Buildpacks.Overall, "") }) t.Run("success case (multiple images configured)", func(t *testing.T) { diff --git a/integration/integration_cnb_test.go b/integration/integration_cnb_test.go index 0800fcbce..8512bbef6 100644 --- a/integration/integration_cnb_test.go +++ b/integration/integration_cnb_test.go @@ -85,7 +85,7 @@ func TestProjectDescriptor(t *testing.T) { Network: fmt.Sprintf("container:%s", registryContainer.GetContainerID()), }) - container.whenRunningPiperCommand("cnbBuild", "-v", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) + container.whenRunningPiperCommand("cnbBuild", "-v", "--noTelemetry", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) container.assertHasOutput(t, "running command: /cnb/lifecycle/creator") container.assertHasOutput(t, "Dockerfile doesn't match include pattern, ignoring") @@ -115,7 +115,7 @@ func TestZipPath(t *testing.T) { Network: fmt.Sprintf("container:%s", registryContainer.GetContainerID()), }) - container.whenRunningPiperCommand("cnbBuild", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL, "--path", "go.zip") + container.whenRunningPiperCommand("cnbBuild", "--noTelemetry", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL, "--path", "go.zip") container.assertHasOutput(t, "running command: /cnb/lifecycle/creator") container.assertHasOutput(t, "Installing Go") @@ -139,7 +139,7 @@ func TestNonZipPath(t *testing.T) { Network: fmt.Sprintf("container:%s", registryContainer.GetContainerID()), }) - container.whenRunningPiperCommand("cnbBuild", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL, "--path", "mta.yaml") + container.whenRunningPiperCommand("cnbBuild", "--noTelemetry", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL, "--path", "mta.yaml") container.assertHasOutput(t, "Copying '/project/mta.yaml' into '/workspace' failed: application path must be a directory or zip") container.terminate(t) @@ -158,7 +158,7 @@ func TestNpmCustomBuildpacksFullProject(t *testing.T) { Network: fmt.Sprintf("container:%s", registryContainer.GetContainerID()), }) - container.whenRunningPiperCommand("cnbBuild", "--buildpacks", "gcr.io/paketo-buildpacks/nodejs:0.14.0", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) + container.whenRunningPiperCommand("cnbBuild", "--noTelemetry", "--buildpacks", "gcr.io/paketo-buildpacks/nodejs:0.14.0", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) container.assertHasOutput(t, "Setting custom buildpacks: '[gcr.io/paketo-buildpacks/nodejs:0.14.0]'") container.assertHasOutput(t, "Downloading buildpack 'gcr.io/paketo-buildpacks/nodejs:0.14.0' to /tmp/nodejs") @@ -183,7 +183,7 @@ func TestNpmCustomBuildpacksBuildpacklessProject(t *testing.T) { Network: fmt.Sprintf("container:%s", registryContainer.GetContainerID()), }) - container.whenRunningPiperCommand("cnbBuild", "--buildpacks", "gcr.io/paketo-buildpacks/nodejs:0.14.0", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) + container.whenRunningPiperCommand("cnbBuild", "--noTelemetry", "--buildpacks", "gcr.io/paketo-buildpacks/nodejs:0.14.0", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", registryURL) container.assertHasOutput(t, "Setting custom buildpacks: '[gcr.io/paketo-buildpacks/nodejs:0.14.0]'") container.assertHasOutput(t, "Downloading buildpack 'gcr.io/paketo-buildpacks/nodejs:0.14.0' to /tmp/nodejs") @@ -202,7 +202,7 @@ func TestWrongBuilderProject(t *testing.T) { TestDir: []string{"testdata", "TestMtaIntegration", "npm"}, }) - container.whenRunningPiperCommand("cnbBuild", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", "test") + container.whenRunningPiperCommand("cnbBuild", "--noTelemetry", "--containerImageName", "not-found", "--containerImageTag", "0.0.1", "--containerRegistryUrl", "test") container.assertHasOutput(t, "the provided dockerImage is not a valid builder") container.terminate(t) diff --git a/integration/testdata/TestCnbIntegration/config.yml b/integration/testdata/TestCnbIntegration/config.yml index c184abf46..f4025ae2b 100644 --- a/integration/testdata/TestCnbIntegration/config.yml +++ b/integration/testdata/TestCnbIntegration/config.yml @@ -1,5 +1,6 @@ general: verbose: false + collectTelemetryData: false steps: cnbBuild: bindings: diff --git a/integration/testdata/TestCnbIntegration/config_env.yml b/integration/testdata/TestCnbIntegration/config_env.yml index 2e04fcaff..f304f7ae3 100644 --- a/integration/testdata/TestCnbIntegration/config_env.yml +++ b/integration/testdata/TestCnbIntegration/config_env.yml @@ -1,5 +1,6 @@ general: verbose: true + collectTelemetryData: false steps: cnbBuild: buildEnvVars: diff --git a/integration/testdata/TestCnbIntegration/config_multi_image.yml b/integration/testdata/TestCnbIntegration/config_multi_image.yml index 2fa878e99..6785be193 100644 --- a/integration/testdata/TestCnbIntegration/config_multi_image.yml +++ b/integration/testdata/TestCnbIntegration/config_multi_image.yml @@ -1,3 +1,6 @@ +general: + verbose: true + collectTelemetryData: false steps: cnbBuild: containerRegistryUrl: localhost:5000 diff --git a/integration/testdata/TestCnbIntegration/config_preserve_files.yml b/integration/testdata/TestCnbIntegration/config_preserve_files.yml index 7111cbc75..0f1047fe0 100644 --- a/integration/testdata/TestCnbIntegration/config_preserve_files.yml +++ b/integration/testdata/TestCnbIntegration/config_preserve_files.yml @@ -1,5 +1,6 @@ general: verbose: true + collectTelemetryData: false steps: cnbBuild: containerRegistryUrl: localhost:5000