Home | History | Annotate | Download | only in sheriffing
      1 Tree Sheriffs Documentation
      2 ===========================
      3 
      4 ### Contents ###
      5 
      6 *   [What does a sheriff do?](#what_is_a_sheriff)
      7     +   [Skia tree](#skia_tree)
      8     +   [DEPS rolls](#deps_rolls)
      9     +   [Gold and Perf](#gold_and_perf)
     10     +   [Documentation](#sheriff_doc)
     11 *   [View current and upcoming sheriffs](#view_current_upcoming_sheriffs)
     12 *   [How to swap sheriff shifts](#how_to_swap)
     13 *   [Tips for sheriffs](#tips)
     14     +   [When to file bugs](#when_to_file_bugs)
     15     +   [How to close or re-open the tree](#how_close_tree)
     16     +   [How to revert a CL](#how_to_revert)
     17     +   [What to do if DEPS roll fails to land](#deps_roll_failures)
     18     +   [How to rebaseline](#how_to_rebaseline)
     19 
     20 
     21 <a name="what_is_a_sheriff"></a>
     22 What does a sheriff do?
     23 -----------------------
     24 
     25 A sheriff keeps an eye on the tree, DEPS rolls, Gold tool and the Perf tool.
     26 
     27 Below is a brief summary of what the sheriff does for each task:
     28 
     29 <a name="skia_tree"></a>
     30 ### Skia tree
     31 * Understand the [testing infrastructure](https://skia.org/dev/testing/automated_testing).
     32 * Start watching the [status page](https://status.skia.org) for bot breakages.
     33 * Track down people responsible for breakages and revert broken changes if there is no easy fix. You can use [blamer](#blamer) to help track down such changes.
     34 * Close and open the [tree](http://skia-tree-status.appspot.com).
     35 * Keep the builder comments on the [status page](https://status.skia.org) up to date.
     36 * File or follow up with [BreakingTheBuildbots bugs](https://bug.skia.org/?q=label:BreakingTheBuildbots). See the tip on [when to file bugs](#when_to_file_bugs).
     37 
     38 <a name="blamer"></a>
     39 ### Blamer
     40 If you have Go installed, a command-line tool is available to search through
     41 git history and do text searches on the full patch text and the commit
     42 message. To install blamer run:
     43 
     44     go get go.skia.org/infra/blamer/go/blamer
     45 
     46 Then run blamer from within a Skia checkout. For example, to search if the
     47 string "SkDevice" has appeared in the last 10 commits:
     48 
     49     $ $GOPATH/bin/blamer --match SkDevice --num 10
     50 
     51     commit ea70c4bb22394c8dcc29a369d3422a2b8f3b3e80
     52     Author: robertphillips <robertphillips (a] google.com>
     53     Date:   Wed Jul 20 08:54:31 2016 -0700
     54 
     55         Remove SkDevice::accessRenderTarget virtual
     56         GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2167723002
     57 
     58         Review-Url: https://codereview.chromium.org/2167723002
     59 
     60 <a name="deps_rolls"></a>
     61 ### DEPS rolls
     62 * Ensure that [AutoRoll Bot](https://autoroll.skia.org)'s DEPS rolls land successfully.
     63 
     64 <a name="gold_and_perf"></a>
     65 ### Gold and Perf
     66 * Pay attention for new [Perf](https://perf.skia.org/) and [Gold](https://gold.skia.org/) alerts (by clicking on the bell at the top right of the [status page](https://status.skia.org)).
     67 * The sheriff's duty here is to make sure that when developers introduce new images or new perf regressions, that they are aware of what happened, and they use these tools to take appropriate action.
     68 
     69 <a name="sheriff_doc"></a>
     70 ### Documentation
     71 * Improve/update this documentation page for future sheriffs, especially the [Tips section](#tips).
     72 
     73 In general, sheriffs should have a strong bias towards actions that keep the tree green and then open; if a simple revert can fix the problem, the sheriff <b>should revert first and ask questions later</b>.
     74 
     75 
     76 <a name="view_current_upcoming_sheriffs"></a>
     77 View current and upcoming sheriffs
     78 ----------------------------------
     79 
     80 The list of sheriffs is specified in the [skia-tree-status web app](https://skia-tree-status.appspot.com/sheriff). The current sheriff is highlighted in green.
     81 The banner on the top of the [status page](https://status.skia.org) also displays the current sheriff.
     82 
     83 
     84 <a name="how_to_swap"></a>
     85 How to swap sheriff shifts
     86 --------------------------
     87 
     88 If you need to swap shifts with someone (because you are out sick or on vacation), please get approval from the person you want to swap with. Then send an email to skiabot (a] google.com to have someone make the database change (or directly ping rmistry@).
     89 
     90 
     91 <a name="tips"></a>
     92 Tips for sheriffs
     93 -----------------
     94 
     95 <a name="when_to_file_bugs"></a>
     96 ### When to file bugs
     97 
     98 Pay close attention to the "Failures" view in the [status page](https://status.skia.org).
     99 Look at all existing [BreakingTheBuildbots bugs](https://bug.skia.org/?q=label:BreakingTheBuildbots). If the list is kept up to date then it should accurately represent everything that is causing failures. If it does not, then please file/update bugs accordingly.
    100 
    101 
    102 <a name="how_close_tree"></a>
    103 ### How to close or re-open the tree
    104 
    105 1. Go to [skia-tree-status.appspot.com](https://skia-tree-status.appspot.com).
    106 2. Change the status.
    107  *  To close the tree, include the word "closed" in the status.
    108  * To open the tree, include the word "open" in the status.
    109  * To caution the tree, include the word "caution" in the status.
    110 
    111 
    112 <a name="how_to_submit_when_tree_closed"></a>
    113 ### How to submit when the tree is closed
    114 
    115 * Submit manually using the "git cl land" with the --bypass-hooks flag.
    116 * Add "No-Tree-Checks: true" to your CL description and use the CQ as usual.
    117 
    118 
    119 <a name="how_to_revert"></a>
    120 ### How to revert a CL
    121 
    122 See the revert documentation [here](https://skia.org/dev/contrib/revert).
    123 
    124 
    125 <a name="deps_roll_failures"></a>
    126 ### What to do if DEPS roll fails to land
    127 
    128 A common cause of DEPS roll failures are layout tests. Find the offending Skia CL by examining the commit hash range in the DEPS roll and revert (or talk to the commit author if they are available). If you do revert then keep an eye on the next DEPS roll to make sure it succeeds.
    129 
    130 If a Skia CL changes layout tests, but the new images look good, the tests need to be rebaselined. See [Rebaseline Layout Tests](#how_to_rebaseline).
    131 
    132 <a name="how_to_rebaseline"></a>
    133 ### Rebaseline Layout Tests (i.e., add suppressions)
    134 
    135 * First create a Chromium bug:
    136   * goto [crbug.com](https://crbug.com)
    137   * Make sure you're logged in with your Chromium credentials
    138   * Click New Issue
    139   * Summary: Skia image rebaseline
    140   * Description:
    141       * DEPS roll #,
    142       * Helpful message about what went wrong (e.g., Changes to how lighting is scaled in Skia r#### changed the following images:)
    143       * Layout tests affected
    144       * You should copy the list of affected from stdio of the failing bot
    145   * Status: Assigned
    146   * Owner: yourself
    147   * cc: reed@, bsalomon@, robertphillips@ & developer responsible for changes
    148   * Labels: OS-All & Cr-Blink-LayoutTests
    149   * If it is filter related, cc senorblanco@
    150 
    151 * (Dispreferred but faster) Edit [skia/skia_test_expectations.txt](https://chromium.googlesource.com/chromium/src/+/master/skia/skia_test_expectations.txt)
    152   * Add # comment about what has changed (I usually paraphrase the crbug text)
    153   * Add line(s) like the following after the comment:
    154       * crbug.com/<bug#youjustcreated> foo/bar/test-name.html [ ImageOnlyFailure ]
    155   * Note: this change is usually done in the DEPS roll patch itself
    156 
    157 * (Preferred but slower) Make a separate Blink patch by editing LayoutTests/TestExpectations
    158   * Add # comment about what has changed (I usually paraphrase the crbug text)
    159   * Add line(s) like the following after the comment:
    160       * crbug.com/<bug#youjustcreated> foo/bar/test-name.html [ Skip ]  # needs rebaseline
    161   * Commit the patch you created and wait until it lands and rolls into Chrome
    162 
    163 * Retry the DEPS roll (for the 1st/dispreferred option this usually means just retrying the layout bots)
    164 * Make a Blink patch by editing LayoutTests/TestExpectations
    165   * Add # comment about what has changed
    166   * Add line(s) like the following after the comment:
    167       * crbug.com/<bug#youjustcreated> foo/bar/test-name.html [ Skip ]  # needs rebaseline
    168         * (if you took the second option above you can just edit the existing line(s))
    169 
    170 * If you took the first/dispreferred option above:
    171   * Wait for the Blink patch to roll into Chrome
    172   * Create a Chrome patch that removes your suppressions from skia/skia_test_expectations.txt
    173 
    174 
    175