commit | 515639b5db799e6c895a5c304f6d975ec6fd36ea | [log] [tgz] |
---|---|---|
author | Adrià Vilanova MartÃnez <me@avm99963.com> | Tue Jul 06 16:43:59 2021 +0200 |
committer | gerritbot <gerritbot@avm99963.com> | Sun Oct 17 01:01:55 2021 +0200 |
tree | be082ed9b4127a98f550dd5b62d659db21983725 | |
parent | 854996b0b589716b61d700069c8d23e4920787e7 [diff] |
First customization to avm99963-bugs - Only a service is used (default) in order to keep usage within Google Cloud's free tier. - Settings have been adapted. - Only a single DB instance is used (primary). - Some cron jobs are executed less often. - |threadsafe| has been set to "yes" so the single instance can serve concurrent requests (otherwise the search/list issues function breaks). GitOrigin-RevId: 52130750a30a5aa2234a6dd3f5ae23c3fb1b8343
Monorail is the Issue Tracker used by the Chromium project and other related projects. It is hosted at bugs.chromium.org.
If you wish to file a bug against Monorail itself, please do so in our self-hosting tracker. We also discuss development of Monorail at infra-dev@chromium.org
.
For Googlers: Monorail's codebase is open source and can be installed locally on your workstation of choice.
Here's how to run Monorail locally for development on MacOS and Debian stretch/buster or its derivatives.
cd /path/to/empty/workdir
fetch infra
cd infra/appengine/monorail
gcloud auth login
gcloud auth configure-docker
docker-compose -f dev-services.yml up -d
. This should spin up:gcloud auth login
gcloud auth configure-docker
. If you're an open source developer and do not have access to the monorail project and thereby its container registry you will need to start the Cloud Tasks Emulator from sourcedocker cp schema/. mysql:/schema
docker exec -it mysql bash
mysql --user=root monorail < schema/framework.sql
mysql --user=root monorail < schema/project.sql
mysql --user=root monorail < schema/tracker.sql
exit
eval `../../go/env.py`
-- you'll need to run this in any shell you wish to use for developing Monorail. It will add some key directories to your $PATH
.sudo apt-get install build-essential automake
brew install nvm
nvm install 12.13.0
brew install mysql@5.6
tar -xf mysql-server_5.6.40-1ubuntu14.04_amd64.deb-bundle.tar
. Install the packages in the order of mysql-common
,mysql-community-client
, mysql-client
, then mysql-community-server
.pip
. You can verify whether you have it installed with which pip
.curl -O https://bootstrap.pypa.io/2.7/get-pip.py
sudo python get-pip.py
virtualenv
to keep from modifying system dependencies.sudo pip install virtualenv
virtualenv venv
to set up virtualenv within your monorail directory.source venv/bin/activate
to activate it, needed in each terminal instance of the directory.brew install openssl; export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
make dev_deps
make deps
make serve
docker exec mysql mysql --user=root monorail -e "UPDATE User SET is_site_admin = TRUE WHERE email = 'test@example.com';"
Instructions for deploying Monorail to an existing instance or setting up a new instance are here.
Here's how to run unit tests from the command-line:
To run all Python unit tests, in the appengine/monorail
directory run:
make test
For quick debugging, if you need to run just one test you can do the following. For instance for the test IssueServiceTest.testUpdateIssues_Normal
in services/test/issue_svc_test.py
:
../../test.py test appengine/monorail:services.test.issue_svc_test.IssueServiceTest.testUpdateIssues_Normal --no-coverage
To run the frontend tests for Monorail, you first need to set up your Go environment. From the Monorail directory, run:
eval `../../go/env.py`
Then, to run the frontend tests, run:
make karma
If you want to skip the coverage for karma, run:
make karma_debug
To run only one test or a subset of tests, you can add .only
to the test function you want to isolate:
// Run one test. it.only(() => { ... }); // Run a subset of tests. describe.only(() => { ... });
Just remember to remove them before you upload your CL.
BindError: Unable to bind localhost:8080
This error occurs when port 8080 is already being used by an existing process. Oftentimes, this is a leftover Monorail devserver process from a past run. To quit whatever process is on port 8080, you can run kill $(lsof -ti:8080)
.
TypeError: connect() got an unexpected keyword argument 'charset'
This error occurs when dev_appserver
cannot find the MySQLdb library. Try installing it via sudo apt-get install python-mysqldb.
TypeError: connect() argument 6 must be string, not None
This occurs when your mysql server is not running. Check if it is running with ps aux | grep mysqld
. Start it up with /etc/init.d/mysqld start on linux, or just mysqld.
OSError: [Errno 24] Too many open files
and then lists out all source filesdev_appserver wants to reload source files that you have changed in the editor, however that feature does not seem to work well with multiple GAE modules and instances running in different processes. The workaround is to control-C or kill
the dev_appserver processes and restart them.
IntegrityError: (1364, "Field 'comment_id' doesn't have a default value")
happens when trying to file or update an issueIn some versions of SQL, the STRICT_TRANS_TABLES
option is set by default. You'll have to disable this option to stop this error.
ImportError: No module named six.moves
You may not have six.moves in your virtual environment and you may need to install it.
which python
which pip
sudo `which python` `which pip` install six
Monorail supports all browsers defined in the Chrome Ops guidelines.
File a browser compatability bug here.
See: Monorail Frontend Code Practices
See: Monorail Triage Guide.
See: Monorail Deployment
For information on how to use Monorail, see the Monorail User Guide.