commit | f038023e9f472a9431c6002738f404e776e4a205 | [log] [tgz] |
---|---|---|
author | Paul Hobbs <phobbs@google.com> | Tue Apr 10 17:41:59 2018 |
committer | Paul Hobbs <phobbs@google.com> | Tue Apr 17 17:36:52 2018 |
tree | 43e829359c2940b00b1b145163b8c5a3eaedf466 | |
parent | 7495f5fc78c24d48c4f5015a2e4fbe69fd323671 [diff] |
gerrit_precq: Add the same label that was removed. This is way more complicated than it has to be because we don't have all the information we need in cidb (specifically, the labels that were removed for a given build), so we have to parse it out from the Gerrit comments. This is further complicated by Code-Review+2 being a special case - we want to apply Trybot-Ready+1 to forgive failed pre-CQ builds which were kicked off due to CR+2. TEST=Unit tests BUG=chromium:820699 Change-Id: Ic7f4dc350624988d533e5a32bc0877b7479ac371
https://chromium.googlesource.com/chromiumos/infra/cl_exonerator
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).
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.
Local deployment is done by creating a virtualenv with pipenv:
# pipsi is a nice python utility for installing other python scripts in their # own virtualenvs, so you don't get version conflicts between the various # scripts installed on your system. sudo `which pip` install pipsi pipsi install pipenv pipenv install --dev pipenv shell
Then, install the Google App Engine SDK and either symlink it or copy it into the virtualenv.
Tests are run with pytest. Some tests require a chroot (the tests inheriting from cidb_integration_test.CIDBIntegrationTest). Enter the chroot with “cros chroot.” The virtualenv will need to be created inside the chroot for the tests 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.
CL-Exonerator is deployed to the google.com:chromiumos-cl-exonerator project. Before deploying, make sure you have activated it as your default project with gcloud:
gcloud config set project chromiumos-cl-exonerator
Run ./deploy_app --debug=True after copying or symlinking debug_cidbi_gen2_bot creds into ./creds/cidb.dbg (see the [Credentials][#Credentials] section)
Run “./deploy_app” after copying or symlinking prod_cidb_gen2_bot creds into “./creds/cidb”.