Skip to content

Commit

Permalink
Matrix Promotion to Beta
Browse files Browse the repository at this point in the history
Matrix 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 2dda971
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
16 changes: 8 additions & 8 deletions docs/additional-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ Features currently in "alpha" are:
| [Windows Scripts](./tasks.md#windows-scripts) | [TEP-0057](https://github.com/tektoncd/community/blob/main/teps/0057-windows-support.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | |
| [Debug](./debug.md) | [TEP-0042](https://github.com/tektoncd/community/blob/main/teps/0042-taskrun-breakpoint-on-failure.md) | [v0.26.0](https://github.com/tektoncd/pipeline/releases/tag/v0.26.0) | |
| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | |
| [Matrix](./matrix.md) | [TEP-0090](https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |
| [Task-level Resource Requirements](compute-resources.md#task-level-compute-resources-configuration) | [TEP-0104](https://github.com/tektoncd/community/blob/main/teps/0104-tasklevel-resource-requirements.md) | [v0.39.0](https://github.com/tektoncd/pipeline/releases/tag/v0.39.0) | |
| [Trusted Resources](./trusted-resources.md) | [TEP-0091](https://github.com/tektoncd/community/blob/main/teps/0091-trusted-resources.md) | N/A | `trusted-resources-verification-no-match-policy` |
| [Larger Results via Sidecar Logs](#enabling-larger-results-using-sidecar-logs) | [TEP-0127](https://github.com/tektoncd/community/blob/main/teps/0127-larger-results-via-sidecar-logs.md) | [v0.43.0](https://github.com/tektoncd/pipeline/releases/tag/v0.43.0) | `results-from` |
Expand All @@ -331,13 +330,14 @@ except where otherwise noted.

Features currently in "beta" are:

| Feature | Proposal | Alpha Release | Beta Release | Individual Flag | `enable-api-fields=beta` required for `v1beta1` |
|:-------------------------------------------------------------------|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------|:---------------------------------------------------------------------|:----------------|:---|
| [Array Results and Array Indexing](pipelineruns.md#specifying-parameters) | [TEP-0076](https://github.com/tektoncd/community/blob/main/teps/0076-array-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | [v0.45.0](https://github.com/tektoncd/pipeline/releases/tag/v0.45.0) | | No |
| [Object Parameters and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | | No |
| [Remote Tasks](./taskruns.md#remote-tasks) and [Remote Pipelines](./pipelineruns.md#remote-pipelines) | [TEP-0060](https://github.com/tektoncd/community/blob/main/teps/0060-remote-resolution.md) | | [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | | No |
| [`Provenance` field in Status](pipeline-api.md#provenance)| [issue#5550](https://github.com/tektoncd/pipeline/issues/5550)| [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0)| [v0.48.0](https://github.com/tektoncd/pipeline/releases/tag/v0.48.0) | `enable-provenance-in-status`| No |
| [Isolated `Step` & `Sidecar` `Workspaces`](./workspaces.md#isolated-workspaces) | [TEP-0029](https://github.com/tektoncd/community/blob/main/teps/0029-step-workspaces.md) | [v0.24.0](https://github.com/tektoncd/pipeline/releases/tag/v0.24.0) | [v0.50.0](https://github.com/tektoncd/pipeline/releases/tag/v0.50.0) | | Yes |
| Feature | Proposal | Alpha Release | Beta Release | Individual Flag | `enable-api-fields=beta` required for `v1beta1` |
|:-------------------------------------------------------------------|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------|:---------------------------------------------------------------------|:---------------------------------------------------------------------|:------------------------------------------------|
| [Array Results and Array Indexing](pipelineruns.md#specifying-parameters) | [TEP-0076](https://github.com/tektoncd/community/blob/main/teps/0076-array-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | [v0.45.0](https://github.com/tektoncd/pipeline/releases/tag/v0.45.0) | | No |
| [Object Parameters and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | | No |
| [Remote Tasks](./taskruns.md#remote-tasks) and [Remote Pipelines](./pipelineruns.md#remote-pipelines) | [TEP-0060](https://github.com/tektoncd/community/blob/main/teps/0060-remote-resolution.md) | | [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0) | | No |
| [`Provenance` field in Status](pipeline-api.md#provenance)| [issue#5550](https://github.com/tektoncd/pipeline/issues/5550)| [v0.41.0](https://github.com/tektoncd/pipeline/releases/tag/v0.41.0)| [v0.48.0](https://github.com/tektoncd/pipeline/releases/tag/v0.48.0) | `enable-provenance-in-status` | No |
| [Isolated `Step` & `Sidecar` `Workspaces`](./workspaces.md#isolated-workspaces) | [TEP-0029](https://github.com/tektoncd/community/blob/main/teps/0029-step-workspaces.md) | [v0.24.0](https://github.com/tektoncd/pipeline/releases/tag/v0.24.0) | [v0.50.0](https://github.com/tektoncd/pipeline/releases/tag/v0.50.0) | | Yes |
| [Matrix](./matrix.md) | [TEP-0090](https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | No |

## Enabling larger results using sidecar logs

Expand Down
8 changes: 4 additions & 4 deletions docs/matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Documentation for specifying `Matrix` in a `Pipeline`:
- [Specifying `Matrix` in `Finally Tasks`](pipelines.md#specifying-matrix-in-finally-tasks)
- [Specifying `Matrix` in `Custom Tasks`](pipelines.md#specifying-matrix)

> :seedling: **`Matrix` is an [alpha](additional-configs.md#alpha-features) feature.**
> The `enable-api-fields` feature flag must be set to `"alpha"` to specify `Matrix` in a `PipelineTask`.
> :seedling: **`Matrix` is an [beta](additional-configs.md#beta-features) feature.**
> The `enable-api-fields` feature flag can be set to `"beta"` to specify `Matrix` in a `PipelineTask`.
## Configuring a Matrix

Expand Down Expand Up @@ -849,6 +849,6 @@ status:
```

[cel]: https://github.com/tektoncd/experimental/tree/1609827ea81d05c8d00f8933c5c9d6150cd36989/cel
[pr-with-matrix]: ../examples/v1/pipelineruns/alpha/pipelinerun-with-matrix.yaml
[pr-with-matrix-and-results]: ../examples/v1/pipelineruns/alpha/pipelinerun-with-matrix-and-results.yaml
[pr-with-matrix]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix.yaml
[pr-with-matrix-and-results]: ../examples/v1/pipelineruns/beta/pipelinerun-with-matrix-and-results.yaml
[retries]: pipelines.md#using-the-retries-field
8 changes: 4 additions & 4 deletions docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ spec:

### Specifying `Matrix` in `PipelineTasks`

> :seedling: **`Matrix` is an [alpha](additional-configs.md#alpha-features) feature.**
> The `enable-api-fields` feature flag must be set to `"alpha"` to specify `Matrix` in a `PipelineTask`.
> :seedling: **`Matrix` is an [beta](additional-configs.md#beta-features) feature.**
> The `enable-api-fields` feature flag can be set to `"beta"` to specify `Matrix` in a `PipelineTask`.
You can also provide [`Parameters`](tasks.md#specifying-parameters) through the `matrix` field:

Expand Down Expand Up @@ -1249,8 +1249,8 @@ spec:

### Specifying `matrix` in `finally` tasks

> :seedling: **`Matrix` is an [alpha](additional-configs.md#alpha-features) feature.**
> The `enable-api-fields` feature flag must be set to `"alpha"` to specify `Matrix` in a `PipelineTask`.
> :seedling: **`Matrix` is an [beta](additional-configs.md#beta-features) feature.**
> The `enable-api-fields` feature flag can be set to `"beta"` to specify `Matrix` in a `PipelineTask`.

Similar to `tasks`, you can also provide [`Parameters`](tasks.md#specifying-parameters) through `matrix`
in `finally` tasks:
Expand Down
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 2dda971

Please sign in to comment.