Add ot fields in the trial creation questionnaire (#3194)

This commit is contained in:
Daniel Smith 2023-07-26 08:09:18 -07:00 коммит произвёл GitHub
Родитель b0f1e19ffb
Коммит 86a1e7d52d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 154 добавлений и 6 удалений

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

@ -103,6 +103,12 @@ STAGE_FIELD_DATA_TYPES: FIELD_INFO_DATA_TYPE = [
('intent_thread_url', 'link'),
('origin_trial_feedback_url', 'link'),
('origin_trial_id', 'str'),
('ot_chromium_trial_name', 'str'),
('ot_documentation_url', 'link'),
('ot_has_third_party_support', 'bool'),
('ot_is_critical_trial', 'bool'),
('ot_is_deprecation_trial', 'bool'),
('ot_webfeature_use_counter', 'str'),
('rollout_impact', 'int'),
('rollout_milestone', 'int'),
('rollout_platforms', 'split_str'),

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

@ -189,6 +189,12 @@ def stage_to_json_dict(
'experiment_risks': stage.experiment_risks,
'origin_trial_id': stage.origin_trial_id,
'origin_trial_feedback_url': stage.origin_trial_feedback_url,
'ot_chromium_trial_name': stage.ot_chromium_trial_name,
'ot_documentation_url': stage.ot_documentation_url,
'ot_has_third_party_support': stage.ot_has_third_party_support,
'ot_is_critical_trial': stage.ot_is_critical_trial,
'ot_is_deprecation_trial': stage.ot_is_deprecation_trial,
'ot_webfeature_use_counter': stage.ot_webfeature_use_counter,
'extensions': [],
'experiment_extension_reason': stage.experiment_extension_reason,
'ot_stage_id': stage.ot_stage_id,

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

@ -67,6 +67,12 @@ class StagesAPITest(testing_config.CustomTestCase):
origin_trial_id='-5269211564023480319',
ux_emails=['ux_person@example.com'],
intent_thread_url='https://example.com/intent',
ot_chromium_trial_name='ExampleChromiumTrialName',
ot_documentation_url='https://example.com/ot_docs',
ot_has_third_party_support=True,
ot_is_deprecation_trial=True,
ot_is_critical_trial=True,
ot_webfeature_use_counter='kExampleUseCounter',
milestones=MilestoneSet(desktop_first=100),
experiment_goals='To be the very best.',
created=self.now)
@ -92,6 +98,12 @@ class StagesAPITest(testing_config.CustomTestCase):
'enterprise_policies': [],
'origin_trial_id': None,
'origin_trial_feedback_url': None,
'ot_chromium_trial_name': None,
'ot_documentation_url': None,
'ot_has_third_party_support': False,
'ot_is_critical_trial': False,
'ot_is_deprecation_trial': False,
'ot_webfeature_use_counter': None,
'experiment_extension_reason': None,
'experiment_goals': 'To be the very best.',
'experiment_risks': None,
@ -176,6 +188,12 @@ class StagesAPITest(testing_config.CustomTestCase):
'experiment_goals': 'To be the very best.',
'experiment_risks': None,
'origin_trial_feedback_url': None,
'ot_chromium_trial_name': None,
'ot_documentation_url': None,
'ot_has_third_party_support': False,
'ot_is_critical_trial': False,
'ot_is_deprecation_trial': False,
'ot_webfeature_use_counter': None,
'announcement_url': None,
'enterprise_policies': [],
'experiment_extension_reason': None,
@ -217,6 +235,12 @@ class StagesAPITest(testing_config.CustomTestCase):
'enterprise_policies': [],
'origin_trial_id': '-5269211564023480319',
'origin_trial_feedback_url': None,
'ot_chromium_trial_name': 'ExampleChromiumTrialName',
'ot_documentation_url': 'https://example.com/ot_docs',
'ot_has_third_party_support': True,
'ot_is_critical_trial': True,
'ot_is_deprecation_trial': True,
'ot_webfeature_use_counter': 'kExampleUseCounter',
'rollout_details': None,
'rollout_impact': 2,
'rollout_milestone': None,

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

@ -292,7 +292,13 @@ const FLAT_ORIGIN_TRIAL_FIELDS = {
// TODO(jrobbins): display r4dt_url instead when deprecating.
'i2e_lgtms',
'intent_to_experiment_url',
'ot_chromium_trial_name',
'ot_webfeature_use_counter',
'ot_documentation_url',
'origin_trial_feedback_url',
'ot_is_deprecation_trial',
'ot_has_third_party_support',
'ot_is_critical_trial',
],
},
// Implementation
@ -521,7 +527,13 @@ const DEPRECATION_ORIGIN_TRIAL_FIELDS = {
'ongoing_constraints',
'r4dt_url', // map to name="intent_to_experiment_url" field upon form submission
'r4dt_lgtms', // map to name="i2e_lgtms" field upon form submission
'ot_chromium_trial_name',
'ot_webfeature_use_counter',
'ot_documentation_url',
'origin_trial_feedback_url',
'ot_is_deprecation_trial',
'ot_has_third_party_support',
'ot_is_critical_trial',
],
},
// Implementation

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

