sdk: created binhost CLs are reported in str:num format
Earlier code and comments assumed CLs were reported as URIs, but
they are actually reported as str:num identifiers.
BUG=b:265016848
TEST=./run_tests
Change-Id: I2e3e5bde46d7dea0b765cf6762671a7d1668b7d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4150208
Commit-Queue: Bob Haarman <inglorion@chromium.org>
Tested-by: Bob Haarman <inglorion@chromium.org>
Reviewed-by: Greg Edelston <gredelston@google.com>
diff --git a/api/controller/sdk.py b/api/controller/sdk.py
index 8c8c469..8a88039 100644
--- a/api/controller/sdk.py
+++ b/api/controller/sdk.py
@@ -21,11 +21,11 @@
output_proto.version.version = 168
-def _CLUris(_input_proto, output_proto, _config):
- """Add fake CL URIs to a successful response."""
+def _BinhostCLs(_input_proto, output_proto, _config):
+ """Add fake CL identifiers to a successful response."""
output_proto.cls = [
- "https://crrev.com/fakecl/1",
- "https://crrev.com/fakecl/2",
+ "fakecl:1",
+ "fakecl:2",
]
@@ -198,7 +198,7 @@
sdk.BuildPrebuilts(chroot, board=input_proto.build_target.name)
-@faux.success(_CLUris)
+@faux.success(_BinhostCLs)
@faux.empty_error
@validate.require(
"prepend_version", "version", "upload_location", "sdk_tarball_template"
@@ -210,13 +210,14 @@
_config: "api_config.ApiConfig",
) -> None:
"""Create CLs to update the binhost to point at uploaded prebuilts."""
- uris = sdk.CreateBinhostCLs(
- input_proto.prepend_version,
- input_proto.version,
- input_proto.upload_location,
- input_proto.sdk_tarball_template,
+ output_proto.cls.extend(
+ sdk.CreateBinhostCLs(
+ input_proto.prepend_version,
+ input_proto.version,
+ input_proto.upload_location,
+ input_proto.sdk_tarball_template,
+ )
)
- output_proto.cls.extend(uris)
@faux.all_empty