Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Unified Diff: infra/tools/antibody/code_review_parse.py

Issue 1235373004: Added script to generate stats on a git checkout (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@new_antibody_db_schema
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/tools/antibody/cloudsql_connect.py ('k') | infra/tools/antibody/compute_stats.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/tools/antibody/code_review_parse.py
diff --git a/infra/tools/antibody/code_review_parse.py b/infra/tools/antibody/code_review_parse.py
index 7802e06459dced087cf21793c904e25acdf26379..4e4fd68434e4e91dba7facac7f912cfc068aad57 100644
--- a/infra/tools/antibody/code_review_parse.py
+++ b/infra/tools/antibody/code_review_parse.py
@@ -123,14 +123,26 @@ def get_rietveld_data_for_review_people(rietveld_url):
def get_tbr_no_lgtm(cc): # pragma: no cover
- cc.execute("""Select review.review_url, review.request_timestamp,
- git_commit.hash, commit_people.people_email_address FROM review
- INNER JOIN git_commit on review.review_url = git_commit.review_url
- INNER JOIN commit_people on commit_people.git_commit_hash =
- git_commit.hash
- LEFT JOIN (SELECT review_url, COUNT(*) AS c FROM review_people
- WHERE type = 'lgtm' GROUP BY review_url) lgtm_count on
- review.review_url = lgtm_count.review_url WHERE
- lgtm_count.c = 0 OR lgtm_count.c IS NULL AND commit_people.type =
- 'tbr'""")
- return cc.fetchall()
+ cc.execute("""SELECT review.review_url, review.request_timestamp,
+ git_commit.subject, commit_people.people_email_address, git_commit.hash
+ FROM review
+ INNER JOIN git_commit
+ ON review.review_url = git_commit.review_url
+ INNER JOIN commit_people
+ ON commit_people.git_commit_hash = git_commit.hash
+ LEFT JOIN (
+ SELECT review_url, COUNT(*)
+ AS c
+ FROM review_people
+ WHERE type = 'lgtm'
+ GROUP BY review_url) lgtm_count
+ ON review.review_url = lgtm_count.review_url
+ WHERE lgtm_count.c = 0 OR lgtm_count.c IS NULL
+ AND commit_people.type = 'tbr'""")
+ data_all = cc.fetchall()
+ formatted_data = []
+ for data in data_all:
+ subject = (data[2][:61] + '...') if len(data[2]) > 62 else data[2]
+ formatted_data.append([data[0], data[1].strftime("%Y-%m-%d %H:%M:%S"),
+ subject.replace('-', ' '), data[3], data[4]])
+ return formatted_data
« no previous file with comments | « infra/tools/antibody/cloudsql_connect.py ('k') | infra/tools/antibody/compute_stats.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698