Skip to content

Commit

Permalink
Matrix Promotion to Beta
Browse files Browse the repository at this point in the history
Matrix is was introduced in Tekton Pipelines 0.38. We have introduced a lot of
testing around matrix feature including unit/e2e/integration tests.

Matrix unblocks variety of use cases for systems migrating from travis/jenkins.

This is a very crucial feature for many end-users while allowing to maintain
clean, concise, and flexible catalog of pipelines.

Part of tektoncd#5265 and tektoncd#6110

Signed-off-by: Priti Desai <[email protected]>
  • Loading branch information
pritidesai committed Sep 29, 2023
1 parent f5578a8 commit ab5bffe
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pkg/apis/pipeline/v1/pipeline_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError) {

func (pt *PipelineTask) validateMatrix(ctx context.Context) (errs *apis.FieldError) {
if pt.IsMatrixed() {
// This is an alpha feature and will fail validation if it's used in a pipeline spec
// when the enable-api-fields feature gate is anything but "alpha".
errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "matrix", config.AlphaAPIFields))
// This is a beta feature and will fail validation if it's used in a pipeline spec
// when the enable-api-fields feature gate is set to "stable".
errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "matrix", config.BetaAPIFields))
errs = errs.Also(pt.Matrix.validateCombinationsCount(ctx))
errs = errs.Also(pt.Matrix.validateUniqueParams())
}
Expand Down
27 changes: 14 additions & 13 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7039,7 +7039,7 @@ spec:
`),
}

cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
d := test.Data{
ConfigMaps: cms,
PipelineRuns: prs,
Expand Down Expand Up @@ -8215,7 +8215,7 @@ spec:
kind: Task
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -8591,8 +8591,7 @@ spec:
script: |
echo "$(params.platform) and $(params.browser)"
`)

cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -8976,7 +8975,7 @@ spec:
kind: Task
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -9434,7 +9433,7 @@ spec:
kind: Task
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -9795,7 +9794,7 @@ spec:
kind: Task
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -10225,7 +10224,7 @@ spec:
echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path)
`)

cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))
tests := []struct {
name string
Expand Down Expand Up @@ -10768,7 +10767,8 @@ spec:
tekton.dev/pipeline: p-dag
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}

cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))
tests := []struct {
name string
Expand Down Expand Up @@ -10945,7 +10945,7 @@ spec:
exit 1
`)

cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down Expand Up @@ -11567,7 +11567,7 @@ spec:
name: mytask
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}

tests := []struct {
name string
Expand Down Expand Up @@ -11929,7 +11929,7 @@ spec:
echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path)
`)

cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}
cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))
tests := []struct {
name string
Expand Down Expand Up @@ -12092,7 +12092,8 @@ spec:
kind: Task
`),
}
cms := []*corev1.ConfigMap{withEnabledAlphaAPIFields(newFeatureFlagsConfigMap())}

cms := []*corev1.ConfigMap{newFeatureFlagsConfigMap()}
cms = append(cms, withMaxMatrixCombinationsCount(newDefaultsConfigMap(), 10))

tests := []struct {
Expand Down

0 comments on commit ab5bffe

Please sign in to comment.