findmissing: Add gerrit auth by passing cookies
Requested access for the GCE robot account to upload changes to
Gerrit (crbug/1054246).
The robot account gets access to Gerrit by passing in generated cookies to
each request. The gerrit-review URL is also modified to allow for GAIA
authentication by suffixing /a/.
BUG=None
TEST=ran functions to see if authorized + response returned
Change-Id: Ie9c4ef56e1832b93a40ed9a2b46e39ceedcc1ffc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2097346
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Tested-by: Hirthanan Subenderan <hirthanan@google.com>
Commit-Queue: Hirthanan Subenderan <hirthanan@google.com>
diff --git a/contrib/findmissing/common.py b/contrib/findmissing/common.py
index 853125b..938853b 100755
--- a/contrib/findmissing/common.py
+++ b/contrib/findmissing/common.py
@@ -24,7 +24,7 @@
CHROMIUM_SITE = 'https://chromium.googlesource.com/'
CHROMEOS_REPO = CHROMIUM_SITE + 'chromiumos/third_party/kernel'
-CHROMIUM_REVIEW_BASEURL = 'https://chromium-review.googlesource.com/'
+CHROMIUM_REVIEW_BASEURL = 'https://chromium-review.googlesource.com/a'
# Order SUPPORTED_BRANCHES from oldest to newest
SUPPORTED_BRANCHES = ['4.4', '4.14', '4.19', '5.4']
@@ -35,6 +35,8 @@
UPSTREAM_PATH = 'linux_upstream'
WORKDIR = os.getcwd()
+GIT_COOKIE_PATH = os.path.join(WORKDIR, '.git-credential-cache/cookie')
+
# "commit" is sometimes seen multiple times, such as with commit 6093aabdd0ee
CHERRYPICK = re.compile(r'cherry picked from (commit )+([0-9a-f]+)')