Randomize results of git cl owners

git cl owners orders owners by score with alphabetization being the tie
breaker. This leads to some owners being suggested far more often than
others.

Adding a tiny amount of randomization to the scoring leads to an even
distribution of equally qualified reviewers. Less qualified reviewers
will still be sorted into distinct buckets - the randomness is too small
to do anything except break ties.

The tests were updated so that they can tolerate the randomness, but
only for breaking ties.

Bug: 1024083
Change-Id: If7d39d1b3bbd980b80b46ab3f62c65215309bdc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1913642
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
3 files changed
tree: 3d6ab53a328e8d601bb67e9f8bda77aedabd7701
  1. bootstrap/
  2. fetch_configs/
  3. git-templates/
  4. infra/
  5. man/
  6. python-bin/
  7. recipes/
  8. testing_support/
  9. tests/
  10. third_party/
  11. win_toolchain/
  12. zsh-goodies/
  13. .gitattributes
  14. .gitignore
  15. .style.yapf
  16. .vpython
  17. .vpython3
  18. annotated_gclient.py
  19. auth.py
  20. autoninja
  21. autoninja.bat
  22. autoninja.py
  23. bb
  24. bb.bat
  25. bootstrap_python3
  26. breakpad.py
  27. cipd
  28. cipd.bat
  29. cipd.ps1
  30. cipd_bin_setup.bat
  31. cipd_bin_setup.sh
  32. cipd_client_version
  33. cipd_client_version.digests
  34. cipd_manifest.txt
  35. cipd_manifest.versions
  36. cit
  37. cit.bat
  38. cit.py
  39. clang-format
  40. clang-format.bat
  41. clang_format.py
  42. clang_format_merge_driver
  43. clang_format_merge_driver.bat
  44. clang_format_merge_driver.py
  45. codereview.settings
  46. compile_single_file
  47. compile_single_file.bat
  48. compile_single_file.py
  49. cpplint.bat
  50. cpplint.py
  51. cpplint_chromium.py
  52. cros
  53. CROS_OWNERS
  54. crosjobs
  55. dart_format.py
  56. detect_host_arch.py
  57. download_from_google_storage
  58. download_from_google_storage.bat
  59. download_from_google_storage.py
  60. ensure_bootstrap
  61. fetch
  62. fetch.bat
  63. fetch.py
  64. fix_encoding.py
  65. gclient
  66. gclient-new-workdir.py
  67. gclient.bat
  68. gclient.py
  69. gclient_completion.sh
  70. gclient_eval.py
  71. gclient_paths.py
  72. gclient_scm.py
  73. gclient_utils.py
  74. gerrit_client.py
  75. gerrit_util.py
  76. git-cache
  77. git-cl
  78. git-crrev-parse
  79. git-drover
  80. git-find-releases
  81. git-footers
  82. git-freeze
  83. git-gs
  84. git-hyper-blame
  85. git-map
  86. git-map-branches
  87. git-mark-merge-base
  88. git-nav-downstream
  89. git-nav-upstream
  90. git-new-branch
  91. git-number
  92. git-rebase-update
  93. git-rename-branch
  94. git-reparent-branch
  95. git-retry
  96. git-runhooks
  97. git-squash-branch
  98. git-thaw
  99. git-upstream-diff
  100. git_cache.py
  101. git_cl.py
  102. git_cl_completion.sh
  103. git_common.py
  104. git_dates.py
  105. git_drover.py
  106. git_find_releases.py
  107. git_footers.py
  108. git_freezer.py
  109. git_hyper_blame.py
  110. git_map.py
  111. git_map_branches.py
  112. git_mark_merge_base.py
  113. git_nav_downstream.py
  114. git_new_branch.py
  115. git_number.py
  116. git_rebase_update.py
  117. git_rename_branch.py
  118. git_reparent_branch.py
  119. git_retry.py
  120. git_squash_branch.py
  121. git_upstream_diff.py
  122. gn
  123. gn.bat
  124. gn.py
  125. goma_auth
  126. goma_auth.bat
  127. goma_ctl
  128. goma_ctl.bat
  129. gsutil.py
  130. gsutil.py.bat
  131. gsutil.vpython
  132. led
  133. led.bat
  134. LICENSE
  135. luci-auth
  136. luci-auth.bat
  137. lucicfg
  138. lucicfg.bat
  139. mac_toolchain
  140. metrics.py
  141. metrics.README.md
  142. metrics_utils.py
  143. my_activity.py
  144. ninja
  145. ninja-linux32
  146. ninja-linux64
  147. ninja-mac
  148. ninja.exe
  149. ninjalog.README.md
  150. ninjalog_uploader.py
  151. ninjalog_uploader_wrapper.py
  152. OWNERS
  153. owners.py
  154. owners_finder.py
  155. post_build_ninja_summary.py
  156. PRESUBMIT.py
  157. presubmit_canned_checks.py
  158. presubmit_support.py
  159. profile.xml
  160. prpc
  161. prpc.bat
  162. pylint
  163. pylint-1.5
  164. pylint-1.6
  165. pylint-1.7
  166. pylint-1.8
  167. pylint-1.9
  168. pylint.bat
  169. pylint_main.py
  170. pylintrc
  171. python_runner.sh
  172. README.gclient.md
  173. README.git-cl.md
  174. README.md
  175. repo
  176. roll-dep
  177. roll-dep-svn
  178. roll-dep-svn.bat
  179. roll-dep.bat
  180. roll_dep.py
  181. roll_dep_svn.py
  182. scm.py
  183. setup_color.py
  184. split_cl.py
  185. subcommand.py
  186. subprocess2.py
  187. update_depot_tools
  188. update_depot_tools.bat
  189. update_depot_tools_toggle.py
  190. upload_metrics.py
  191. upload_to_google_storage.py
  192. vpython
  193. vpython.bat
  194. vpython3
  195. vpython3.bat
  196. WATCHLISTS
  197. watchlists.py
  198. weekly
  199. wtf
  200. yapf
  201. yapf.bat
README.md

depot_tools

Tools for working with Chromium development. It requires python 2.7.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

On Windows only, running gclient will install git and python.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r reviewer1@chromium.org,reviewer2@chromium.org --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.

Note that the cpplint.py here is also used by the Tricium analyzer, so if the cpplint.py here changes, we should also update the copy used there.