Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEP-0138]: Decouple API and Feature Versioning Proposal #1034

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Jul 7, 2023

This commit adds the proposals for decoupling api and feature versioning. This TEP is marked as 'implementable'.

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2023
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 7, 2023
@JeromeJu JeromeJu changed the title [WIP]TEP-0138: Improve Tekton Pipeline Feature Flags [WIP] [TEP-0138]: Improve Tekton Pipeline Feature Flags Jul 7, 2023
@tekton-robot tekton-robot added the kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). label Jul 7, 2023
@JeromeJu JeromeJu changed the title [WIP] [TEP-0138]: Improve Tekton Pipeline Feature Flags [TEP-0138]: Improve Tekton Pipeline Feature Flags Jul 10, 2023
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2023
@JeromeJu JeromeJu force-pushed the per-feature-flag branch 2 times, most recently from 9f9add6 to 56009ac Compare July 10, 2023 14:04
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably have to mark the TEP-0033 as superseeded by this one though.

@lbernick
Copy link
Member

/assign @vdemeester @afrittoli

@dibyom
Copy link
Member

dibyom commented Jul 10, 2023

/assign

@JeromeJu JeromeJu force-pushed the per-feature-flag branch 3 times, most recently from 4b7a6cd to 5eeacf5 Compare July 13, 2023 20:11
```go
type FeatureFlag struct {
// Name of the feature flag
Name string
Copy link
Member

@afrittoli afrittoli Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: What is the name used for? Perhaps for logging purposes?
Perhaps we could do something similar to what we have for behavioural flags:

type APIFeatureFlags struct {
   Foo  FeatureFlag
   Bar   FeatureFlag
}

Copy link
Member

@afrittoli afrittoli Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the name field could be kept for logging purposes.
As for the grouping of all the API feature flags, my understanding is that such struct would make sense if we would like to turn on behavioural features of a certain stability level. But I am not sure if this is going to be necessary while we fully switch to per-feature flags (i.e. after all current beta/alpha features stabilized)?

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates.

I think the current proposal looks really good - the only comment I have is about the deprecation / locking of feature flags.

Thanks for you for the detailed testing section. I think it's good to have some numbers about how many tests we may run. Beyond that we will probably have to decide on a feature by feature basis, based on the likelihood for features to collide and use cases of features used together.

@JeromeJu
Copy link
Member Author

JeromeJu commented Sep 6, 2023

Thanks @pritidesai , I also do appreciate your right on-the-spot suggestions.

In terms of the feature request, I updated it in the future work section. Also created tektoncd/pipeline#7093 for further discussion. I think this might also be a current feature request even without per feature flag to be introduced 🤔

@JeromeJu
Copy link
Member Author

JeromeJu commented Sep 6, 2023

Thank you for the updates.

I think the current proposal looks really good - the only comment I have is about the deprecation / locking of feature flags.

Thanks for you for the detailed testing section. I think it's good to have some numbers about how many tests we may run. Beyond that we will probably have to decide on a feature by feature basis, based on the likelihood for features to collide and use cases of features used together.

Thanks @afrittoli for the review!

I understand the cases that we need to test out where two features could be used together but not to have their feature flags correlated. Otherwise they shall be separated? (I think there are two flags related at the moment but one is deprecated)
Just would like to check my understanding here, I wonder theoretically two feature flags shall not be related with each other at all?

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2023
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 25, 2023
@JeromeJu JeromeJu force-pushed the per-feature-flag branch 2 times, most recently from 4b41175 to a5462c5 Compare September 28, 2023 19:34
teps/0138-decouple-api-and-feature-versioning.md Outdated Show resolved Hide resolved
teps/0138-decouple-api-and-feature-versioning.md Outdated Show resolved Hide resolved
teps/0138-decouple-api-and-feature-versioning.md Outdated Show resolved Hide resolved

- **Task and Pipeline Authors:** Tekton Pipeline and Task authors will get to know the list of features that are turned on from their service providers. See [future work](#future-work) for the better communication from cluster operators to users for more details.

### Sunset `enable-api-fields` after existing features stabilize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be worth mentioning the plans for new features being added before the per-feature flag model is implemented.

Some of the feature proposal/implementation:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we shall give heads up for existing features. But I am not sure if keeping it in the current TEP would be helpful since basically all new features coming in after this TEP being merged shall use per-feature flag model ideally.(Plus merging this TEP sooner so to avoid such situations) Maybe giving heads up in the WG could be a nice option WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that new features coming in should follow per-feature flag after this TEP is merged or implemented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes:) And it looks like most maintainers are on board with this TEP, we are hoping to get this merged by EOD. I will go ahead and update the API-compatibility policy ASAP.

- The same `pipeline` and `task` definitions might not be applied to a cluster with `enable-api-fields` set to `stable` after this change is implemented.
- The `pipeline` and `task` definitions in `v1beta1` implementing [beta features](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#beta-features) will not be applied to a cluster with `enable-api-fields` set to `stable` Such pipeline with beta features used in `v1beta1` apiVersion would not result in a successful pipelineRun because of [the validation after the conversion to `v1` as the storage version](https://github.com/tektoncd/pipeline/blob/d9d2d1760fa534e2dfb16ca656cdf2d293a5900e/pkg/apis/pipeline/`v1`/taskref_validation.go#L39). Since in this example, resolver is still a beta feature, this pipeline should not have been applied to the cluster that has not set `enable-api-fields=beta` in the first place.

### Per feature flag for _new_ api-driven features
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the API versions and feature stability levels are already decoupled with the Change existing validation to decouple feature and API versioning proposal. I'm wondering what is the motivation to use per-feature flag model?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment. I've put back the missing pieces:)

The reason that this was not previously included was that we first aimed to decouple feature versioning only and while moving forward with the discussion in API WG we've decided to use per-feature flag as the solution to decouple versioning in order to avoid the potential issues from setting the default stability level in the long run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This commit adds the proposals for decoupling api and feature versioning. This TEP is marked as 'implementable'.
@JeromeJu
Copy link
Member Author

JeromeJu commented Oct 4, 2023

Thanks for the reviews again @QuanZhang-William and @afrittoli . I've updated the TEP according to the feedback and comments along with more thorough formatting.

Due to the new features that are coming into pipeline, for example the feature flag usage in new features i.e. CEL expression and onError field, it might be helpful and to have less confusion to get this merged sooner than other features come in.

Much appreciated if we could get another look and approvals 🙏 @afrittoli @vdemeester

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👼🏼

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, pritidesai, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dibyom
Copy link
Member

dibyom commented Oct 4, 2023

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2023
@tekton-robot tekton-robot merged commit 0ad8577 into tektoncd:main Oct 4, 2023
3 checks passed
| Beta | Disabled |
| Alpha | Disabled |

Note that per-feature flags that have stabilized cannot be disabled. We will deprecate the per-feature flag after it has become stable and then remove it eventually after the deprecation period according to the API compatibility policy. We will give deprecation and later removel notice of the per-feature flags via release notes after their promotion to `stable`. Cluster operators who do not want such opt-in features would have enough notice to implement admission controllers on their own to disable the feature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeromeJu sorry, I thought I commented on this before, but I must have missed it 🙏

Keeping the feature flag around, deprecated but unusable does not make much sense to me.
Making it unusable provides the same behaviour as removing it, the deprecation has no effect really.

The only reason I could see to keep the flag around would be if we started validating the content of the config file (which we do not do today) - but even so, I think failing config validation would be preferrable to silently ignoring a feature flag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, I think I misread this section 🙏
A small update to the table might help - but feel free to ignore this - I can also propose a PR with the update if that's ok for you.

| Feature stability level | Default  |
| ----------------------- | -------- |
| Stable                  | Enabled; Cannot be disabled once the flag is removed (after deprecation) |
| Beta                    | Disabled |
| Alpha                   | Disabled |

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, PTAL #1091 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants