Add fields for finch flag name and non-finch justification. (#3108)

This commit is contained in:
Jason Robbins 2023-06-22 09:48:50 -07:00 коммит произвёл GitHub
Родитель 9ba8b16f14
Коммит f99d66bd5c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
13 изменённых файлов: 83 добавлений и 6 удалений

Просмотреть файл

@ -47,6 +47,8 @@ FEATURE_FIELD_DATA_TYPES: FIELD_INFO_DATA_TYPE = [
('ff_views_link', 'str'),
('ff_views_notes', 'str'),
('flag_name', 'str'),
('finch_name', 'str'),
('non_finch_justification', 'str'),
('impl_status_chrome', 'int'),
('initial_public_proposal_url', 'str'),
('intent_stage', 'int'),

Просмотреть файл

@ -272,6 +272,8 @@ def feature_entry_to_json_verbose(
'screenshot_links': fe.screenshot_links or [],
'breaking_change': fe.breaking_change,
'flag_name': fe.flag_name,
'finch_name': fe.finch_name,
'non_finch_justification': fe.non_finch_justification,
'ongoing_constraints': fe.ongoing_constraints,
'motivation': fe.motivation,
'devtrial_instructions': fe.devtrial_instructions,

Просмотреть файл

@ -351,6 +351,8 @@ class FeatureConvertersTest(testing_config.CustomTestCase):
'feature_notes': 'notes',
'ff_views': 5,
'flag_name': None,
'finch_name': None,
'non_finch_justification': None,
'initial_public_proposal_url': None,
'interop_compat_risks': None,
'measurement': None,

Просмотреть файл

@ -95,6 +95,8 @@ const QUERIABLE_FIELDS = [
// 'requires_embedder_support': Feature.requires_embedder_support,
{name: 'browsers.chrome.flag_name', display: 'Flag name', type: TEXT_TYPE},
{name: 'browsers.chrome.finch_name', display: 'Finch name', type: TEXT_TYPE},
// 'browsers.chrome.non_finch_justification': Feature.non_finch_justification,
// 'all_platforms': Feature.all_platforms,
// 'all_platforms_descr': Feature.all_platforms_descr,
// 'wpt': Feature.wpt,

Просмотреть файл

@ -262,6 +262,8 @@ const FLAT_DEV_TRIAL_FIELDS = {
name: 'Implementation in Chromium',
fields: [
'flag_name',
'finch_name',
'non_finch_justification',
'dt_milestone_desktop_start',
'dt_milestone_android_start',
'dt_milestone_ios_start',
@ -493,6 +495,8 @@ const DEPRECATION_DEV_TRIAL_FIELDS = {
name: 'Implementation in Chromium',
fields: [
'flag_name',
'finch_name',
'non_finch_justification',
'dt_milestone_desktop_start',
'dt_milestone_android_start',
'dt_milestone_ios_start',

Просмотреть файл

@ -1261,7 +1261,34 @@ export const ALL_FIELDS = {
required: false,
label: 'Flag name',
help_text: html`
Name of the flag on chrome://flags that enables this feature.`,
Name of the flag on chrome://flags that allows a web developer to
enable this feature in their own browser to try it out.
E.g., "storage-buckets". These are defined in <a target="_blank"
href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/about_flags.cc">about_flags.cc</a>.`,
},
'finch_name': {
type: 'input',
attrs: TEXT_FIELD_ATTRS,
required: false,
label: 'Finch feature name',
help_text: html`
String name of the <code>base::Feature</code> defined via the
<code>BASE_FEATURE</code> macro in your feature implementation
code. E.g., "StoragBuckets". These names are used
in <a target="_blank"
href="https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5"
>runtime_enabled_features.json5</a> and finch GCL files`,
},
'non_finch_justification': {
type: 'textarea',
required: false,
label: 'Non-finch justification',
help_text: html`
The <a target="_blank"
href="https://chromium.googlesource.com/chromium/src/+/main/docs/flag_guarding_guidelines.md">Flag Guarding Guidelines</a> require new features to have
a finch flag. If your feature does not have a finch flag, explain why.`,
},
'prefixed': {

Просмотреть файл

@ -93,6 +93,8 @@ class FeatureEntry(ndb.Model): # Copy from Feature
# Implementation in Chrome
impl_status_chrome = ndb.IntegerProperty(required=True, default=NO_ACTIVE_DEV)
flag_name = ndb.StringProperty()
finch_name = ndb.StringProperty()
non_finch_justification = ndb.TextProperty()
ongoing_constraints = ndb.TextProperty()
# Topic: Adoption (reviewed by API Owners. Auto-approved gate later?)

Просмотреть файл

@ -192,6 +192,8 @@ class VerboseFeatureDict(TypedDict):
# Implementation in Chrome
flag_name: str | None
finch_name: str | None
non_finch_justification: str | None
ongoing_constraints: str | None
# Topic: Adoption

Просмотреть файл

@ -64,6 +64,8 @@ def get_strings(fe : FeatureEntry) -> list[str]:
# TODO: impl_status_Chrome
strings.append(fe.flag_name)
strings.append(fe.finch_name)
strings.append(fe.non_finch_justification)
strings.append(fe.ongoing_constraints)
strings.append(fe.motivation)

Просмотреть файл

@ -225,6 +225,9 @@ QUERIABLE_FIELDS: dict[str, Property] = {
'browsers.chrome.status': FeatureEntry.impl_status_chrome,
'browsers.chrome.flag_name': FeatureEntry.flag_name,
'browsers.chrome.finch_name': FeatureEntry.finch_name,
'browsers.chrome.non_finch_justification':
FeatureEntry.non_finch_justification,
'ongoing_constraints': FeatureEntry.ongoing_constraints,
'motivation': FeatureEntry.motivation,

Просмотреть файл

@ -178,6 +178,8 @@ class FeatureEditHandler(basehandlers.FlaskHandler):
('requires_embedder_support', 'bool'),
('devtrial_instructions', 'link'),
('flag_name', 'str'),
('finch_name', 'str'),
('non_finch_justification', 'str'),
('owner', 'emails'),
('editors', 'emails'),
('cc_recipients', 'emails'),

Просмотреть файл

@ -246,9 +246,21 @@ No
<br><br><h4>Flag name</h4>
<br><br><h4>Flag name on chrome://flags</h4>
None
<br><br><h4>Finch feature name</h4>
None
<br><br><h4>Non-finch justification</h4>
None
<br><br><h4>Requires code in //chrome?</h4>
False

Просмотреть файл

@ -195,9 +195,24 @@
>{{feature.devtrial_instructions}}</a>
{% endif %}
<br><br><h4>Flag name</h4>
<br><br><h4>Flag name on chrome://flags</h4>
{{feature.flag_name}}
<br><br><h4>Finch feature name</h4>
{{feature.finch_name}}
{% if feature.non_finch_justification %}
<br><br><h4>Non-finch justification</h4>
<p class="preformatted">{{feature.non_finch_justification|urlize}}</p>
{% else %}
{% if not feature.finch_name %}
<br><br><h4>Non-finch justification</h4>
None
{% endif %}
{% endif %}
<br><br><h4>Requires code in //chrome?</h4>
{{feature.requires_embedder_support}}