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

Unified Diff: gm/rebaseline_server/server.py

Issue 473973002: rebaseline_server: show Pending Approval tab if viewing SKP expectations vs actuals (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | gm/rebaseline_server/static/live-view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/server.py
diff --git a/gm/rebaseline_server/server.py b/gm/rebaseline_server/server.py
index cd0b6eb79f884b75c1f1e70cb34f18306c2361f1..8277c46de7aae892e18528fc224e017915a5a2fe 100755
--- a/gm/rebaseline_server/server.py
+++ b/gm/rebaseline_server/server.py
@@ -349,7 +349,13 @@ class Server(object):
@property
def is_editable(self):
- """ True iff HTTP clients are allowed to submit new GM baselines. """
+ """ True iff HTTP clients are allowed to submit new GM baselines.
+
+ TODO(epoger): This only pertains to GM baselines; SKP baselines are
+ editable whenever expectations vs actuals are shown.
+ Once we move the GM baselines to use the same code as the SKP baselines,
+ we can delete this property.
+ """
return self._editable
@property
@@ -597,6 +603,21 @@ class HTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
param_dict.get(LIVE_PARAM__SET_A_SECTION, [None])[0])
setB_section = self._validate_summary_section(
param_dict.get(LIVE_PARAM__SET_B_SECTION, [None])[0])
+
+ # If the sets show expectations vs actuals, always show expectations on
+ # the left (setA).
+ if ((setA_section == gm_json.JSONKEY_ACTUALRESULTS) and
+ (setB_section == gm_json.JSONKEY_EXPECTEDRESULTS)):
+ setA_dirs, setB_dirs = setB_dirs, setA_dirs
+ setA_section, setB_section = setB_section, setA_section
+
+ # Are we comparing some actuals against expectations stored in the repo?
+ # If so, we can allow the user to submit new baselines.
+ is_editable = (
+ (setA_section == gm_json.JSONKEY_EXPECTEDRESULTS) and
+ (setA_dirs[0].startswith(compare_rendered_pictures.REPO_URL_PREFIX)) and
+ (setB_section == gm_json.JSONKEY_ACTUALRESULTS))
+
results_obj = compare_rendered_pictures.RenderedPicturesComparisons(
setA_dirs=setA_dirs, setB_dirs=setB_dirs,
setA_section=setA_section, setB_section=setB_section,
@@ -608,7 +629,8 @@ class HTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_response(200)
else:
self.send_json_dict(results_obj.get_packaged_results_of_type(
- results_type=results_mod.KEY__HEADER__RESULTS_ALL))
+ results_type=results_mod.KEY__HEADER__RESULTS_ALL,
+ is_editable=is_editable))
def do_GET_live_results(self, url_remainder):
""" Handle a GET request for live-generated image diff data.
@@ -822,7 +844,9 @@ def main():
'differences between these config pairs: '
+ str(CONFIG_PAIRS_TO_COMPARE)))
parser.add_argument('--editable', action='store_true',
- help=('Allow HTTP clients to submit new GM baselines.'))
+ help=('Allow HTTP clients to submit new GM baselines; '
+ 'SKP baselines can be edited regardless of this '
+ 'setting.'))
parser.add_argument('--export', action='store_true',
help=('Instead of only allowing access from HTTP clients '
'on localhost, allow HTTP clients on other hosts '
« no previous file with comments | « no previous file | gm/rebaseline_server/static/live-view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698