Эх сурвалжийг харах

[git_number] Improve error message on parse_commitrefs

We are observing "binascii.Error: Non-hexadecimal digit found" on LUCI,
but it's not reproducible on local env.

This change also triggers the recipe roller.

R=gavinmak@google.com

Bug: 1514645
Change-Id: I4b97c4593b117d145f8304069d569607033babbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5160257
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Josip Sokcevic 1 жил өмнө
parent
commit
6c1a07d48a

+ 5 - 1
git_common.py

@@ -682,10 +682,14 @@ def parse_commitrefs(*commitrefs):
         * 'origin/main'
         * 'cool_branch~2'
     """
+    hashes = []
     try:
-        return [binascii.unhexlify(h) for h in hash_multi(*commitrefs)]
+        hashes = hash_multi(*commitrefs)
+        return [binascii.unhexlify(h) for h in hashes]
     except subprocess2.CalledProcessError:
         raise BadCommitRefException(commitrefs)
+    except binascii.Error as e:
+        raise binascii.Error(f'{e}. Invalid hashes are {hashes}')
 
 
 RebaseRet = collections.namedtuple('RebaseRet', 'success stdout stderr')

+ 1 - 0
recipes/trigger_recipe_roller.txt

@@ -10,3 +10,4 @@ a new friend, but this information was marked RVG, so it was months before
 any details were revealed.
 
 The End!
+