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

Unified Diff: appengine/cr-buildbucket/service.py

Issue 1877083003: buildbucket: add retry API. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/cr-buildbucket/api.py ('k') | appengine/cr-buildbucket/test/api_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/service.py
diff --git a/appengine/cr-buildbucket/service.py b/appengine/cr-buildbucket/service.py
index f13cef7dc623ef0107c84caab2ff78104d317044..d5494fe9d98b2adc571cdfe03eb46756ec8959b3 100644
--- a/appengine/cr-buildbucket/service.py
+++ b/appengine/cr-buildbucket/service.py
@@ -182,6 +182,23 @@ def add(*args, **kwargs):
return add_async(*args, **kwargs).get_result()
+def retry(
+ build_id, lease_expiration_date=None, client_operation_id=None,
+ pubsub_callback=None):
+ """Adds a build with same bucket, parameters and tags as the given one."""
+ build = model.Build.get_by_id(build_id)
+ if not build:
+ raise errors.BuildNotFoundError('Build %s not found' % build_id)
+ return add(
Vadim Sh. 2016/04/11 23:30:10 does it make sense to add some sort of a "backlink
nodir 2016/04/11 23:57:36 Done
+ build.bucket,
+ tags=build.tags,
+ parameters=build.parameters,
+ lease_expiration_date=lease_expiration_date,
+ client_operation_id=client_operation_id,
+ pubsub_callback=pubsub_callback,
+ )
+
+
def get(build_id):
"""Gets a build by |build_id|.
« no previous file with comments | « appengine/cr-buildbucket/api.py ('k') | appengine/cr-buildbucket/test/api_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698