@ -242,6 +242,12 @@ export const STAGE_SPECIFIC_FIELDS = new Set([
// Misc fields.
'display_name',
'origin_trial_feedback_url',
'ot_chromium_trial_name',
'ot_webfeature_use_counter',
'ot_documentation_url',
'ot_is_deprecation_trial',
'ot_has_third_party_support',
'ot_is_critical_trial',
'finch_url',
'experiment_goals',
'experiment_risks',

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

@ -1016,6 +1016,68 @@ export const ALL_FIELDS = {
Trials team.`,
},
'ot_chromium_trial_name': {
type: 'input',
attrs: TEXT_FIELD_ATTRS,
required: false,
label: 'Chromium trial name',
help_text: html`
Name for the trial, as specified 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>.`,
},
'ot_documentation_url': {
type: 'input',
attrs: URL_FIELD_ATTRS,
required: false,
label: 'Documentation link',
help_text: html`
Link to more information to help developers use the trial's feature
(e.g. blog post, Github explainer, etc.).`,
},
'ot_has_third_party_support': {
type: 'checkbox',
initial: false,
label: 'Origin trial supports third party origins',
help_text: html`
Whether this trial supports third party origins. See
<a href="https://web.dev/third-party-origin-trials/">this article</a>
for more information.`,
},
'ot_is_critical_trial': {
type: 'checkbox',
initial: false,
label: 'Critical origin trial',
help_text: html`
See <a href="go/running-an-origin-trial">go/running-an-origin-trial</a>
for criteria and additional process requirements.`,
},
'ot_is_deprecation_trial': {
type: 'checkbox',
initial: false,
label: 'Deprecation trial',
help_text: html`
Is this a deprecation trial? See the
<a href="https://www.chromium.org/blink/launching-features/#deprecation-trial"
>deprecation trial section</a> for more information.`,
},
'ot_webfeature_use_counter': {
type: 'input',
attrs: TEXT_FIELD_ATTRS,
required: false,
label: 'WebFeature UseCounter name',
help_text: html`
For measuring usage, this must be a single named value from the
WebFeature enum, e.g. kWorkerStart. See
<a href="https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom"
>web_feature.mojom</a>.`,
},
'anticipated_spec_changes': {
type: 'textarea',
attrs: {rows: 4},

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

@ -270,15 +270,23 @@ class Stage(ndb.Model):
te_emails = ndb.StringProperty(repeated=True)
# Gate-related fields that need separate values for repeated stages.
# copy from Feature.
experiment_goals = ndb.TextProperty()
experiment_risks = ndb.TextProperty()
announcement_url = ndb.StringProperty()
experiment_extension_reason = ndb.TextProperty()
intent_thread_url = ndb.StringProperty()
intent_subject_line = ndb.StringProperty()
# Origin trial fields
origin_trial_id = ndb.StringProperty()
origin_trial_feedback_url = ndb.StringProperty()
announcement_url = ndb.StringProperty()
experiment_goals = ndb.TextProperty()
experiment_risks = ndb.TextProperty()
ot_chromium_trial_name = ndb.StringProperty()
ot_documentation_url = ndb.StringProperty()
ot_has_third_party_support = ndb.BooleanProperty(default=False)
ot_is_critical_trial = ndb.BooleanProperty(default=False)
ot_is_deprecation_trial = ndb.BooleanProperty(default=False)
ot_webfeature_use_counter = ndb.StringProperty()
# Origin trial stage id that this stage extends, if trial extension stage.
ot_stage_id = ndb.IntegerProperty()

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

@ -43,6 +43,12 @@ class StageDict(TypedDict):
experiment_risks: str | None
extensions: list[StageDict] # type: ignore
origin_trial_feedback_url: str | None
ot_chromium_trial_name: str | None
ot_documentation_url: str | None
ot_has_third_party_support: bool
ot_is_critical_trial: bool
ot_is_deprecation_trial: bool
ot_webfeature_use_counter: str | None
# Trial extension specific fields.
ot_stage_id: int | None

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

@ -249,11 +249,17 @@ class FeatureEditHandler(basehandlers.FlaskHandler):
# Field name, data type
STAGE_FIELDS: list[tuple[str, str]] = [
('announcement_url', 'link'),
('origin_trial_feedback_url', 'link'),
('experiment_extension_reason', 'str'),
('finch_url', 'link'),
('experiment_goals', 'str'),
('experiment_risks', 'str'),
('origin_trial_feedback_url', 'link'),
('ot_chromium_trial_name', 'str'),
('ot_documentation_url', 'link'),
('ot_has_third_party_support', 'bool'),
('ot_is_critical_trial', 'bool'),
('ot_is_deprecation_trial', 'bool'),
('ot_webfeature_use_counter', 'str'),
('rollout_impact', 'int'),
('rollout_milestone', 'int'),
('rollout_platforms', 'split_str'),

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

@ -83,10 +83,22 @@
{% endif %}
{% for stage in stage_info.ot_stages %}
{% if stage.origin_trial_feedback_url %}
{% if stage.ot_chromium_trial_name %}
<br><br><h4>Chromium Trial Name</h4>
{{stage.ot_chromium_trial_name}}
{% endif %}{% if stage.origin_trial_feedback_url %}
<br><br><h4>Link to origin trial feedback summary</h4>
{{stage.origin_trial_feedback_url}}
{% endif %}{% if stage.ot_documentation_url %}
<br><br><h4>Origin Trial documentation link</h4>
{{stage.ot_documentation_url}}
{% endif %}{% if stage.ot_webfeature_use_counter %}
<br><br><h4>WebFeature UseCounter name</h4>
{{stage.ot_webfeature_use_counter}}
{% endif %}
{% endfor %}
<br><br><h4>Risks</h4>