Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating default lifecycle version to 0.20.6 #2356

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
@@ -1321,7 +1321,9 @@ func testAcceptance(
})

when("daemon", func() {

it("uses the 5 phases", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
origLifecycle := lifecycle.Image()

output := pack.RunSuccessfully(
@@ -1340,6 +1342,7 @@ func testAcceptance(

when("--publish", func() {
it("uses the 5 phases", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
origLifecycle := lifecycle.Image()

buildArgs := []string{
@@ -1366,6 +1369,7 @@ func testAcceptance(
var additionalRepoName string

it.Before(func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
additionalRepoName = fmt.Sprintf("%s_additional", repoName)
})
it.After(func() {
@@ -1392,6 +1396,7 @@ func testAcceptance(
})

it("creates a runnable, rebuildable image on daemon from app dir", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
appPath := filepath.Join("testdata", "mock_app")

output := pack.RunSuccessfully(
@@ -1534,6 +1539,7 @@ func testAcceptance(

when("--no-color", func() {
it("doesn't have color", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
appPath := filepath.Join("testdata", "mock_app")

// --no-color is set as a default option in our tests, and doesn't need to be explicitly provided
@@ -1546,6 +1552,7 @@ func testAcceptance(

when("--quiet", func() {
it("only logs app name and sha", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
appPath := filepath.Join("testdata", "mock_app")

pack.SetVerbose(false)
@@ -1725,6 +1732,7 @@ func testAcceptance(

when("--default-process", func() {
it("sets the default process from those in the process list", func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
pack.RunSuccessfully(
"build", repoName,
"--default-process", "hello",
@@ -1868,6 +1876,10 @@ func testAcceptance(
packageImageName string
)

it.Before(func() {
h.SkipIf(t, !pack.SupportsFeature(invoke.WindowsSupport), "Windows support was removed after before 0.37.0")
})

it.After(func() {
imageManager.CleanupImages(packageImageName)
_ = os.RemoveAll(tmpDir)
9 changes: 9 additions & 0 deletions acceptance/invoke/pack.go
Original file line number Diff line number Diff line change
@@ -241,6 +241,7 @@ const (
PlatformOption
MultiPlatformBuildersAndBuildPackages
StackWarning
WindowsSupport
)

var featureTests = map[Feature]func(i *PackInvoker) bool{
@@ -289,6 +290,7 @@ var featureTests = map[Feature]func(i *PackInvoker) bool{
StackWarning: func(i *PackInvoker) bool {
return i.atLeast("v0.37.0")
},
WindowsSupport: func(i *PackInvoker) bool { return i.lessThan("v0.36.4") },
}

func (i *PackInvoker) SupportsFeature(f Feature) bool {
@@ -310,6 +312,13 @@ func (i *PackInvoker) laterThan(version string) bool {
return ver.Compare(providedVersion) > 0 || ver.Equal(semver.MustParse("0.0.0"))
}

// laterThan returns true if pack version is older than the provided version
func (i *PackInvoker) lessThan(version string) bool {
providedVersion := semver.MustParse(version)
ver := i.semanticVersion()
return ver.Compare(providedVersion) <= 0 || ver.Equal(semver.MustParse("0.0.0"))
}

// atLeast returns true if pack version is the same or older than the provided version
func (i *PackInvoker) atLeast(version string) bool {
minimalVersion := semver.MustParse(version)
2 changes: 1 addition & 1 deletion acceptance/testdata/pack_fixtures/report_output.txt
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ Pack:
Version: {{ .Version }}
OS/Arch: {{ .OS }}/{{ .Arch }}

Default Lifecycle Version: 0.20.3
Default Lifecycle Version: 0.20.5

Supported Platform APIs: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ require (
github.com/Microsoft/go-winio v0.6.2
github.com/apex/log v1.9.0
github.com/buildpacks/imgutil v0.0.0-20240605145725-186f89b2d168
github.com/buildpacks/lifecycle v0.20.4
github.com/buildpacks/lifecycle v0.20.5
github.com/docker/cli v27.5.1+incompatible
github.com/docker/docker v27.5.1+incompatible
github.com/docker/go-connections v0.5.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -93,8 +93,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/buildpacks/imgutil v0.0.0-20240605145725-186f89b2d168 h1:yVYVi1V7x1bXklOx9lpbTfteyzQKGZC/wkl+IlaVRlU=
github.com/buildpacks/imgutil v0.0.0-20240605145725-186f89b2d168/go.mod h1:n2R6VRuWsAX3cyHCp/u0Z4WJcixny0gYg075J39owrk=
github.com/buildpacks/lifecycle v0.20.4 h1:VVVTrd9y1LHY3adchh6oktw0wKQuYsWLq3/g23TLaGQ=
github.com/buildpacks/lifecycle v0.20.4/go.mod h1:ZsExeEhN+6Qws7iDHJl6PV6zsHycgK/RmDKnRgKQTH0=
github.com/buildpacks/lifecycle v0.20.5 h1:xgKKbex/H79B23PVyT6F5Ilj/3H9QeIZnd6aPNvA898=
github.com/buildpacks/lifecycle v0.20.5/go.mod h1:ZsExeEhN+6Qws7iDHJl6PV6zsHycgK/RmDKnRgKQTH0=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
5 changes: 2 additions & 3 deletions internal/builder/lifecycle.go
Original file line number Diff line number Diff line change
@@ -12,10 +12,9 @@ import (
"github.com/buildpacks/pack/pkg/archive"
)

// A snapshot of the latest tested lifecycle version values
// DefaultLifecycleVersion A snapshot of the latest tested lifecycle version values
const (
DefaultLifecycleVersion = "0.20.3"
DefaultBuildpackAPIVersion = "0.2"
DefaultLifecycleVersion = "0.20.5"
)

// Blob is an interface to wrap opening blobs