chromium-dashboard/README.md

125 строки
4.4 KiB
Markdown
Исходник Обычный вид История

2015-08-03 19:59:03 +03:00
Chrome Platform Status
2013-03-07 22:18:10 +04:00
==================
2018-02-27 09:28:59 +03:00
[![Lighthouse score: 100/100](https://lighthouse-badge.appspot.com/?score=100&category=PWA)](https://github.com/ebidel/lighthouse-badge)
2018-02-01 01:04:17 +03:00
[chromestatus.com](http://chromestatus.com/)
2015-10-14 01:13:53 +03:00
### Get the code
git clone https://github.com/GoogleChrome/chromium-dashboard
2015-10-14 01:13:53 +03:00
2015-11-17 20:11:51 +03:00
### Installation
20210618 gae ndb to cloud ndb (#1365) * Added Cloud NDB to requirements * google-cloud-core 1.7.0 requires google-auth<2.0dev,>=1.24.0, but you'll have google-auth 1.20.1 which is incompatible. * Running DataStore Emulator on port 15606 and setting environment variable for the same * Replaced GAE NDB imports with Cloud NDB imports * Solved Error: No Context for Ramcache * Solved No NDB Context Error for Cloud NDB * Fixed Error No object QueryOptions * Removed clear_datstore flag * Fixed to_dict() method * Added explicit call to method for stashing values while editing a feature * Using Cloud NDB in testbed * Updated README with JRE instructions and setting the DJANGO_SETTTINGS_MODULE environment variable for django.setup * Added Env Variable for datastore emulator * Migrated accounts_api_test.py * Migrated approvals_api_test.py * Migrated Comments.py and Cues_api_test.py * Migrated Features.py * Migrated metricsdata_test.py * Migrated stars_api_test.py * Fixed Deprecation warning for query options * Migrated token_refresh_api_test.py * Migrated basehandlers_test.py * Migrated permissions_test.py * Migrated ramcache_test.py * Migrated secrets_test.py * Migrated xsrf_test.py * Migrated fetchmetrics_test.py * Migrated models_test.py * Migrated notifier_test.py * Migrated processes_test.py * Migrated featuredetail_test.py * Migrated featurelist_test.py * Migrated guide_test.py * Migrated intentpreview_test.py * Migrated samples_test.py * Removed some unused stubs * Set the consistency of datastore emulator to be 1 * Resetting the database emulator before running the tests * Added npm targets for starting and stopping emulator * Updated README and Developer Docs * Removed unused imports * Made NDB calls DRY
2021-06-29 05:05:04 +03:00
1. Before you begin, make sure that you have a java JRE (version 8 or greater) installed. JRE is required to use the DataStore Emulator.
2019-05-22 21:51:38 +03:00
1. Install global CLIs
2021-06-03 03:59:55 +03:00
1. [Google App Engine SDK for Python](https://cloud.google.com/appengine/docs/standard/python/setting-up-environment). Make sure to select Python 2.7.
2019-05-22 21:51:38 +03:00
1. pip, node, npm.
2021-06-03 03:59:55 +03:00
1. Gulp `npm install --global gulp-cli`
1. Install npm dependencies `npm ci`
1. Install other dependencies `npm run deps` and `npm run dev-deps`
2019-05-22 21:13:09 +03:00
If you face any error during the installation process, the section **Notes** (later in this README.md) may help.
2018-07-17 21:16:04 +03:00
##### Add env_vars.yaml
Create a file named `env_vars.yaml` in the root directory and fill it with:
```yaml
env_variables:
DJANGO_SETTINGS_MODULE: 'settings'
DJANGO_SECRET: 'this-is-a-secret'
20210618 gae ndb to cloud ndb (#1365) * Added Cloud NDB to requirements * google-cloud-core 1.7.0 requires google-auth<2.0dev,>=1.24.0, but you'll have google-auth 1.20.1 which is incompatible. * Running DataStore Emulator on port 15606 and setting environment variable for the same * Replaced GAE NDB imports with Cloud NDB imports * Solved Error: No Context for Ramcache * Solved No NDB Context Error for Cloud NDB * Fixed Error No object QueryOptions * Removed clear_datstore flag * Fixed to_dict() method * Added explicit call to method for stashing values while editing a feature * Using Cloud NDB in testbed * Updated README with JRE instructions and setting the DJANGO_SETTTINGS_MODULE environment variable for django.setup * Added Env Variable for datastore emulator * Migrated accounts_api_test.py * Migrated approvals_api_test.py * Migrated Comments.py and Cues_api_test.py * Migrated Features.py * Migrated metricsdata_test.py * Migrated stars_api_test.py * Fixed Deprecation warning for query options * Migrated token_refresh_api_test.py * Migrated basehandlers_test.py * Migrated permissions_test.py * Migrated ramcache_test.py * Migrated secrets_test.py * Migrated xsrf_test.py * Migrated fetchmetrics_test.py * Migrated models_test.py * Migrated notifier_test.py * Migrated processes_test.py * Migrated featuredetail_test.py * Migrated featurelist_test.py * Migrated guide_test.py * Migrated intentpreview_test.py * Migrated samples_test.py * Removed some unused stubs * Set the consistency of datastore emulator to be 1 * Resetting the database emulator before running the tests * Added npm targets for starting and stopping emulator * Updated README and Developer Docs * Removed unused imports * Made NDB calls DRY
2021-06-29 05:05:04 +03:00
DATASTORE_EMULATOR_HOST: 'localhost:15606'
```
2018-07-17 21:16:04 +03:00
2019-05-22 21:51:38 +03:00
### Developing
To start the main server and the notifier backend, run:
```bash
npm start
```
Then visit `http://localhost:8080/`.
2019-05-22 21:51:38 +03:00
2019-06-27 23:52:25 +03:00
To start front end code watching (sass, js lint check, babel, minify files), run
2019-05-22 21:51:38 +03:00
```bash
npm run watch
```
To run lint & lit-analyzer:
```bash
npm run lint
```
To run unit tests:
```bash
20210618 gae ndb to cloud ndb (#1365) * Added Cloud NDB to requirements * google-cloud-core 1.7.0 requires google-auth<2.0dev,>=1.24.0, but you'll have google-auth 1.20.1 which is incompatible. * Running DataStore Emulator on port 15606 and setting environment variable for the same * Replaced GAE NDB imports with Cloud NDB imports * Solved Error: No Context for Ramcache * Solved No NDB Context Error for Cloud NDB * Fixed Error No object QueryOptions * Removed clear_datstore flag * Fixed to_dict() method * Added explicit call to method for stashing values while editing a feature * Using Cloud NDB in testbed * Updated README with JRE instructions and setting the DJANGO_SETTTINGS_MODULE environment variable for django.setup * Added Env Variable for datastore emulator * Migrated accounts_api_test.py * Migrated approvals_api_test.py * Migrated Comments.py and Cues_api_test.py * Migrated Features.py * Migrated metricsdata_test.py * Migrated stars_api_test.py * Fixed Deprecation warning for query options * Migrated token_refresh_api_test.py * Migrated basehandlers_test.py * Migrated permissions_test.py * Migrated ramcache_test.py * Migrated secrets_test.py * Migrated xsrf_test.py * Migrated fetchmetrics_test.py * Migrated models_test.py * Migrated notifier_test.py * Migrated processes_test.py * Migrated featuredetail_test.py * Migrated featurelist_test.py * Migrated guide_test.py * Migrated intentpreview_test.py * Migrated samples_test.py * Removed some unused stubs * Set the consistency of datastore emulator to be 1 * Resetting the database emulator before running the tests * Added npm targets for starting and stopping emulator * Updated README and Developer Docs * Removed unused imports * Made NDB calls DRY
2021-06-29 05:05:04 +03:00
npm run start-emulator # Start the emulator
npm run test # Reset the datastore emulator and start testing
npm run stop-emulator # Stop the emulator. You do not have to stop the emulator between consecutive tests
```
Note: featurelist is temporarily excluded because lit-analyzer throws `Maximum call stack size exceeded`.
2019-05-22 21:51:38 +03:00
There are some developing information in developer-documentation.md.
**Notes**
- If you get an error saying `No module named protobuf` or `No module named six` or `No module named enum` , try installing them locally with `pip install six enum34 protobuf`.
- When installing the GAE SDK, make sure to get the version for python 2.7. It is no longer the default version.
- When running `npm start` you may get an ImportError for jinja2.tests. This was caused by an over-general line in skip_files.yaml. Pulling the latest source code should resolve the problem.
2016-07-11 21:37:51 +03:00
#### Blink components
Chromestatus gets the list of Blink components from a separate [app running on Firebase](https://blinkcomponents-b48b5.firebaseapp.com/blinkcomponents). See [source](https://github.com/ebidel/blink-components).
#### Seed the blink component owners
Visit http://localhost:8080/admin/blink/populate_blink to see the list of Blink component owners.
2016-07-11 21:37:51 +03:00
#### Debugging / settings
[`settings.py`](https://github.com/GoogleChrome/chromium-dashboard/blob/master/settings.py) contains a list
of globals for debugging and running the site locally.
2016-07-08 22:41:10 +03:00
### Deploying
2021-02-25 00:16:30 +03:00
If you have uncommited local changes, the appengine version name will end with `-tainted`.
It is OK to test on staging with tainted versions, but everything should be committed
(and thus not tainted) before staging a version that can later be pushed to prod.
2016-07-08 22:41:10 +03:00
2021-02-25 00:16:30 +03:00
**Note** you need to have admin privileges on the `cr-status-staging` and `cr-status`
cloud projects to be able to deploy the site.
2016-07-08 22:41:10 +03:00
2021-02-25 00:16:30 +03:00
Run the npm target:
2016-07-08 22:41:10 +03:00
2021-02-25 00:16:30 +03:00
npm run staging
2016-07-08 22:41:10 +03:00
2021-02-25 00:16:30 +03:00
Open the [Google Developer
Console for the staging site](https://console.cloud.google.com/appengine/versions?project=cr-status-staging)
and flip to the new version by selecting from the list and clicking *MIGRATE TRAFFIC*. Make sure to do this for both the 'default' service as well as for the 'notifier' service.
2016-07-08 22:41:10 +03:00
Each deployment also uploads the same code to a version named `rc` for "Release candidate". This is the only version that you can test using Google Sign-In at `https://rc-dot-cr-status-staging.appspot.com`.
2021-02-25 00:16:30 +03:00
If manual testing on the staging server looks good, then repeat the same steps to deploy to prod:
npm run deploy
Open the [Google Developer
Console for the production site](https://console.cloud.google.com/appengine/versions?project=cr-status)
The production site should only have versions that match versions on staging.
2013-03-29 22:11:54 +04:00
### LICENSE
2017-02-16 02:05:51 +03:00
Copyright (c) 2013-2016 Google Inc. All rights reserved.
2013-03-29 22:14:00 +04:00
2016-07-08 23:37:44 +03:00
Apache2 License.
2014-01-02 23:47:39 +04:00
[![Analytics](https://ga-beacon.appspot.com/UA-39048143-2/GoogleChrome/chromium-dashboard/README)](https://github.com/igrigorik/ga-beacon)