bisect-kit: buildbucket_util: ignore builds without artifacts

BUG=b:201256582
TEST=manually

Change-Id: I913ef757049d593587020442d4fe75d7c56f7593
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/bisect-kit/+/3193989
Tested-by: Zheng-Jie Chang <zjchang@chromium.org>
Auto-Submit: Zheng-Jie Chang <zjchang@chromium.org>
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
Commit-Queue: Kuang-che Wu <kcwu@chromium.org>
diff --git a/bisect_kit/buildbucket_util.py b/bisect_kit/buildbucket_util.py
index a313d18..67c5e65 100644
--- a/bisect_kit/buildbucket_util.py
+++ b/bisect_kit/buildbucket_util.py
@@ -525,6 +525,9 @@
       if build.status not in valid_status:
         continue
       input_properties = json_format.MessageToDict(build.input.properties)
+      output_properties = json_format.MessageToDict(build.output.properties)
+      gs_bucket = util.dict_get(output_properties, 'artifacts', 'gs_bucket')
+      gs_path = util.dict_get(output_properties, 'artifacts', 'gs_path')
       build_manifest_hash = util.dict_get(input_properties,
                                           '$chromeos/cros_source',
                                           'snapshot_cas', 'digest')
@@ -533,6 +536,7 @@
       build_src_ver = util.dict_get(input_properties, '$chromeos/chrome',
                                     'version')
       if (build_manifest_hash == manifest_digest and
-          build_deps_hash == deps_digest and build_src_ver == deps_src_ver):
+          build_deps_hash == deps_digest and build_src_ver == deps_src_ver and
+          gs_bucket and gs_path):
         return build
     return None