depot_tools: git-cl: Rename try job to tryjob for consistency
Change-Id: I3310db47604dafead241db4d8d3540277daeb07c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2083675
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 5cf3b16..2144791 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -375,7 +375,7 @@
return project, bucket
-def _trigger_try_jobs(changelist, jobs, options, patchset):
+def _trigger_tryjobs(changelist, jobs, options, patchset):
"""Sends a request to Buildbucket to trigger tryjobs for a changelist.
Args:
@@ -389,8 +389,7 @@
print('To see results here, run: git cl try-results')
print('To see results in browser, run: git cl web')
- requests = _make_try_job_schedule_requests(
- changelist, jobs, options, patchset)
+ requests = _make_tryjob_schedule_requests(changelist, jobs, options, patchset)
if not requests:
return
@@ -411,7 +410,7 @@
'Failed to schedule builds for some bots:\n%s' % '\n'.join(errors))
-def _make_try_job_schedule_requests(changelist, jobs, options, patchset):
+def _make_tryjob_schedule_requests(changelist, jobs, options, patchset):
gerrit_changes = [changelist.GetGerritChange(patchset)]
shared_properties = {'category': getattr(options, 'category', 'git_cl_try')}
if getattr(options, 'clobber', False):
@@ -455,7 +454,7 @@
return requests
-def fetch_try_jobs(changelist, buildbucket_host, patchset=None):
+def _fetch_tryjobs(changelist, buildbucket_host, patchset=None):
"""Fetches tryjobs from buildbucket.
Returns list of buildbucket.v2.Build with the try jobs for the changelist.
@@ -507,7 +506,7 @@
min_ps = max(1, ps - 5)
while ps >= min_ps:
- builds = fetch_try_jobs(changelist, buildbucket_host, patchset=ps)
+ builds = _fetch_tryjobs(changelist, buildbucket_host, patchset=ps)
if len(builds):
return builds, ps
ps -= 1
@@ -518,13 +517,13 @@
"""Returns a list of buckets/builders that are worth retrying.
Args:
- all_builds (list): Builds, in the format returned by fetch_try_jobs,
+ all_builds (list): Builds, in the format returned by _fetch_tryjobs,
i.e. a list of buildbucket.v2.Builds which includes status and builder
info.
Returns:
A dict {(proj, bucket): [builders]}. This is the same format accepted by
- _trigger_try_jobs.
+ _trigger_tryjobs.
"""
grouped = {}
for build in all_builds:
@@ -559,8 +558,8 @@
return sorted(jobs)
-def print_try_jobs(options, builds):
- """Prints nicely result of fetch_try_jobs."""
+def _print_tryjobs(options, builds):
+ """Prints nicely result of _fetch_tryjobs."""
if not builds:
print('No tryjobs scheduled.')
return
@@ -4400,7 +4399,7 @@
if len(jobs) == 0:
print('No failed tryjobs, so --retry-failed has no effect.')
return ret
- _trigger_try_jobs(cl, jobs, options, patchset + 1)
+ _trigger_tryjobs(cl, jobs, options, patchset + 1)
return ret
@@ -4716,7 +4715,7 @@
patchset = cl.GetMostRecentPatchset()
try:
- _trigger_try_jobs(cl, jobs, options, patchset)
+ _trigger_tryjobs(cl, jobs, options, patchset)
except BuildbucketResponseException as ex:
print('ERROR: %s' % ex)
return 1
@@ -4763,14 +4762,14 @@
cl.GetIssue())
try:
- jobs = fetch_try_jobs(cl, options.buildbucket_host, patchset)
+ jobs = _fetch_tryjobs(cl, options.buildbucket_host, patchset)
except BuildbucketResponseException as ex:
print('Buildbucket error: %s' % ex)
return 1
if options.json:
write_json(options.json, jobs)
else:
- print_try_jobs(options, jobs)
+ _print_tryjobs(options, jobs)
return 0