From 5202f26775d212415b5f1b877ccd0a90ccbc1fc8 Mon Sep 17 00:00:00 2001 From: Jesse Brown Date: Tue, 2 Feb 2021 15:08:45 -0600 Subject: [PATCH] Add heroku/buildpacks:20 to suggested builders list `heroku-20` is the default stack on Heroku now, adding the builder for this stack at this time seems reasonable. Signed-off-by: Jesse Brown --- acceptance/acceptance_test.go | 10 +++++----- acceptance/assertions/output.go | 15 ++++++++++----- doc_test.go | 2 +- internal/commands/config_trusted_builder_test.go | 4 ++++ internal/commands/inspect_builder_test.go | 1 + internal/commands/list_trusted_builders_test.go | 2 ++ internal/commands/suggest_builders.go | 5 +++++ 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index f55fabeb1..5fb1313c7 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -153,7 +153,7 @@ func testWithoutSpecificBuilderRequirement( assertOutput := assertions.NewOutputAssertionManager(t, output) assertOutput.IncludesSuggestedBuildersHeading() assertOutput.IncludesPrefixedGoogleBuilder() - assertOutput.IncludesPrefixedHerokuBuilder() + assertOutput.IncludesPrefixedHerokuBuilders() assertOutput.IncludesPrefixedPaketoBuilders() }) }) @@ -183,7 +183,7 @@ func testWithoutSpecificBuilderRequirement( assertOutput := assertions.NewOutputAssertionManager(t, output) assertOutput.IncludesTrustedBuildersHeading() - assertOutput.IncludesHerokuBuilder() + assertOutput.IncludesHerokuBuilders() assertOutput.IncludesGoogleBuilder() assertOutput.IncludesPaketoBuilders() assert.NotContains(output, "has been deprecated") @@ -220,7 +220,7 @@ func testWithoutSpecificBuilderRequirement( assertOutput := assertions.NewOutputAssertionManager(t, output) assertOutput.IncludesTrustedBuildersHeading() - assertOutput.IncludesHerokuBuilder() + assertOutput.IncludesHerokuBuilders() assertOutput.IncludesGoogleBuilder() assertOutput.IncludesPaketoBuilders() assert.NotContains(output, "has been deprecated") @@ -272,7 +272,7 @@ func testWithoutSpecificBuilderRequirement( assertOutput := assertions.NewOutputAssertionManager(t, output) assertOutput.IncludesTrustedBuildersHeading() - assertOutput.IncludesHerokuBuilder() + assertOutput.IncludesHerokuBuilders() assertOutput.IncludesGoogleBuilder() assertOutput.IncludesPaketoBuilders() assertOutput.IncludesDeprecationWarning() @@ -631,7 +631,7 @@ func testWithoutSpecificBuilderRequirement( assertOutput := assertions.NewOutputAssertionManager(t, output) assertOutput.IncludesMessageToSetDefaultBuilder() assertOutput.IncludesPrefixedGoogleBuilder() - assertOutput.IncludesPrefixedHerokuBuilder() + assertOutput.IncludesPrefixedHerokuBuilders() assertOutput.IncludesPrefixedPaketoBuilders() }) }) diff --git a/acceptance/assertions/output.go b/acceptance/assertions/output.go index 984c8356b..6e3dfe675 100644 --- a/acceptance/assertions/output.go +++ b/acceptance/assertions/output.go @@ -174,18 +174,23 @@ func (o OutputAssertionManager) IncludesPrefixedGoogleBuilder() { o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Google:\s+'%s'`, googleBuilder))) } -const herokuBuilder = "heroku/buildpacks:18" +var herokuBuilders = []string{ + "heroku/buildpacks:18", + "heroku/buildpacks:20", +} -func (o OutputAssertionManager) IncludesHerokuBuilder() { +func (o OutputAssertionManager) IncludesHerokuBuilders() { o.testObject.Helper() - o.assert.Contains(o.output, herokuBuilder) + o.assert.ContainsAll(o.output, herokuBuilders...) } -func (o OutputAssertionManager) IncludesPrefixedHerokuBuilder() { +func (o OutputAssertionManager) IncludesPrefixedHerokuBuilders() { o.testObject.Helper() - o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Heroku:\s+'%s'`, herokuBuilder))) + for _, builder := range herokuBuilders { + o.assert.Matches(o.output, regexp.MustCompile(fmt.Sprintf(`Heroku:\s+'%s'`, builder))) + } } var paketoBuilders = []string{ diff --git a/doc_test.go b/doc_test.go index 66b5d6147..75a5f519c 100644 --- a/doc_test.go +++ b/doc_test.go @@ -28,7 +28,7 @@ func Example_build() { // randomly select a builder to use from among the following builderList := []string{ "gcr.io/buildpacks/builder:v1", - "heroku/buildpacks:18", + "heroku/buildpacks:20", "gcr.io/paketo-buildpacks/builder:base", } diff --git a/internal/commands/config_trusted_builder_test.go b/internal/commands/config_trusted_builder_test.go index bdee02d00..e1a2f6c8d 100644 --- a/internal/commands/config_trusted_builder_test.go +++ b/internal/commands/config_trusted_builder_test.go @@ -60,6 +60,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) { outBuf, "gcr.io/buildpacks/builder:v1", "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", @@ -73,6 +74,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) { outBuf, "gcr.io/buildpacks/builder:v1", "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", @@ -93,6 +95,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) { outBuf, "gcr.io/buildpacks/builder:v1", "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", @@ -109,6 +112,7 @@ func testTrustedBuilderCommand(t *testing.T, when spec.G, it spec.S) { "gcr.io/buildpacks/builder:v1", builderName, "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", diff --git a/internal/commands/inspect_builder_test.go b/internal/commands/inspect_builder_test.go index 492e1a54c..8efb972b9 100644 --- a/internal/commands/inspect_builder_test.go +++ b/internal/commands/inspect_builder_test.go @@ -256,6 +256,7 @@ func testInspectBuilderCommand(t *testing.T, when spec.G, it spec.S) { assert.Matches(outBuf.String(), regexp.MustCompile(`Paketo Buildpacks:\s+'paketobuildpacks/builder:base'`)) assert.Matches(outBuf.String(), regexp.MustCompile(`Paketo Buildpacks:\s+'paketobuildpacks/builder:full'`)) assert.Matches(outBuf.String(), regexp.MustCompile(`Heroku:\s+'heroku/buildpacks:18'`)) + assert.Matches(outBuf.String(), regexp.MustCompile(`Heroku:\s+'heroku/buildpacks:20'`)) }) }) diff --git a/internal/commands/list_trusted_builders_test.go b/internal/commands/list_trusted_builders_test.go index f4aac992c..1424205b9 100644 --- a/internal/commands/list_trusted_builders_test.go +++ b/internal/commands/list_trusted_builders_test.go @@ -68,6 +68,7 @@ func testListTrustedBuildersCommand(t *testing.T, when spec.G, it spec.S) { outBuf, "gcr.io/buildpacks/builder:v1", "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", @@ -89,6 +90,7 @@ func testListTrustedBuildersCommand(t *testing.T, when spec.G, it spec.S) { "gcr.io/buildpacks/builder:v1", builderName, "heroku/buildpacks:18", + "heroku/buildpacks:20", "paketobuildpacks/builder:base", "paketobuildpacks/builder:full", "paketobuildpacks/builder:tiny", diff --git a/internal/commands/suggest_builders.go b/internal/commands/suggest_builders.go index 9fbe77c4b..e898ad0f6 100644 --- a/internal/commands/suggest_builders.go +++ b/internal/commands/suggest_builders.go @@ -29,6 +29,11 @@ var suggestedBuilders = []SuggestedBuilder{ Image: "heroku/buildpacks:18", DefaultDescription: "heroku-18 base image with buildpacks for Ruby, Java, Node.js, Python, Golang, & PHP", }, + { + Vendor: "Heroku", + Image: "heroku/buildpacks:20", + DefaultDescription: "heroku-20 base image with buildpacks for Ruby, Java, Node.js, Python, Golang, & PHP", + }, { Vendor: "Paketo Buildpacks", Image: "paketobuildpacks/builder:base",