Add feature flag to toggle cert-based clusters features
What does this MR do and why?
This FF purpose is to facilitate de removal of many features related to certificate-based clusters. The removal is scheduled to %15.0. See the epic: gitlab-org/configure&8.
More specifically, it relates to https://gitlab.com/gitlab-org/configure/general/-/issues/178
With this feature flag we'll have a quick an easy way to rollback changes in case something goes wrong after we turn features off in the major milestone. That's because toggling a FF is quicker than reverting an MR (or many) and getting the revert released on GitLab.com and Self-Managed patch versions.
Also, we'll have more time to delete the deprecated code after %15.0 with more peace of mind.
This FF, differently than documented in our development docs guideline, is enabled by default. Since it's a FF to remove features, not to add them, I believe this makes more sense in this case. I'm adding the FF in such a way that when it's enabled, all the features will keep working. When we disable it, the features will be dropped. The other advantage of this approach is that our specs are configured to have FF enabled by default. If I'd create this FF as disabled by default, a lot of tests would immediately break, thus it's much more convenient to have the FF as enabled by default, then add specific tests for the FF disabled as we work on separate MRs to hide the features.
This FF is a ground work to be used to hide all the features that are enlisted in gitlab-org/configure&8, but since there are too many, we'll work on them via separate Issues/MRs.
As we need to have the FF in at least one place when we introduce it, I'm adding it to the deployment_platform
. Disabling the deployment_platform
is a core part of the certificate-base clusters. On way to test it, is that Auto DevOps pipelines will stop producing production
jobs when the FF is disabled.
Screenshots or screen recordings
With FF enabled: production job still shows up
With FF disabled: production job does not show up
How to set up and validate locally
- Create a project from the nodejs template
- Associate a certificate-based Kubernetes cluster through 'Infrastructure -> Kubernetes clusters'
- Use the Connect existing cluster. (the cluster doesn't have to exist, just add bogus data on the next form)
- On your cluster detail page, add a bogus base domain, so Auto DevOps can be triggered
- Start a pipeline if it has not already started
- Check that your the pipelines includes the
production
job - Disable the feature flag for your nodejs project
project = Project.last Feature.disable(:certificate_based_clusters, project)
- Manually trigger a new pipeline
- Validate that the new pipeline does not contain a
production
job
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.