Skip to content

Commit d2f075a

Browse files
JeromeJutekton-robot
authored andcommitted
Remove EmbeddedStatus Feature Flag
This commit removes the `EmbeddedStatus` feature flag. It removes all the test cases related with the `full` and `both` `EmbeddedStatus` and only kept the `minimal` test cases as default. In detail, the test cases that checks the `taskruns` or `runs` status from previous was changed to checking referenced `taskruns` or `runs` from the `ChildReferences`.
1 parent 7ab2479 commit d2f075a

36 files changed

+566
-3081
lines changed

config/config-feature-flags.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ data:
8585
# in the TaskRun/PipelineRun such as the source from where a remote Task/Pipeline
8686
# definition was fetched.
8787
enable-provenance-in-status: "false"
88-
# Setting this flag to "full" to enable full embedding of `TaskRun` and `Run` statuses in the
89-
# `PipelineRun` status. Set it to "minimal" to populate the `ChildReferences` field in the
90-
# `PipelineRun` status with name, kind, and API version information for each `TaskRun` and
91-
# `Run` in the `PipelineRun` instead. Set it to "both" to do both.
92-
embedded-status: "minimal"
9388
# Setting this flag will determine the version for custom tasks created by PipelineRuns.
9489
# Acceptable values are "v1beta1" and "v1alpha1".
9590
# The default is "v1beta1".

docs/install.md

-6
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,6 @@ The default is `false`. For more information, see the [associated issue](https:/
475475
most stable features to be used. Set it to "alpha" to allow [alpha
476476
features](#alpha-features) to be used.
477477

478-
- `embedded-status`: set this flag to "full" to enable full embedding of `TaskRun` and `Run` statuses in the
479-
`PipelineRun` status. Set it to "minimal" to populate the `ChildReferences` field in the `PipelineRun` status with
480-
name, kind, and API version information for each `TaskRun` and `Run` in the `PipelineRun` instead. Set it to "both" to
481-
do both. For more information, see [Configuring usage of `TaskRun` and `Run` embedded statuses](pipelineruns.md#configuring-usage-of-taskrun-and-run-embedded-statuses).
482-
483478
- `resource-verification-mode`: Setting this flag to "enforce" will enforce verification of tasks/pipeline. Failing to verify will fail the taskrun/pipelinerun. "warn" will only log the err message and "skip" will skip the whole verification.
484479
- `results-from`: set this flag to "termination-message" to use the container's termination message to fetch results from. This is the default method of extracting results. Set it to "sidecar-logs" to enable use of a results sidecar logs to extract results instead of termination message.
485480

@@ -526,7 +521,6 @@ Features currently in "alpha" are:
526521
| [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) | |
527522
| [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) | |
528523
| [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) | |
529-
| [Embedded Statuses](pipelineruns.md#configuring-usage-of-taskrun-and-run-embedded-statuses) | [TEP-0100](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md) | [v0.35.0](https://github.com/tektoncd/pipeline/releases/tag/v0.35.0) | `embedded-status` |
530524
| [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) | |
531525
| [Object Params and Results](pipelineruns.md#specifying-parameters) | [TEP-0075](https://github.com/tektoncd/community/blob/main/teps/0075-object-param-and-result-types.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | |
532526
| [Array Results](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) | |

docs/matrix.md

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Documentation for specifying `Matrix` in a `Pipeline`:
3333

3434
> :seedling: **`Matrix` is an [alpha](install.md#alpha-features) feature.**
3535
> The `enable-api-fields` feature flag must be set to `"alpha"` to specify `Matrix` in a `PipelineTask`.
36-
> The `embedded-status` feature flag must be set to `"minimal"` to specify `Matrix` in a `PipelineTask`.
3736
3837
## Configuring a Matrix
3938

docs/pipelineruns.md

+1-17
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ weight: 500
3232
- [Specifying <code>LimitRange</code> values](#specifying-limitrange-values)
3333
- [Configuring a failure timeout](#configuring-a-failure-timeout)
3434
- [<code>PipelineRun</code> status](#pipelinerun-status)
35-
- [The <code>status</code> field](#the-status-field)
36-
- [Configuring usage of <code>TaskRun</code> and <code>Run</code> embedded statuses](#configuring-usage-of-taskrun-and-run-embedded-statuses)
35+
- [The <code>status</code> field](#the-status-field)
3736
- [Monitoring execution status](#monitoring-execution-status)
3837
- [Cancelling a <code>PipelineRun</code>](#cancelling-a-pipelinerun)
3938
- [Gracefully cancelling a <code>PipelineRun</code>](#gracefully-cancelling-a-pipelinerun)
@@ -1389,21 +1388,6 @@ Your `PipelineRun`'s `status` field can contain the following fields:
13891388
- `finallyStartTime`- The time at which the PipelineRun's `finally` Tasks, if any, began
13901389
executing, in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
13911390

1392-
### Configuring usage of `TaskRun` and `Run` embedded statuses
1393-
1394-
Currently, the default behavior is to pupulate `status.childReferences` with references to the `TaskRun`s and
1395-
`Run`s, which can be used to look up their statuses.
1396-
1397-
This behavior can be controlled by changing the `embedded-status` feature flag in the `feature-flags`
1398-
config map. See [`install.md`](./install.md#customizing-the-pipelines-controller-behavior) for more
1399-
information on feature flags. The possible values for `embedded-status` are:
1400-
- `minimal` - The current default behavior, populate `status.childReferences`, not `status.taskRuns` or `status.runs`.
1401-
- `full` - Populating `status.taskRuns` and `status.runs`, without populating `status.childReferences`.
1402-
- `both` - Populate `status.childReferences` as well as `status.taskRuns` and `status.runs`.
1403-
1404-
*Note that after the `PipelineRunStatus` migration as planned in [TEP-100](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md#2-deprecate-and-remove-full-embedded-status),
1405-
[the `full` and `both` `embedded-status` options will be removed](https://github.com/tektoncd/pipeline/blob/main/docs/deprecations.md).
1406-
14071391
### Monitoring execution status
14081392

14091393
As your `PipelineRun` executes, its `status` field accumulates information on the execution of each `TaskRun`

pkg/apis/config/feature_flags.go

-32
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ const (
3333
AlphaAPIFields = "alpha"
3434
// BetaAPIFields is the value used for "enable-api-fields" when beta APIs should be usable as well.
3535
BetaAPIFields = "beta"
36-
// FullEmbeddedStatus is the value used for "embedded-status" when the full statuses of TaskRuns and Runs should be
37-
// embedded in PipelineRunStatusFields, but ChildReferences should not be used.
38-
FullEmbeddedStatus = "full"
39-
// BothEmbeddedStatus is the value used for "embedded-status" when full embedded statuses of TaskRuns and Runs as
40-
// well as ChildReferences should be used in PipelineRunStatusFields.
41-
BothEmbeddedStatus = "both"
42-
// MinimalEmbeddedStatus is the value used for "embedded-status" when only ChildReferences should be used in
43-
// PipelineRunStatusFields.
44-
MinimalEmbeddedStatus = "minimal"
4536
// EnforceResourceVerificationMode is the value used for "resource-verification-mode" when verification is applied and fail the
4637
// TaskRun or PipelineRun when verification fails
4738
EnforceResourceVerificationMode = "enforce"
@@ -76,8 +67,6 @@ const (
7667
DefaultEnableAPIFields = StableAPIFields
7768
// DefaultSendCloudEventsForRuns is the default value for "send-cloudevents-for-runs".
7869
DefaultSendCloudEventsForRuns = false
79-
// DefaultEmbeddedStatus is the default value for "embedded-status".
80-
DefaultEmbeddedStatus = MinimalEmbeddedStatus
8170
// EnforceNonfalsifiabilityWithSpire is the value used for "enable-nonfalsifiability" when SPIRE is used to enable non-falsifiability.
8271
EnforceNonfalsifiabilityWithSpire = "spire"
8372
// EnforceNonfalsifiabilityNone is the value used for "enable-nonfalsifiability" when non-falsifiability is not enabled.
@@ -103,7 +92,6 @@ const (
10392
enableTektonOCIBundles = "enable-tekton-oci-bundles"
10493
enableAPIFields = "enable-api-fields"
10594
sendCloudEventsForRuns = "send-cloudevents-for-runs"
106-
embeddedStatus = "embedded-status"
10795
enforceNonfalsifiability = "enforce-nonfalsifiability"
10896
verificationMode = "resource-verification-mode"
10997
enableProvenanceInStatus = "enable-provenance-in-status"
@@ -124,7 +112,6 @@ type FeatureFlags struct {
124112
EnableAPIFields string
125113
SendCloudEventsForRuns bool
126114
AwaitSidecarReadiness bool
127-
EmbeddedStatus string
128115
EnforceNonfalsifiability string
129116
ResourceVerificationMode string
130117
EnableProvenanceInStatus bool
@@ -195,9 +182,6 @@ func NewFeatureFlagsFromMap(cfgMap map[string]string) (*FeatureFlags, error) {
195182
if err := setFeature(sendCloudEventsForRuns, DefaultSendCloudEventsForRuns, &tc.SendCloudEventsForRuns); err != nil {
196183
return nil, err
197184
}
198-
if err := setEmbeddedStatus(cfgMap, DefaultEmbeddedStatus, &tc.EmbeddedStatus); err != nil {
199-
return nil, err
200-
}
201185
if err := setResourceVerificationMode(cfgMap, DefaultResourceVerificationMode, &tc.ResourceVerificationMode); err != nil {
202186
return nil, err
203187
}
@@ -257,22 +241,6 @@ func setEnabledAPIFields(cfgMap map[string]string, defaultValue string, feature
257241
return nil
258242
}
259243

260-
// setEmbeddedStatus sets the "embedded-status" flag based on the content of a given map.
261-
// If the feature gate is invalid or missing then an error is returned.
262-
func setEmbeddedStatus(cfgMap map[string]string, defaultValue string, feature *string) error {
263-
value := defaultValue
264-
if cfg, ok := cfgMap[embeddedStatus]; ok {
265-
value = strings.ToLower(cfg)
266-
}
267-
switch value {
268-
case FullEmbeddedStatus, BothEmbeddedStatus, MinimalEmbeddedStatus:
269-
*feature = value
270-
default:
271-
return fmt.Errorf("invalid value for feature flag %q: %q", embeddedStatus, value)
272-
}
273-
return nil
274-
}
275-
276244
// setResultExtractionMethod sets the "results-from" flag based on the content of a given map.
277245
// If the feature gate is invalid or missing then an error is returned.
278246
func setResultExtractionMethod(cfgMap map[string]string, defaultValue string, feature *string) error {

pkg/apis/config/feature_flags_test.go

-10
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
4747
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
4848
EnableAPIFields: config.DefaultEnableAPIFields,
4949
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
50-
EmbeddedStatus: config.DefaultEmbeddedStatus,
5150
ResourceVerificationMode: config.DefaultResourceVerificationMode,
5251
EnableProvenanceInStatus: config.DefaultEnableProvenanceInStatus,
5352
ResultExtractionMethod: config.DefaultResultExtractionMethod,
@@ -65,7 +64,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
6564
EnableTektonOCIBundles: true,
6665
EnableAPIFields: "alpha",
6766
SendCloudEventsForRuns: true,
68-
EmbeddedStatus: "both",
6967
EnforceNonfalsifiability: "spire",
7068
ResourceVerificationMode: "enforce",
7169
EnableProvenanceInStatus: true,
@@ -88,7 +86,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
8886
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
8987
RequireGitSSHSecretKnownHosts: config.DefaultRequireGitSSHSecretKnownHosts,
9088
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
91-
EmbeddedStatus: config.DefaultEmbeddedStatus,
9289
ResourceVerificationMode: config.DefaultResourceVerificationMode,
9390
ResultExtractionMethod: config.DefaultResultExtractionMethod,
9491
MaxResultSize: config.DefaultMaxResultSize,
@@ -107,7 +104,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
107104
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
108105
RequireGitSSHSecretKnownHosts: config.DefaultRequireGitSSHSecretKnownHosts,
109106
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
110-
EmbeddedStatus: config.DefaultEmbeddedStatus,
111107
ResourceVerificationMode: config.DefaultResourceVerificationMode,
112108
ResultExtractionMethod: config.DefaultResultExtractionMethod,
113109
MaxResultSize: config.DefaultMaxResultSize,
@@ -126,7 +122,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
126122
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
127123
RequireGitSSHSecretKnownHosts: config.DefaultRequireGitSSHSecretKnownHosts,
128124
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
129-
EmbeddedStatus: config.DefaultEmbeddedStatus,
130125
ResourceVerificationMode: config.DefaultResourceVerificationMode,
131126
ResultExtractionMethod: config.DefaultResultExtractionMethod,
132127
MaxResultSize: config.DefaultMaxResultSize,
@@ -137,7 +132,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
137132
{
138133
expectedConfig: &config.FeatureFlags{
139134
EnableAPIFields: "alpha",
140-
EmbeddedStatus: "minimal",
141135
EnforceNonfalsifiability: "spire",
142136
EnableTektonOCIBundles: true,
143137
ResourceVerificationMode: config.DefaultResourceVerificationMode,
@@ -152,7 +146,6 @@ func TestNewFeatureFlagsFromConfigMap(t *testing.T) {
152146
{
153147
expectedConfig: &config.FeatureFlags{
154148
EnableAPIFields: "stable",
155-
EmbeddedStatus: config.DefaultEmbeddedStatus,
156149
ResourceVerificationMode: config.DefaultResourceVerificationMode,
157150
RunningInEnvWithInjectedSidecars: config.DefaultRunningInEnvWithInjectedSidecars,
158151
AwaitSidecarReadiness: config.DefaultAwaitSidecarReadiness,
@@ -184,7 +177,6 @@ func TestNewFeatureFlagsFromEmptyConfigMap(t *testing.T) {
184177
EnableTektonOCIBundles: config.DefaultEnableTektonOciBundles,
185178
EnableAPIFields: config.DefaultEnableAPIFields,
186179
SendCloudEventsForRuns: config.DefaultSendCloudEventsForRuns,
187-
EmbeddedStatus: config.DefaultEmbeddedStatus,
188180
EnforceNonfalsifiability: config.DefaultEnforceNonfalsifiability,
189181
ResourceVerificationMode: config.DefaultResourceVerificationMode,
190182
EnableProvenanceInStatus: config.DefaultEnableProvenanceInStatus,
@@ -229,8 +221,6 @@ func TestNewFeatureFlagsConfigMapErrors(t *testing.T) {
229221
fileName: "feature-flags-invalid-boolean",
230222
}, {
231223
fileName: "feature-flags-invalid-enable-api-fields",
232-
}, {
233-
fileName: "feature-flags-invalid-embedded-status",
234224
}, {
235225
fileName: "feature-flags-invalid-resource-verification-mode",
236226
}, {

pkg/apis/config/testdata/feature-flags-all-flags-set.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ data:
2626
enable-custom-tasks: "true"
2727
enable-api-fields: "alpha"
2828
send-cloudevents-for-runs: "true"
29-
embedded-status: "both"
3029
enforce-nonfalsifiability: "spire"
3130
resource-verification-mode: "enforce"
3231
enable-provenance-in-status: "true"

pkg/apis/config/testdata/feature-flags-invalid-embedded-status.yaml

-21
This file was deleted.

pkg/apis/config/testing/feature_flags.go

-24
This file was deleted.

pkg/apis/pipeline/v1/pipeline_types.go

-3
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,6 @@ func (pt *PipelineTask) validateMatrix(ctx context.Context) (errs *apis.FieldErr
283283
// This is an alpha feature and will fail validation if it's used in a pipeline spec
284284
// when the enable-api-fields feature gate is anything but "alpha".
285285
errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "matrix", config.AlphaAPIFields))
286-
// Matrix requires "embedded-status" feature gate to be set to "minimal", and will fail
287-
// validation if it is anything but "minimal".
288-
errs = errs.Also(ValidateEmbeddedStatus(ctx, "matrix", config.MinimalEmbeddedStatus))
289286
errs = errs.Also(pt.validateMatrixCombinationsCount(ctx))
290287
}
291288
errs = errs.Also(validateParameterInOneOfMatrixOrParams(pt.Matrix, pt.Params))

pkg/apis/pipeline/v1/pipeline_types_test.go

+3-38
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,9 @@ func TestPipelineTaskList_Deps(t *testing.T) {
591591

592592
func TestPipelineTask_validateMatrix(t *testing.T) {
593593
tests := []struct {
594-
name string
595-
pt *PipelineTask
596-
embeddedStatus string
597-
wantErrs *apis.FieldError
594+
name string
595+
pt *PipelineTask
596+
wantErrs *apis.FieldError
598597
}{{
599598
name: "parameter duplicated in matrix and params",
600599
pt: &PipelineTask{
@@ -681,45 +680,11 @@ func TestPipelineTask_validateMatrix(t *testing.T) {
681680
Name: "browser", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"chrome", "firefox"}},
682681
}}},
683682
},
684-
}, {
685-
name: "pipeline has a matrix but embedded status is full",
686-
pt: &PipelineTask{
687-
Name: "task",
688-
Matrix: &Matrix{
689-
Params: []Param{{
690-
Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}},
691-
}, {
692-
Name: "barfoo", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"bar", "foo"}},
693-
}}},
694-
},
695-
embeddedStatus: config.FullEmbeddedStatus,
696-
wantErrs: &apis.FieldError{
697-
Message: "matrix requires \"embedded-status\" feature gate to be \"minimal\" but it is \"full\"",
698-
},
699-
}, {
700-
name: "pipeline has a matrix but embedded status is both",
701-
pt: &PipelineTask{
702-
Name: "task",
703-
Matrix: &Matrix{
704-
Params: []Param{{
705-
Name: "foobar", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"foo", "bar"}},
706-
}, {
707-
Name: "barfoo", Value: ParamValue{Type: ParamTypeArray, ArrayVal: []string{"bar", "foo"}},
708-
}}},
709-
},
710-
embeddedStatus: config.BothEmbeddedStatus,
711-
wantErrs: &apis.FieldError{
712-
Message: "matrix requires \"embedded-status\" feature gate to be \"minimal\" but it is \"both\"",
713-
},
714683
}}
715684
for _, tt := range tests {
716685
t.Run(tt.name, func(t *testing.T) {
717-
if tt.embeddedStatus == "" {
718-
tt.embeddedStatus = config.MinimalEmbeddedStatus
719-
}
720686
featureFlags, _ := config.NewFeatureFlagsFromMap(map[string]string{
721687
"enable-api-fields": "alpha",
722-
"embedded-status": tt.embeddedStatus,
723688
})
724689
defaults := &config.Defaults{
725690
DefaultMaxMatrixCombinationsCount: 4,

0 commit comments

Comments
 (0)