blob: 45fbbf140f772b418a4790489d00e254c4c4f4a6 [file] [log] [blame] [view]
Avi Drissmanf54d7ca2021-05-12 14:57:481# Chromium Flag Ownership
Avi Drissman465e778e2019-02-07 23:41:002
3ellyjones@ / avi@
4
Elly Fong-Jonescdb3a5c2023-01-05 20:56:155This document explains flag ownership in Chromium, and gives some principles and
6best practices.
Avi Drissmanf54d7ca2021-05-12 14:57:487
8See also [Chromium Flag Expiry](flag_expiry.md).
9
Avi Drissman465e778e2019-02-07 23:41:0010[TOC]
11
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1512## What Is Flag Ownership?
Avi Drissman465e778e2019-02-07 23:41:0013
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1514Every entry in chrome://flags is required to have at least one listed owner,
15which can be:
Avi Drissman465e778e2019-02-07 23:41:0016
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1517* A single person
18* A mailing list
19* A reference to an OWNERS file
Avi Drissman465e778e2019-02-07 23:41:0020
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1521The owners of a flag serve as points of contact for it, and are notified when
22it expires.
Avi Drissman465e778e2019-02-07 23:41:0023
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1524## Who Should Be An Owner?
Avi Drissman465e778e2019-02-07 23:41:0025
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1526In general, it's a good idea to include:
Avi Drissman465e778e2019-02-07 23:41:0027
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1528* The one or two SWEs who know the most about the flag and why it exists
29* An appropriate mailing list for the team that owns it, so that expirations are
30 not missed, or
31* An owners file that contains all the members of the owning team, again so that
32 expirations are not missed.
Avi Drissman465e778e2019-02-07 23:41:0033
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1534Three important notes about listing owners:
35
36* Any entry that is just a bare word (like "username") is treated as being
37 @chromium.org; by far the most common mistake is to write "username" when
38 "[email protected]" is meant. This is not a problem if you have both
39 chromium.org and google.com addresses.
40* The flag ownership database is *public*, so if your team's name is supposed to
41 be secret, don't list it; in that situation, it's better to create a new list
42 with a less revealing name and have it forward to your team's list.
43* Every listed owner must be able to receive email from an *unprivileged*
44 google.com account, so please don't list your team's private list that
45 requires joining to post or similar - your flag expiration email will bounce.
46 If your team's list needs to remain closed to posting, you should instead make
47 a separate list that allows open posting, or list an OWNERS file full of
48 individuals.
Avi Drissman465e778e2019-02-07 23:41:0049
50## I Don't Want My Flag To Expire!
51
52Some flags do not control UI features, but rather are commonly-used debugging
Corentin Walleze660b152020-07-15 16:07:5453controls, such as `ignore-gpu-blocklist`. For these flags, see the instructions
Avi Drissman465e778e2019-02-07 23:41:0054at the head of `flag-metadata.json`. Please be very judicious about
55never-expiring flags, since they represent ongoing engineering, test and support
56burden. The flags team will probably only approve your non-expiring flag if:
57
58- You regularly ask users or developers to change its value for
59 debugging/support purposes
60- You have been doing so for at least six months
61- You don't plan to stop doing so any time soon
62
63If you have a non-expiring flag, the flags team requires a comment in the json
64file as to the rationale that it be non-expiring. A quick sentence or two will
Avi Drissmanf54d7ca2021-05-12 14:57:4865be fine. (Yes, we are aware that, technically, JSON files can't have comments.
66Don't worry about it.) You'll also need to add your flag to the permitted list
67in
68[`//chrome/browser/flag-never-expire-list.json`](../chrome/browser/flag-never-expire-list.json)
Elly Fong-Jones92961362019-03-11 15:32:1969which will require approval from the flags team.
Avi Drissman465e778e2019-02-07 23:41:0070
71## What Should My Expiry Be?
72
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1573A good rule of thumb is that your flag should expire at least one milestone
74after you expect your feature to have launched to stable. In other words, if
75your feature will be 100% enabled on Stable in M74, your flag should be marked
76as expiring in M75 or later. However, you can freely leave yourself lots of
77slack - the purpose of expiration is to ensure that obsolete flags eventually
78get cleaned up, but whether that takes one milestone or five for any given flag
79is not a big deal. It is also very easy to adjust the expiration milestone later
80if you need to.
Avi Drissman465e778e2019-02-07 23:41:0081
Elly Fong-Jonescdb3a5c2023-01-05 20:56:1582One practice is to always set your expirations to the next "round" milestone
83after you expect to launch, so that your team can batch flag cleanup work - for
84example, if your feature is planned to go out in M101, you might set the
85expiration to M105, and then your team might schedule a flag cleanup for the 105
86branch time.
Avi Drissman465e778e2019-02-07 23:41:0087
88## I Have Other Questions
89
90Please get in touch with
91[`[email protected]`](https://groups.google.com/a/chromium.org/forum/#!forum/flags-dev).
92If you feel like you need to have a Google-internal discussion for some reason,
93there's also
94[`chrome-flags@`](https://groups.google.com/a/google.com/forum/#!forum/chrome-flags).
Avi Drissmanf54d7ca2021-05-12 14:57:4895
96## Relevant Source Files
97
98* [`//chrome/browser/about_flags.cc`](../chrome/browser/about_flags.cc)
99* [`//chrome/browser/flag-metadata.json`](../chrome/browser/flag-metadata.json)
100* [`//chrome/browser/flag-never-expire-list.json`](../chrome/browser/flag-never-expire-list.json)
101* [`//chrome/browser/expired_flags_list.h`](../chrome/browser/expired_flags_list.h)
Avi Drissmandbaa3cd2021-05-13 16:07:33102* [`//ios/chrome/browser/flags/about_flags.mm`](../ios/chrome/browser/flags/about_flags.mm)
Avi Drissmanf54d7ca2021-05-12 14:57:48103* [`//tools/flags/generate_expired_list.py`](../tools/flags/generate_expired_list.py)
104* [`//tools/flags/generate_unexpire_flags.py`](../tools/flags/generate_unexpire_flags.py)