diff --git a/config/config-feature-flags.yaml b/config/config-feature-flags.yaml index 7f0f3507abb..6b51783346b 100644 --- a/config/config-feature-flags.yaml +++ b/config/config-feature-flags.yaml @@ -114,3 +114,11 @@ data: # This allows TaskRuns to run in namespaces with "restricted" pod security standards. # Not all Kubernetes implementations support this option. set-security-context: "false" + # Per feature flags + # + # alpha: v0.52 + # + # ExampleNewFeature serves as an POC for testing purposes. + # It will be removed once the PR is tested and is ready to merge. + # It is disabled by default. + enable-new-example-feature: "false" diff --git a/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml b/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml index a93a71588ea..8ba98d38793 100644 --- a/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml +++ b/pkg/apis/config/testdata/feature-flags-all-flags-set.yaml @@ -31,3 +31,4 @@ data: trusted-resources-verification-no-match-policy: "fail" enable-provenance-in-status: "false" set-security-context: "true" + enable-new-example-feature: "false" diff --git a/pkg/apis/config/testdata/feature-flags-invalid-example-new-feature.yaml b/pkg/apis/config/testdata/feature-flags-invalid-example-new-feature.yaml new file mode 100644 index 00000000000..0459a421a0c --- /dev/null +++ b/pkg/apis/config/testdata/feature-flags-invalid-example-new-feature.yaml @@ -0,0 +1,21 @@ +# Copyright 2023 The Tekton Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: feature-flags + namespace: tekton-pipelines +data: + example-new-feature: "im-not-a-valid-feature-gate" diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index d02bb8264d3..770c6bf2662 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -1207,7 +1207,11 @@ status: EnableProvenanceInStatus: true ResultExtractionMethod: "termination-message" MaxResultSize: 4096 - Coschedule: "workspaces" + Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `) d := test.Data{ PipelineRuns: prs, @@ -4829,6 +4833,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `) expectedPr := expectedPrStatus @@ -4988,6 +4996,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `) expectedPr := expectedPrStatus @@ -8354,6 +8366,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "p-finally", @@ -8521,7 +8537,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" - + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { @@ -8733,6 +8752,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { @@ -9145,6 +9168,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "p-finally", @@ -9350,6 +9377,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { @@ -9586,6 +9617,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, } @@ -10030,6 +10065,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "p-finally", @@ -10208,6 +10247,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { @@ -10434,6 +10477,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "indexing results in matrix.params", @@ -10599,6 +10646,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "whole array result replacements in matrix.params", @@ -10984,6 +11035,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { @@ -11210,6 +11265,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), expectedTaskRuns: []*v1.TaskRun{ mustParseTaskRunWithObjectMeta(t, @@ -11408,6 +11467,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), expectedTaskRuns: []*v1.TaskRun{ mustParseTaskRunWithObjectMeta(t, @@ -11824,6 +11887,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }, { name: "p-finally", @@ -11992,6 +12059,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `), }} for _, tt := range tests { diff --git a/pkg/reconciler/taskrun/taskrun_test.go b/pkg/reconciler/taskrun/taskrun_test.go index 17ea0678843..1f962b14529 100644 --- a/pkg/reconciler/taskrun/taskrun_test.go +++ b/pkg/reconciler/taskrun/taskrun_test.go @@ -1682,6 +1682,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" provenance: featureFlags: RunningInEnvWithInjectedSidecars: true @@ -1694,6 +1698,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `) reconciliatonError = fmt.Errorf("1 error occurred:\n\t* Provided results don't match declared results; may be invalid JSON or missing result declaration: \"aResult\": task result is expected to be \"array\" type but was initialized to a different type \"string\"") toBeRetriedTaskRun = parse.MustParseV1TaskRun(t, ` @@ -1747,6 +1755,10 @@ status: ResultExtractionMethod: "termination-message" MaxResultSize: 4096 Coschedule: "workspaces" + ExampleNewFeature: + Enabled: false + Stability: "alpha" + Name: "ExampleNewFeature" `) ) diff --git a/test/e2e-tests-kind-prow-alpha.env b/test/e2e-tests-kind-prow-alpha.env index 42f84533ab9..e940644f5e5 100644 --- a/test/e2e-tests-kind-prow-alpha.env +++ b/test/e2e-tests-kind-prow-alpha.env @@ -4,3 +4,4 @@ RUN_YAML_TESTS=true KO_DOCKER_REPO=registry.local:5000 E2E_GO_TEST_TIMEOUT=40m RESULTS_FROM=sidecar-logs +ExampleNewFeature=true \ No newline at end of file