Prevent rollback stage builder panics on empty stage lists#7002
Open
rootp1 wants to merge 1 commit into
Open
Conversation
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Prevents rollback-enabled pipeline stage builders from panicking on empty stage lists in the Terraform, Kubernetes, Kubernetes multicluster, and Cloud Run piped v1 plugins.
Why we need it:
These builders currently call
slices.MinFuncon an empty slice when rollback is enabled without configured stages, which crashes the builder instead of returning a controlled validation error.Which issue(s) this PR fixes:
Fixes #7001
Summary
Linked Issue
Fixes #7001
What Changed
Verification
go -C pkg/app/pipedv1/plugin/terraform test ./deployment -run 'TestPlugin_BuildPipelineSyncStages' && go -C pkg/app/pipedv1/plugin/kubernetes test ./deployment -run 'Test_buildPipelineStages' && go -C pkg/app/pipedv1/plugin/kubernetes_multicluster test ./deployment -run 'Test_buildPipelineStages' && go -C pkg/app/pipedv1/plugin/cloudrun test ./deployment -run 'Test_buildPipelineStages'— passedmake build/go— passedmake check/gen/code— passedmake check— failed:yarnis not installed locally, so the repository-wide web build step inbuild/webcould not runmake test/integration— failed: Docker is unavailable (/var/run/docker.sockmissing) for the Firestore and MySQL integration suitesmake check/dco— failed before the new commit because upstreammasterHEAD commit25ae69937e55e8330bff96c34346718f3e5e7148is missing aSigned-off-byline; this PR commit itself is signed offmake test/go MODULES=pkg/app/pipedv1/plugin/terraform,pkg/app/pipedv1/plugin/kubernetes,pkg/app/pipedv1/plugin/kubernetes_multicluster,pkg/app/pipedv1/plugin/cloudrun— not completed locally: the broader module-wide run did not finish in a reasonable time after entering the heavier Kubernetes suites, so the focused regression command above was used as the closest confirmed local alternativeScope
Does this PR introduce a user-facing change?: