with_resultdb() always set enable=True
There is no reason to allow users to disable it by pasing a param
to with_resultdb(). Users should have not invoked with_resultdb(), if
ResultDB was not intended to be enabled.
R=nodir@chromium.org,jwata@google.com
you can land this upstream change. Once the
upstream change lands, roll it into your downstream CL:
Bug: 1099573
Change-Id: I7a85fdaa4a7a76d0a83771623da7023ed5034880
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/2316459
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
diff --git a/recipe_modules/swarming/api.py b/recipe_modules/swarming/api.py
index 0f0035f..66353e6 100644
--- a/recipe_modules/swarming/api.py
+++ b/recipe_modules/swarming/api.py
@@ -198,13 +198,13 @@
"""Returns the ResultDB integration config of the task."""
return self._resultdb
- def with_resultdb(self, enable=True):
- """Enables or disables the ResultDB integration in the task.
+ def with_resultdb(self):
+ """Enables the ResultDB integration in the task.
Requires the task request to be associated with some LUCI realm.
"""
ret = self._copy()
- ret._resultdb = self.ResultDBCfg(enable=enable)
+ ret._resultdb = self.ResultDBCfg(enable=True)
return ret
@property
@@ -279,7 +279,7 @@
if 'user' in d:
ret = ret.with_user(d['user'])
if 'resultdb' in d:
- ret = ret.with_resultdb(**d['resultdb'])
+ ret = ret.with_resultdb()
if 'realm' in d:
ret = ret.with_realm(d['realm'])
ret._slices = [