[owners] Fix SuggestOwners when there is only one owner.

If there are less than two owners for the given paths,
current implementation will get stuck in infinite loop.

Change it to return any possible owner.

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

depot_tools

Tools for working with Chromium development. It requires python 2.7 or 3.8 for python 3 support.

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.