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

Side by Side Diff: PRESUBMIT.py

Issue 1521913005: Add link to Gold trybot runs in every uploaded Skia CL (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Lint fix Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 """Top-level presubmit script for Skia. 6 """Top-level presubmit script for Skia.
7 7
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
9 for more details about the presubmit API built into gcl. 9 for more details about the presubmit API built into gcl.
10 """ 10 """
(...skipping 18 matching lines...) Expand all
29 'reed@google.com', 29 'reed@google.com',
30 'bsalomon@chromium.org', 30 'bsalomon@chromium.org',
31 'bsalomon@google.com', 31 'bsalomon@google.com',
32 'djsollen@chromium.org', 32 'djsollen@chromium.org',
33 'djsollen@google.com', 33 'djsollen@google.com',
34 ) 34 )
35 35
36 AUTHORS_FILE_NAME = 'AUTHORS' 36 AUTHORS_FILE_NAME = 'AUTHORS'
37 37
38 DOCS_PREVIEW_URL = 'https://skia.org/?cl=' 38 DOCS_PREVIEW_URL = 'https://skia.org/?cl='
39 GOLD_TRYBOT_URL = ('https://gold.skia.org/search2?unt=true'
40 '&query=source_type%3Dgm&master=false&issue=')
39 41
40 # Path to CQ bots feature is described in https://bug.skia.org/4364 42 # Path to CQ bots feature is described in https://bug.skia.org/4364
41 PATH_PREFIX_TO_EXTRA_TRYBOTS = { 43 PATH_PREFIX_TO_EXTRA_TRYBOTS = {
42 # pylint: disable=line-too-long 44 # pylint: disable=line-too-long
43 'cmake/': 'client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Tryb ot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot', 45 'cmake/': 'client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Tryb ot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot',
44 # pylint: disable=line-too-long 46 # pylint: disable=line-too-long
45 'src/opts/': 'client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_N O_SIMD-Trybot', 47 'src/opts/': 'client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_N O_SIMD-Trybot',
46 48
47 'include/private/SkAtomics.h': ('client.skia:' 49 'include/private/SkAtomics.h': ('client.skia:'
48 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,' 50 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,'
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 "and add one of those reviewers on a TBR= line. If you don't know " 342 "and add one of those reviewers on a TBR= line. If you don't know "
341 "if this CL affects Skia's public API, treat it like it does." 343 "if this CL affects Skia's public API, treat it like it does."
342 % str(PUBLIC_API_OWNERS))) 344 % str(PUBLIC_API_OWNERS)))
343 return results 345 return results
344 346
345 347
346 def PostUploadHook(cl, change, output_api): 348 def PostUploadHook(cl, change, output_api):
347 """git cl upload will call this hook after the issue is created/modified. 349 """git cl upload will call this hook after the issue is created/modified.
348 350
349 This hook does the following: 351 This hook does the following:
352 * Adds a link to the CL's Gold trybot results.
350 * Adds a link to preview docs changes if there are any docs changes in the CL. 353 * Adds a link to preview docs changes if there are any docs changes in the CL.
351 * Adds 'NOTRY=true' if the CL contains only docs changes. 354 * Adds 'NOTRY=true' if the CL contains only docs changes.
352 * Adds 'NOTREECHECKS=true' for non master branch changes since they do not 355 * Adds 'NOTREECHECKS=true' for non master branch changes since they do not
353 need to be gated on the master branch's tree. 356 need to be gated on the master branch's tree.
354 * Adds 'NOTRY=true' for non master branch changes since trybots do not yet 357 * Adds 'NOTRY=true' for non master branch changes since trybots do not yet
355 work on them. 358 work on them.
356 * Adds 'NOPRESUBMIT=true' for non master branch changes since those don't 359 * Adds 'NOPRESUBMIT=true' for non master branch changes since those don't
357 run the presubmit checks. 360 run the presubmit checks.
358 * Adds extra trybots for the paths defined in PATH_TO_EXTRA_TRYBOTS. 361 * Adds extra trybots for the paths defined in PATH_TO_EXTRA_TRYBOTS.
359 """ 362 """
(...skipping 10 matching lines...) Expand all
370 all_docs_changes = False 373 all_docs_changes = False
371 if atleast_one_docs_change and not all_docs_changes: 374 if atleast_one_docs_change and not all_docs_changes:
372 break 375 break
373 376
374 issue = cl.issue 377 issue = cl.issue
375 rietveld_obj = cl.RpcServer() 378 rietveld_obj = cl.RpcServer()
376 if issue and rietveld_obj: 379 if issue and rietveld_obj:
377 original_description = rietveld_obj.get_description(issue) 380 original_description = rietveld_obj.get_description(issue)
378 new_description = original_description 381 new_description = original_description
379 382
383 # Add GOLD_TRYBOT_URL if it does not exist yet.
384 if not re.search(r'^GOLD_TRYBOT_URL=', new_description, re.M | re.I):
385 new_description += '\nGOLD_TRYBOT_URL= %s%s' % (GOLD_TRYBOT_URL, issue)
386 results.append(
387 output_api.PresubmitNotifyResult(
388 'Added link to Gold trybot runs to the CL\'s description.\n'
389 'Note: Results may take sometime to be populated after trybots '
390 'complete.'))
391
380 # If the change includes only doc changes then add NOTRY=true in the 392 # If the change includes only doc changes then add NOTRY=true in the
381 # CL's description if it does not exist yet. 393 # CL's description if it does not exist yet.
382 if all_docs_changes and not re.search( 394 if all_docs_changes and not re.search(
383 r'^NOTRY=true$', new_description, re.M | re.I): 395 r'^NOTRY=true$', new_description, re.M | re.I):
384 new_description += '\nNOTRY=true' 396 new_description += '\nNOTRY=true'
385 results.append( 397 results.append(
386 output_api.PresubmitNotifyResult( 398 output_api.PresubmitNotifyResult(
387 'This change has only doc changes. Automatically added ' 399 'This change has only doc changes. Automatically added '
388 '\'NOTRY=true\' to the CL\'s description')) 400 '\'NOTRY=true\' to the CL\'s description'))
389 401
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 state and an error if it is in 'Closed' state. 516 state and an error if it is in 'Closed' state.
505 """ 517 """
506 results = [] 518 results = []
507 results.extend(_CommonChecks(input_api, output_api)) 519 results.extend(_CommonChecks(input_api, output_api))
508 results.extend( 520 results.extend(
509 _CheckTreeStatus(input_api, output_api, json_url=( 521 _CheckTreeStatus(input_api, output_api, json_url=(
510 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) 522 SKIA_TREE_STATUS_URL + '/banner-status?format=json')))
511 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) 523 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api))
512 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) 524 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api))
513 return results 525 return results
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698