Skip to content

Introduce new feature flag types, constraints and improve bin/feature-flag

Rémy Coutable requested to merge iterate-on-feature-flag-process into master

What does this MR do and why?

This implements the new feature flag types and constraints from https://docs.gitlab.com/ee/architecture/blueprints/feature_flags_usage_in_dev_and_ops/index.html#introduce-new-feature-flag-types.

This also update the bin/feature-flag tool to:

  • handle the new gitlab_com_derisk, wip, and beta types
  • allow to select types and group labels from numeric indexes to avoid typos
  • ensure group label actually exists in the SSOT at https://about.gitlab.com/groups.json
  • allow to give a "feature issue" URL
  • allow to give a GitLab username (and checks that it actually exists) to be used as the DRI in the rollout issue
  • generate the rollout issue from the input entered via bin/feature-flag
  • copy the rollout issue content automatically to the clipboard
  • open the "new issue" url (changed to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/new) automatically (with the title set), so that the user only has to paste the complete issue content and submit
  • check that all the given URLs are valid with a HEAD request

Review app: https://main-ee-136599.docs.gitlab-review.app/ee/development/feature_flags/index.html#types-of-feature-flags

Checks before merge

Usage

Click to expand
$ bin/feature-flag foo

>> Specify the feature flag type:

1. gitlab_com_derisk    Short lived, used to de-risk GitLab.com deployments
2.               wip    Used to hide unfinished code from anyone
3.              beta    Use when we aren't confident about scaling/supporting a feature, or when it isn't complete enough for an MVC
4.               ops    Long-lived feature flags that control operational aspects of GitLab's behavior
5.        experiment    Short lived, used specifically to run A/B/n experiments.
6.            worker    Feature flags for controlling Sidekiq workers behavior (e.g. deferring jobs)
7.         undefined    Feature flags that are undefined in GitLab codebase (should not be used)
?> 3
You picked the type 'beta'

>> Specify the group label to which the feature flag belongs, from the following list:
1. group::5-min-app
2. group::acquisition
3. group::activation
4. group::ai framework
5. group::ai model validation
6. group::analytics instrumentation
7. group::anti-abuse
8. group::authentication
9. group::authorization
10. group::cloud connector
11. group::code creation
12. group::code review
13. group::compliance
14. group::composition analysis
15. group::container registry
16. group::database
17. group::dataops
18. group::dedicated
19. group::delivery
20. group::distribution::build
21. group::distribution::deploy
22. group::duo chat
23. group::dynamic analysis
24. group::editor extensions
25. group::environments
26. group::foundations
27. group::fulfillment platform
28. group::geo
29. group::gitaly::cluster
30. group::gitaly::git
31. group::global search
32. group::ide
33. group::import and integrate
34. group::knowledge
35. group::mlops
36. group::mobile devops
37. group::no code automation
38. group::observability
39. group::optimize
40. group::package registry
41. group::pipeline authoring
42. group::pipeline execution
43. group::pipeline security
44. group::product analytics
45. group::product planning
46. group::project management
47. group::provision
48. group::pubsec services
49. group::purchase
50. group::respond
51. group::runner
52. group::runner saas
53. group::scalability
54. group::security policies
55. group::source code
56. group::static analysis
57. group::subscription management
58. group::switchboard
59. group::tenant scale
60. group::threat insights
61. group::utilization
62. group::vulnerability research
?> 33
You picked the group 'group::import and integrate'

>> URL of the original feature issue (enter to skip):
?> 

>> URL of the MR introducing the feature flag (enter to skip and let Danger provide a suggestion directly in the MR):
?> 

>> Username of the feature flag DRI (enter to skip):
?> 

>> Press any key and paste the issue content that we copied to your clipboard! 🚀
?> 
>> URL of the rollout issue (enter to skip):
?> 
create config/feature_flags/beta/foo.yml
---
name: foo
feature_issue_url:
introduced_by_url:
rollout_issue_url:
milestone: '16.6'
group: group::import and integrate
type: beta
default_enabled: false

Communication plan

Message:

With https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136599, we're improving a few things around feature flags:

- Deprecation of the `development` type and introduction of the new `gitlab_com_derisk` (most feature flags), `wip`, and `beta` types (learn more about the new types at https://docs.gitlab.com/ee/architecture/blueprints/feature_flags_usage_in_dev_and_ops/index.html#introduce-new-feature-flag-types)
- Rollout issues will be created (automatically by the `bin/feature-flag` script) in https://gitlab.com/gitlab-com/gl-infra/production/-/issues from now on
- Improvements to the `bin/feature-flag` script:
    - allow to select types and group labels from numeric indexes to avoid typos
    - ensure group label actually exists in the SSOT at https://about.gitlab.com/groups.json
    - allow to give a "feature issue" URL to better cross-link feature issue, implementation MR, rollout issue, and FF state change issues
    - allow to give a GitLab username (and checks that it actually exists) to be used as the DRI in the rollout issue (defaults to the GitLab current user if not specified)
    - generate the rollout issue content from the input entered via `bin/feature-flag` and automatically copy it to the clipboard
    - open the "new issue" url automatically (with the title set), so that you'll only have to paste the complete issue content and submit the new issue

I hope you enjoy these improvements and welcome any feedback at https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/issues/352.
  • Slack: #development, #backend, #frontend, #g_engineering_productivity, #test-platform
  • Engineering Week in Review

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/16237.

Edited by Rémy Coutable

Merge request reports

Loading