chromium-dashboard/main.py

302 строки
12 KiB
Python
Исходник Обычный вид История

# -*- coding: utf-8 -*-
# Copyright 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from dataclasses import dataclass, field
from typing import Any, Type
import threading
from api import accounts_api
from api import blink_components_api
from api import component_users
from api import components_users
from api import channels_api
from api import comments_api
from api import cues_api
from api import features_api
from api import feature_links_api
from api import login_api
from api import logout_api
from api import metricsdata
from api import origin_trials_api
from api import permissions_api
from api import processes_api
from api import reviews_api
from api import settings_api
from api import stages_api
from api import stars_api
from api import token_refresh_api
from framework import basehandlers
from framework import csp
from framework import sendemail
from internals import detect_intent
from internals import fetchmetrics
from internals import feature_links
from internals import maintenance_scripts
from internals import notifier
from internals import data_backup
from internals import inactive_users
from internals import search_fulltext
from internals import reminders
from pages import featurelist
from pages import guide
from pages import intentpreview
from pages import metrics
OT requests admin page (#3352) * parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414849 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414839 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414831 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414745 -0700 Documentation for feature links (#3317) * Add documentation for feature links * Update documentation for feature links npm: bump tar from 6.1.15 to 6.2.0 (#3318) Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.15 to 6.2.0. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.1.15...v6.2.0) --- updated-dependencies: - dependency-name: tar dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump eslint from 8.48.0 to 8.49.0 (#3319) Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.49.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.49.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @babel/register from 7.22.5 to 7.22.15 (#3320) Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.22.5 to 7.22.15. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.15/packages/babel-register) --- updated-dependencies: - dependency-name: "@babel/register" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump rollup from 3.28.1 to 3.29.1 (#3321) Bumps [rollup](https://github.com/rollup/rollup) from 3.28.1 to 3.29.1. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v3.28.1...v3.29.1) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Enforce rollout milestones to have a minimum value of 100 (#3316) Revert "temporarily remove OT cron" (#3322) This reverts commit 5da4d251a99a5d6bcb1f453203671b90940ae071. Update cron description (#3323) * Update cron.yaml * Update cron.yaml Update chromedash-feature-detail.js (#3324) Record vote activities with amendments instead of text. (#3314) * Record vote activities with amendments instead of text. * Stop checking comments_only Add support for testing mobile (i.e. narrow window). (#3325) * Add support for testing mobile (i.e. narrow window). * Cleanup Ensure all available features for a release note are fetched (#3328) - Add new query parameter releaseNotesMilestone to the GET /features route - Ensure all shipping and enterprise features are returned from the milestone specified in releaseNotesMilestone until the latest available feature - Update front end logic to wait for a channel to be selected before getting the features for the release notes - Update front end logic to fetch policies each time the target milestone is changed Add 3 more fields for OT creation (#3327) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line Add indexes needed for enterprise release notes. (#3329) Hide enterprise features from /features page (#3330) Enterprise features were shown on /features when they should never be shown there. This PR filters out enterprise features from the features sent to /features Ensure milestone comparison is made between two int types (#3331) Add `ot_feedback_submission_url` field (#3333) Add 3 more fields for OT creation `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT remove test line Add basic UI for trial creation request Add `ot_feedback_submission_url` to ot creation ot button only shows on ot stage details Update chromedash-feature-detail.js fix OT button cancel button returns to feature detail add ot milestone fields Update chromedash-feature-detail.js Add action_requested field for creation/extension show button disabled if already requested trial association cron clears ot action requests `/admin/ot_requests.html` Fix base.css unix perms. (#3338) don't write to the same entity multiple times (#3345) npm: bump @babel/preset-env from 7.22.15 to 7.22.20 (#3340) Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.22.15 to 7.22.20. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.20/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @lit-labs/context from 0.4.0 to 0.4.1 (#3341) Bumps [@lit-labs/context](https://github.com/lit/lit/tree/HEAD/packages/labs/context) from 0.4.0 to 0.4.1. - [Release notes](https://github.com/lit/lit/releases) - [Changelog](https://github.com/lit/lit/blob/main/packages/labs/context/CHANGELOG.md) - [Commits](https://github.com/lit/lit/commits/@lit-labs/context@0.4.1/packages/labs/context) --- updated-dependencies: - dependency-name: "@lit-labs/context" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump sass from 1.66.1 to 1.67.0 (#3342) Bumps [sass](https://github.com/sass/dart-sass) from 1.66.1 to 1.67.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.66.1...1.67.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @playwright/test from 1.37.1 to 1.38.0 (#3343) Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.37.1 to 1.38.0. - [Release notes](https://github.com/Microsoft/playwright/releases) - [Commits](https://github.com/Microsoft/playwright/compare/v1.37.1...v1.38.0) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Add test of entering a blink_component name (#3349) * Add test to enter blink component * Update the README a bit. * Change name of test, update images. * Delete commented out code. npm: bump @babel/core from 7.22.11 to 7.22.20 (#3344) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.11 to 7.22.20. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.20/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Add `ot_owner_email` and `ot_display_name` fields Add 3 more fields for OT creation `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT remove test line Add basic UI for trial creation request Update chromedash-feature-detail.js cancel button returns to feature detail add ot milestone fields fix test Add "overdue" to the tooltip on overdue gate chips. (#3350) * Add "overdue" to the tooltip on overdue gate chips. * Also remove gate name. Add `ot_action_requested` field to denote sent requests (#3336) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Add action_requested field for creation/extension * Refined requests admin page Add `ot_owner_email` and `ot_display_name` field (#3351) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Squashed commit of the following: commit 142f605e74604de299e6f346e31066d2c50ea79a Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:06:53 2023 -0700 Update chromedash-feature-detail.js commit 83c98ea8a91ea9bab0a4b55fa03579fdf68468e7 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:00:01 2023 -0700 add ot milestone fields commit b50933fcb655290647f8c0945423e5d44d104815 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:18:46 2023 -0700 cancel button returns to feature detail commit 9047830f201afb9f502b837a129cc047d065b9a9 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:02:06 2023 -0700 fix OT button commit b442dfd495318aea44ff3046d33a4343f3487e7e Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:49:21 2023 -0700 Update chromedash-feature-detail.js commit e78ed6bab1f6816104a5caebc5fcb86d00a75886 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:44:07 2023 -0700 ot button only shows on ot stage details commit a2d8df80473a034100f8a982e00285268c3c931f Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 16:04:52 2023 -0700 Add `ot_feedback_submission_url` to ot creation commit cb0b1e621f740dc733901303725f93aa1a96c2fd Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 14:16:22 2023 -0700 Add basic UI for trial creation request commit a843707680f32bc280085d795bfa28cdff751c73 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:50:19 2023 -0700 remove test line commit 1b471fad6fcc5a4e35d0892863eb1456a968cdcb Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:46:44 2023 -0700 `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT commit cc0308efc71cc0b2bcd9fb938c2cfdfef3d91da2 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 10:53:06 2023 -0700 Add 3 more fields for OT creation * Add `ot_owner_email` and `ot_display_name` fields * fix test User email automatically added to OT contacts list (#3339) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Squashed commit of the following: commit 142f605e74604de299e6f346e31066d2c50ea79a Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:06:53 2023 -0700 Update chromedash-feature-detail.js commit 83c98ea8a91ea9bab0a4b55fa03579fdf68468e7 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:00:01 2023 -0700 add ot milestone fields commit b50933fcb655290647f8c0945423e5d44d104815 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:18:46 2023 -0700 cancel button returns to feature detail commit 9047830f201afb9f502b837a129cc047d065b9a9 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:02:06 2023 -0700 fix OT button commit b442dfd495318aea44ff3046d33a4343f3487e7e Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:49:21 2023 -0700 Update chromedash-feature-detail.js commit e78ed6bab1f6816104a5caebc5fcb86d00a75886 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:44:07 2023 -0700 ot button only shows on ot stage details commit a2d8df80473a034100f8a982e00285268c3c931f Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 16:04:52 2023 -0700 Add `ot_feedback_submission_url` to ot creation commit cb0b1e621f740dc733901303725f93aa1a96c2fd Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 14:16:22 2023 -0700 Add basic UI for trial creation request commit a843707680f32bc280085d795bfa28cdff751c73 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:50:19 2023 -0700 remove test line commit 1b471fad6fcc5a4e35d0892863eb1456a968cdcb Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:46:44 2023 -0700 `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT commit cc0308efc71cc0b2bcd9fb938c2cfdfef3d91da2 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 10:53:06 2023 -0700 Add 3 more fields for OT creation * Add `ot_owner_email` and `ot_display_name` fields * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * user email automatically added to ot contacts list * update to use new `ot_owner_email` field * fix test --------- Co-authored-by: Ping <5123601+pingren@users.noreply.github.com>
2023-09-26 19:35:56 +03:00
from pages import ot_requests
from pages import users
import settings
# Patch treading library to work-around bug with Google Cloud Logging.
original_delete = threading.Thread._delete # type: ignore
def safe_delete(self):
try:
original_delete(self)
except KeyError:
pass
threading.Thread._delete = safe_delete # type: ignore
# Sets up Cloud Logging client library.
if not settings.UNIT_TEST_MODE and not settings.DEV_MODE:
import google.cloud.logging
client = google.cloud.logging.Client()
client.setup_logging()
# Note: In the URLs below, parameters like <int:feature_id> are
# required for the URL to match the route, but we still accecpt
# those parameters as keywords in those handlers where the same
# handler might be used for multiple routes that have the field
# or not.
@dataclass
class Route:
path: str
handler_class: Type[basehandlers.BaseHandler] = basehandlers.SPAHandler
defaults: dict[str, Any] = field(default_factory=dict)
metrics_chart_routes: list[Route] = [
Route('/data/timeline/cssanimated', metricsdata.AnimatedTimelineHandler),
Route('/data/timeline/csspopularity', metricsdata.PopularityTimelineHandler),
Route('/data/timeline/featurepopularity',
metricsdata.FeatureObserverTimelineHandler),
Route('/data/csspopularity', metricsdata.CSSPopularityHandler),
Route('/data/cssanimated', metricsdata.CSSAnimatedHandler),
Route('/data/featurepopularity',
metricsdata.FeatureObserverPopularityHandler),
Route('/data/blink/<string:prop_type>', metricsdata.FeatureBucketsHandler),
]
# TODO(jrobbins): Advance this to v1 once we have it fleshed out
API_BASE = '/api/v0'
api_routes: list[Route] = [
Route(f'{API_BASE}/features', features_api.FeaturesAPI),
Route(f'{API_BASE}/features/<int:feature_id>', features_api.FeaturesAPI),
Route(f'{API_BASE}/features/create', features_api.FeaturesAPI),
Route(f'{API_BASE}/feature_links', feature_links_api.FeatureLinksAPI),
Route(f'{API_BASE}/feature_links_summary', feature_links_api.FeatureLinksSummaryAPI),
Route(f'{API_BASE}/feature_links_samples', feature_links_api.FeatureLinksSamplesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/votes',
reviews_api.VotesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/votes/<int:gate_id>',
reviews_api.VotesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/gates',
reviews_api.GatesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/approvals/comments',
comments_api.CommentsAPI),
Route(f'{API_BASE}/features/<int:feature_id>/approvals/<int:gate_id>/comments',
comments_api.CommentsAPI),
Route(f'{API_BASE}/features/<int:feature_id>/process',
processes_api.ProcessesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/progress',
processes_api.ProgressAPI),
Route(f'{API_BASE}/features/<int:feature_id>/stages',
stages_api.StagesAPI),
Route(f'{API_BASE}/features/<int:feature_id>/stages/<int:stage_id>',
stages_api.StagesAPI),
Route(f'{API_BASE}/blinkcomponents',
blink_components_api.BlinkComponentsAPI),
Route(f'{API_BASE}/componentsusers',
components_users.ComponentsUsersAPI),
Route(f'{API_BASE}/components/<int:component_id>/users/<int:user_id>',
component_users.ComponentUsersAPI),
Route(f'{API_BASE}/login', login_api.LoginAPI),
Route(f'{API_BASE}/logout', logout_api.LogoutAPI),
Route(f'{API_BASE}/currentuser/permissions', permissions_api.PermissionsAPI),
Route(f'{API_BASE}/currentuser/settings', settings_api.SettingsAPI),
Route(f'{API_BASE}/currentuser/stars', stars_api.StarsAPI),
Route(f'{API_BASE}/currentuser/cues', cues_api.CuesAPI),
Route(f'{API_BASE}/currentuser/token', token_refresh_api.TokenRefreshAPI),
# (f'{API_BASE}/currentuser/autosaves', TODO),
# Admin operations for user accounts
Route(f'{API_BASE}/accounts', accounts_api.AccountsAPI),
Route(f'{API_BASE}/accounts/<int:account_id>', accounts_api.AccountsAPI),
Route(f'{API_BASE}/channels', channels_api.ChannelsAPI), # omaha data
# (f'{API_BASE}/schedule', TODO), # chromiumdash data
# (f'{API_BASE}/metrics/<str:kind>', TODO), # uma-export data
# (f'{API_BASE}/metrics/<str:kind>/<int:bucket_id>', TODO),
Route(f'{API_BASE}/origintrials', origin_trials_api.OriginTrialsAPI),
]
# The Routes below that have no handler specified use SPAHandler.
# The guide.* handlers each call get_spa_template_data().
spa_page_routes = [
Route('/'),
Route('/roadmap'),
Route('/myfeatures', defaults={'require_signin': True}),
Route('/newfeatures'),
Route('/feature/<int:feature_id>'),
Route('/feature/<int:feature_id>/activity'),
Route('/guide/new', guide.FeatureCreateHandler,
defaults={'require_create_feature': True}),
Route('/guide/enterprise/new', guide.EnterpriseFeatureCreateHandler,
defaults={'require_signin': True, 'require_create_feature': True, 'is_enterprise_page': True}),
Route('/guide/edit/<int:feature_id>', guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/stage/<int:feature_id>/<int:intent_stage>/<int:stage_id>',
guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/stage/<int:feature_id>/<int:stage_id>',
guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/edit/<int:feature_id>/<int:stage_id>', guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/editall/<int:feature_id>', guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/verify_accuracy/<int:feature_id>', guide.FeatureEditHandler,
defaults={'require_edit_feature': True}),
Route('/guide/stage/<int:feature_id>/metadata',
defaults={'require_edit_feature': True}),
Route('/ot_creation_request/<int:feature_id>/<int:stage_id>'),
Route('/metrics'),
Route('/metrics/css'),
Route('/metrics/css/popularity'),
Route('/metrics/css/animated'),
Route('/metrics/css/timeline/popularity'),
Route('/metrics/css/timeline/popularity/<int:bucket_id>'),
Route('/metrics/css/timeline/animated'),
Route('/metrics/css/timeline/animated/<int:bucket_id>'),
Route('/metrics/feature/popularity'),
Route('/metrics/feature/timeline/popularity'),
Route('/metrics/feature/timeline/popularity/<int:bucket_id>'),
Route('/settings', defaults={'require_signin': True}),
Route('/enterprise'),
Route(
'/enterprise/releasenotes',
defaults={'require_signin': True, 'is_enterprise_page': True}),
# Admin pages
Route('/admin/blink', defaults={'require_admin_site': True, 'require_signin': True}),
Route('/admin/feature_links', defaults={'require_admin_site': True, 'require_signin': True}),
Route('/admin/slo_report', reminders.SLOReportHandler),
]
mpa_page_routes: list[Route] = [
Route('/admin/users/new', users.UserListHandler),
OT requests admin page (#3352) * parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414849 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414839 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414831 -0700 parent 404a3ae89b9095c37f0801c0b4b61fc8817a4baf author Ping <5123601+pingren@users.noreply.github.com> 1694449778 +0800 committer Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> 1695414745 -0700 Documentation for feature links (#3317) * Add documentation for feature links * Update documentation for feature links npm: bump tar from 6.1.15 to 6.2.0 (#3318) Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.15 to 6.2.0. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v6.1.15...v6.2.0) --- updated-dependencies: - dependency-name: tar dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump eslint from 8.48.0 to 8.49.0 (#3319) Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.49.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.49.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @babel/register from 7.22.5 to 7.22.15 (#3320) Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.22.5 to 7.22.15. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.15/packages/babel-register) --- updated-dependencies: - dependency-name: "@babel/register" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump rollup from 3.28.1 to 3.29.1 (#3321) Bumps [rollup](https://github.com/rollup/rollup) from 3.28.1 to 3.29.1. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v3.28.1...v3.29.1) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Enforce rollout milestones to have a minimum value of 100 (#3316) Revert "temporarily remove OT cron" (#3322) This reverts commit 5da4d251a99a5d6bcb1f453203671b90940ae071. Update cron description (#3323) * Update cron.yaml * Update cron.yaml Update chromedash-feature-detail.js (#3324) Record vote activities with amendments instead of text. (#3314) * Record vote activities with amendments instead of text. * Stop checking comments_only Add support for testing mobile (i.e. narrow window). (#3325) * Add support for testing mobile (i.e. narrow window). * Cleanup Ensure all available features for a release note are fetched (#3328) - Add new query parameter releaseNotesMilestone to the GET /features route - Ensure all shipping and enterprise features are returned from the milestone specified in releaseNotesMilestone until the latest available feature - Update front end logic to wait for a channel to be selected before getting the features for the release notes - Update front end logic to fetch policies each time the target milestone is changed Add 3 more fields for OT creation (#3327) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line Add indexes needed for enterprise release notes. (#3329) Hide enterprise features from /features page (#3330) Enterprise features were shown on /features when they should never be shown there. This PR filters out enterprise features from the features sent to /features Ensure milestone comparison is made between two int types (#3331) Add `ot_feedback_submission_url` field (#3333) Add 3 more fields for OT creation `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT remove test line Add basic UI for trial creation request Add `ot_feedback_submission_url` to ot creation ot button only shows on ot stage details Update chromedash-feature-detail.js fix OT button cancel button returns to feature detail add ot milestone fields Update chromedash-feature-detail.js Add action_requested field for creation/extension show button disabled if already requested trial association cron clears ot action requests `/admin/ot_requests.html` Fix base.css unix perms. (#3338) don't write to the same entity multiple times (#3345) npm: bump @babel/preset-env from 7.22.15 to 7.22.20 (#3340) Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.22.15 to 7.22.20. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.20/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @lit-labs/context from 0.4.0 to 0.4.1 (#3341) Bumps [@lit-labs/context](https://github.com/lit/lit/tree/HEAD/packages/labs/context) from 0.4.0 to 0.4.1. - [Release notes](https://github.com/lit/lit/releases) - [Changelog](https://github.com/lit/lit/blob/main/packages/labs/context/CHANGELOG.md) - [Commits](https://github.com/lit/lit/commits/@lit-labs/context@0.4.1/packages/labs/context) --- updated-dependencies: - dependency-name: "@lit-labs/context" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump sass from 1.66.1 to 1.67.0 (#3342) Bumps [sass](https://github.com/sass/dart-sass) from 1.66.1 to 1.67.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.66.1...1.67.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> npm: bump @playwright/test from 1.37.1 to 1.38.0 (#3343) Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.37.1 to 1.38.0. - [Release notes](https://github.com/Microsoft/playwright/releases) - [Commits](https://github.com/Microsoft/playwright/compare/v1.37.1...v1.38.0) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Add test of entering a blink_component name (#3349) * Add test to enter blink component * Update the README a bit. * Change name of test, update images. * Delete commented out code. npm: bump @babel/core from 7.22.11 to 7.22.20 (#3344) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.11 to 7.22.20. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.20/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Add `ot_owner_email` and `ot_display_name` fields Add 3 more fields for OT creation `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT remove test line Add basic UI for trial creation request Update chromedash-feature-detail.js cancel button returns to feature detail add ot milestone fields fix test Add "overdue" to the tooltip on overdue gate chips. (#3350) * Add "overdue" to the tooltip on overdue gate chips. * Also remove gate name. Add `ot_action_requested` field to denote sent requests (#3336) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Add action_requested field for creation/extension * Refined requests admin page Add `ot_owner_email` and `ot_display_name` field (#3351) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Squashed commit of the following: commit 142f605e74604de299e6f346e31066d2c50ea79a Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:06:53 2023 -0700 Update chromedash-feature-detail.js commit 83c98ea8a91ea9bab0a4b55fa03579fdf68468e7 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:00:01 2023 -0700 add ot milestone fields commit b50933fcb655290647f8c0945423e5d44d104815 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:18:46 2023 -0700 cancel button returns to feature detail commit 9047830f201afb9f502b837a129cc047d065b9a9 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:02:06 2023 -0700 fix OT button commit b442dfd495318aea44ff3046d33a4343f3487e7e Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:49:21 2023 -0700 Update chromedash-feature-detail.js commit e78ed6bab1f6816104a5caebc5fcb86d00a75886 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:44:07 2023 -0700 ot button only shows on ot stage details commit a2d8df80473a034100f8a982e00285268c3c931f Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 16:04:52 2023 -0700 Add `ot_feedback_submission_url` to ot creation commit cb0b1e621f740dc733901303725f93aa1a96c2fd Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 14:16:22 2023 -0700 Add basic UI for trial creation request commit a843707680f32bc280085d795bfa28cdff751c73 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:50:19 2023 -0700 remove test line commit 1b471fad6fcc5a4e35d0892863eb1456a968cdcb Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:46:44 2023 -0700 `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT commit cc0308efc71cc0b2bcd9fb938c2cfdfef3d91da2 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 10:53:06 2023 -0700 Add 3 more fields for OT creation * Add `ot_owner_email` and `ot_display_name` fields * fix test User email automatically added to OT contacts list (#3339) * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * Add `ot_feedback_submission_url` to ot creation * ot button only shows on ot stage details * Update chromedash-feature-detail.js * fix OT button * cancel button returns to feature detail * add ot milestone fields * Update chromedash-feature-detail.js * Squashed commit of the following: commit 142f605e74604de299e6f346e31066d2c50ea79a Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:06:53 2023 -0700 Update chromedash-feature-detail.js commit 83c98ea8a91ea9bab0a4b55fa03579fdf68468e7 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 20 15:00:01 2023 -0700 add ot milestone fields commit b50933fcb655290647f8c0945423e5d44d104815 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:18:46 2023 -0700 cancel button returns to feature detail commit 9047830f201afb9f502b837a129cc047d065b9a9 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 09:02:06 2023 -0700 fix OT button commit b442dfd495318aea44ff3046d33a4343f3487e7e Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:49:21 2023 -0700 Update chromedash-feature-detail.js commit e78ed6bab1f6816104a5caebc5fcb86d00a75886 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Mon Sep 18 08:44:07 2023 -0700 ot button only shows on ot stage details commit a2d8df80473a034100f8a982e00285268c3c931f Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 16:04:52 2023 -0700 Add `ot_feedback_submission_url` to ot creation commit cb0b1e621f740dc733901303725f93aa1a96c2fd Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Fri Sep 15 14:16:22 2023 -0700 Add basic UI for trial creation request commit a843707680f32bc280085d795bfa28cdff751c73 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:50:19 2023 -0700 remove test line commit 1b471fad6fcc5a4e35d0892863eb1456a968cdcb Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 12:46:44 2023 -0700 `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT commit cc0308efc71cc0b2bcd9fb938c2cfdfef3d91da2 Author: Daniel Smith <56164590+DanielRyanSmith@users.noreply.github.com> Date: Wed Sep 13 10:53:06 2023 -0700 Add 3 more fields for OT creation * Add `ot_owner_email` and `ot_display_name` fields * Add 3 more fields for OT creation * `stage_description` -> `ot_description` With a more detailed description of the field and its relation to OT * remove test line * Add basic UI for trial creation request * user email automatically added to ot contacts list * update to use new `ot_owner_email` field * fix test --------- Co-authored-by: Ping <5123601+pingren@users.noreply.github.com>
2023-09-26 19:35:56 +03:00
Route('/admin/ot_requests', ot_requests.OriginTrialsRequests),
Route('/admin/features/launch/<int:feature_id>',
intentpreview.IntentEmailPreviewHandler),
Route('/admin/features/launch/<int:feature_id>/<int:stage_id>',
intentpreview.IntentEmailPreviewHandler),
# Note: The only requests being made now hit /features.json and
# /features_v2.json, but both of those cause version == 2.
# There was logic to accept another version value, but it it was not used.
Route(r'/features.json', featurelist.FeaturesJsonHandler),
Route(r'/features_v2.json', featurelist.FeaturesJsonHandler),
Route('/features', featurelist.FeatureListHandler),
Route('/features/<int:feature_id>', featurelist.FeatureListHandler),
Route('/features.xml', basehandlers.ConstHandler,
defaults={'template_path': 'farewell-rss.xml'}),
Route('/samples', basehandlers.ConstHandler,
defaults={'template_path': 'farewell-samples.html'}),
Route('/omaha_data', metrics.OmahaDataHandler),
]
internals_routes: list[Route] = [
Route('/cron/metrics', fetchmetrics.YesterdayHandler),
Route('/cron/histograms', fetchmetrics.HistogramsHandler),
Route('/cron/update_blink_components', fetchmetrics.BlinkComponentHandler),
Route('/cron/export_backup', data_backup.BackupExportHandler),
Route('/cron/send_accuracy_notifications', reminders.FeatureAccuracyHandler),
Route('/cron/send_prepublication', reminders.PrepublicationHandler),
Route('/cron/warn_inactive_users', notifier.NotifyInactiveUsersHandler),
Route('/cron/remove_inactive_users',
inactive_users.RemoveInactiveUsersHandler),
Route('/cron/reindex_all', search_fulltext.ReindexAllFeatures),
Route('/cron/update_all_feature_links', feature_links.UpdateAllFeatureLinksHandlers),
Route('/cron/associate_origin_trials', maintenance_scripts.AssociateOTs),
Route('/admin/find_stop_words', search_fulltext.FindStopWords),
Route('/tasks/email-subscribers', notifier.FeatureChangeHandler),
Route('/tasks/detect-intent', detect_intent.IntentEmailHandler),
Route('/tasks/email-reviewers', notifier.FeatureReviewHandler),
Route('/tasks/email-comments', notifier.FeatureCommentHandler),
Route('/tasks/update-feature-links', feature_links.FeatureLinksUpdateHandler),
Route('/tasks/email-ot-creation-request',
notifier.OriginTrialCreationRequestHandler),
# Maintenance scripts.
Route('/scripts/evaluate_gate_status',
maintenance_scripts.EvaluateGateStatus),
Route('/scripts/write_missing_gates',
maintenance_scripts.WriteMissingGates),
2023-05-20 03:34:42 +03:00
Route('/scripts/migrate_gecko_views',
maintenance_scripts.MigrateGeckoViews),
Route('/scripts/backfill_responded_on',
maintenance_scripts.BackfillRespondedOn),
Route('/scripts/backfill_stage_created',
maintenance_scripts.BackfillStageCreated),
Route('/scripts/backfill_feature_links',
maintenance_scripts.BackfillFeatureLinks),
]
dev_routes: list[Route] = []
if settings.DEV_MODE:
dev_routes = [
## These routes can be uncommented for local environment use. ##
# Route('/dev/clear_entities', dev_api.ClearEntities),
# Route('/dev/write_dev_data', dev_api.WriteDevData),
Route('/dev/mock_login', login_api.MockLogin),
]
# All requests to the app-py3 GAE service are handled by this Flask app.
app = basehandlers.FlaskApplication(
__name__,
(metrics_chart_routes + api_routes + mpa_page_routes + spa_page_routes +
internals_routes + dev_routes))
# TODO(jrobbins): Make the CSP handler be a class like our others.
app.add_url_rule(
'/csp', view_func=csp.report_handler,
methods=['POST'])
sendemail.add_routes(app)
if __name__ == '__main__':
# This is used when running locally only. When deploying to Google App
# Engine, a webserver process such as Gunicorn will serve the app. This
# can be configured by adding an `entrypoint` to app.yaml.
app.run(host='127.0.0.1', port=8080)