innocent_cls_precq: Rename datastore key

"PreCQProcessed" is a better name for the key, because it represents
builds that we have examined, not necessarily builds we took an action
on. Most builds that Pre-CQ-Exonerator examines don't result in a
Trybot-Ready+1 label being applied.

BUG=chromium:793042
TEST=unit tests

Change-Id: Ife33c6302fc502e3049ceb963f154e692b896b01
Reviewed-on: https://chromium-review.googlesource.com/953338
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Ningning Xia <nxia@chromium.org>
2 files changed
tree: 90273ac4dc97f5e41e487e6ae1691dfbd589adba
  1. .gitignore
  2. PRESUBMIT.cfg
  3. Pipfile
  4. Pipfile.lock
  5. README.md
  6. app.yaml
  7. bin/
  8. config.py
  9. cron.yaml
  10. debug_routes.py
  11. debug_routes_test.py
  12. deploy_app.py
  13. exonerator/
  14. gunicorn.conf.py
  15. main.py
  16. pytest.ini
README.md

CL Exonerator

https://chromium.googlesource.com/chromiumos/infra/cl_exonerator

Purpose:

This app finds CLs which were incorrectly blamed for a CQ failure, and re-marks them as CQ-ready. It does this by polling cidb‘s buildMessageTable for finalize messages, then finds CLs which were blamed in the build’s annotatations and marks them as CQ+1 in Gerrit (if they haven't already been).

Credentials

Create a “creds” folder, then:

  • For local development, run “cros cidbcreds --folder=creds/cidb” to fetch the readonly credentials.

  • For deploying to production, see go/cros-cidb-admin and get the prod_cidb_gen2_bot credentials.

Development

Local deployment is done by creating a virtualenv from requirements.txt:

virtualenv --python=`which python2` en
source env/bin/activate
pip install -r dev_requirements.txt

Then, install the Google App Engine SDK and either symlink it or copy it into the virtualenv. Assuming the google appengine SDK is installed at $GAE, run

cp -r $GAE/* env/lib/python2.7/site-packages

Tests are run with pytest. Some tests require a chroot; enter with “cros chroot.” The virtualenv will need to be created inside the chroot, or with “virtualenv --relocateable” for this to work.

Start a development server with bin/local_server and run curl -u admin http://localhost:8080/cls?type=pending to see a list of pending CLs.

Deployment

  • Debug environment:

Run ./deploy_app --debug=True after copying or symlinking debug_cidbi_gen2_bot creds into ./creds/cidb.dbg (see the [Credentials][#Credentials] section)

  • Production:

Run “./deploy_app” after copying or symlinking prod_cidb_gen2_bot creds into “./creds/cidb”.