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

Unified Diff: appengine/chromium_cq_status/handlers/patch_summary.py

Issue 2111713004: Teach CQ status app to check login status of users. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Review and tests. Created 4 years, 6 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
Index: appengine/chromium_cq_status/handlers/patch_summary.py
diff --git a/appengine/chromium_cq_status/handlers/patch_summary.py b/appengine/chromium_cq_status/handlers/patch_summary.py
index 50773d4c0f70c211f8f0bcf592ca652d8bff75e7..67a46421cdce22320ba6b8c94e50ab1ae704c7d2 100644
--- a/appengine/chromium_cq_status/handlers/patch_summary.py
+++ b/appengine/chromium_cq_status/handlers/patch_summary.py
@@ -19,25 +19,23 @@ from shared.config import (
JOB_STATE,
)
from shared.parsing import parse_rietveld_timestamp
-from shared.utils import (
- cross_origin_json,
- to_unix_timestamp,
- guess_legacy_codereview_hostname,
-)
+from shared import utils
class PatchSummary(webapp2.RequestHandler):
- @cross_origin_json
+ @utils.cross_origin_json
+ @utils.read_access
def get(self, issue, patch): # pylint: disable=W0221
- now = to_unix_timestamp(datetime.utcnow())
- codereview_hostname = guess_legacy_codereview_hostname(issue)
+ now = utils.to_unix_timestamp(datetime.utcnow())
+ codereview_hostname = utils.guess_legacy_codereview_hostname(issue)
return summarize_patch(codereview_hostname, issue, patch, now)
class PatchSummaryV2(webapp2.RequestHandler):
- @cross_origin_json
+ @utils.cross_origin_json
+ @utils.read_access
def get(self, codereview_hostname, issue, patch): # pylint: disable=W0221
- now = to_unix_timestamp(datetime.utcnow())
+ now = utils.to_unix_timestamp(datetime.utcnow())
return summarize_patch(codereview_hostname, issue, patch, now)
@@ -93,7 +91,7 @@ def get_raw_attempts(codereview_hostname, issue, patch):
def summarize_attempt(raw_attempt, now):
assert len(raw_attempt) > 0
- start_timestamp = to_unix_timestamp(raw_attempt[0].timestamp)
+ start_timestamp = utils.to_unix_timestamp(raw_attempt[0].timestamp)
summary = blank_attempt_summary()
job_tracker = AttemptJobTracker(start_timestamp)
durations = summary['durations']
@@ -106,7 +104,7 @@ def summarize_attempt(raw_attempt, now):
if action == 'patch_ready_to_commit':
continue
verifier = record.fields.get('verifier')
- timestamp = to_unix_timestamp(record.timestamp)
+ timestamp = utils.to_unix_timestamp(record.timestamp)
if last_patch_action:
patch_state_duration = timestamp - last_patch_timestamp
« no previous file with comments | « appengine/chromium_cq_status/handlers/patch_status.py ('k') | appengine/chromium_cq_status/handlers/post.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698