Chromium Code Reviews| Index: appengine/cr-buildbucket/service.py |
| diff --git a/appengine/cr-buildbucket/service.py b/appengine/cr-buildbucket/service.py |
| index f13cef7dc623ef0107c84caab2ff78104d317044..bd2845bb6d24b8bc130e12e71ab7e4f8c8c120bd 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( |
| + build.bucket, |
| + tags=build.tags + ['retry_of:%s' % build_id], |
|
Vadim Sh.
2016/04/12 00:02:13
well.. if you want to use server-side provided tag
nodir
2016/04/12 13:32:43
Done.
|
| + 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|. |