From 553e7cdee1d2a46a208cbdc78318db86f3ecbbb7 Mon Sep 17 00:00:00 2001 From: Kyle Ju Date: Thu, 2 Jan 2025 14:04:28 -0800 Subject: [PATCH] Add web_feature for feature creation backend (#4657) * Add web_feature for feature creation backend * Address entity property type --- api/api_specs.py | 1 + api/converters.py | 1 + api/converters_test.py | 3 ++- internals/core_models.py | 1 + internals/data_types.py | 1 + pages/guide.py | 3 ++- 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api/api_specs.py b/api/api_specs.py index 69d20164e51d..ac24a8df46c9 100644 --- a/api/api_specs.py +++ b/api/api_specs.py @@ -47,6 +47,7 @@ ('ergonomics_risks', 'str'), ('explainer_links', 'links'), ('feature_notes', 'str'), + ('web_feature', 'str'), ('feature_type', 'int'), ('ff_views', 'int'), ('ff_views_link', 'link'), diff --git a/api/converters.py b/api/converters.py index 0b547581628c..e241eb6f0d4b 100644 --- a/api/converters.py +++ b/api/converters.py @@ -355,6 +355,7 @@ def feature_entry_to_json_verbose( 'category': FEATURE_CATEGORIES[fe.category], 'category_int': fe.category, 'feature_notes': fe.feature_notes, + 'web_feature': fe.web_feature, 'enterprise_feature_categories': fe.enterprise_feature_categories or [], 'enterprise_product_category': fe.enterprise_product_category or ENTERPRISE_PRODUCT_CATEGORY_CHROME_BROWSER_UPDATE, 'stages': stage_info['all_stages'], diff --git a/api/converters_test.py b/api/converters_test.py index 1c255adeb7e5..2dadb809193e 100644 --- a/api/converters_test.py +++ b/api/converters_test.py @@ -64,7 +64,7 @@ def setUp(self): devrel_emails=['devrel@example.com'], prefixed=False, intent_stage=1, tag_review_status=1, security_review_status=2, privacy_review_status=1, feature_notes='notes', - updated=self.date, accurate_as_of=self.date, created=self.date) + updated=self.date, accurate_as_of=self.date, created=self.date, web_feature='css') self.fe_1.put() # Write stages for the feature. @@ -371,6 +371,7 @@ def test_feature_entry_to_json_verbose__normal(self): 'experiment_timeline': None, 'explainer_links': [], 'feature_notes': 'notes', + 'web_feature': 'css', 'ff_views': 5, 'flag_name': None, 'finch_name': None, diff --git a/internals/core_models.py b/internals/core_models.py index 2df9bd1e88ea..afb2daa6434d 100644 --- a/internals/core_models.py +++ b/internals/core_models.py @@ -94,6 +94,7 @@ class FeatureEntry(ndb.Model): # Copy from Feature star_count = ndb.IntegerProperty(default=0) search_tags = ndb.StringProperty(repeated=True) feature_notes = ndb.TextProperty() # copy from comments + web_feature = ndb.StringProperty() # Metadata: Process information feature_type = ndb.IntegerProperty(required=True, default=FEATURE_TYPE_INCUBATE_ID) diff --git a/internals/data_types.py b/internals/data_types.py index 78ca55962dd1..cd201b180160 100644 --- a/internals/data_types.py +++ b/internals/data_types.py @@ -205,6 +205,7 @@ class VerboseFeatureDict(TypedDict): feature_notes: str | None enterprise_feature_categories: list[str] enterprise_product_category: int + web_feature: str | None # Metadata: Process information feature_type: str diff --git a/pages/guide.py b/pages/guide.py index d75084428162..d258b43509d6 100644 --- a/pages/guide.py +++ b/pages/guide.py @@ -90,7 +90,8 @@ def process_post_data(self, **kwargs): enterprise_impact=int(self.form.get('enterprise_impact', '1')), first_enterprise_notification_milestone=enterprise_notification_milestone, blink_components=blink_components, - tag_review_status=processes.initial_tag_review_status(feature_type)) + tag_review_status=processes.initial_tag_review_status(feature_type), + web_feature=self.form.get('web_feature')) if shipping_year: feature_entry.shipping_year = shipping_year key: ndb.Key = feature_entry.put()