Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: recipe_modules/bot_update/resources/bot_update.py

Issue 2294413002: bot_update: add --auth-refresh-token-json passthrough for apply_issue (Closed)
Patch Set: Lint Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_modules/bot_update/resources/bot_update.py
diff --git a/recipe_modules/bot_update/resources/bot_update.py b/recipe_modules/bot_update/resources/bot_update.py
index fe8dd66ffd0a5eb78b2e218362730cccadc0b8ac..9010697eefa45163fd64c460193ab21a1a23066c 100755
--- a/recipe_modules/bot_update/resources/bot_update.py
+++ b/recipe_modules/bot_update/resources/bot_update.py
@@ -1036,7 +1036,8 @@ def apply_svn_patch(patch_root, patches, whitelist=None, blacklist=None):
raise PatchFailed(e.message, e.code, e.output)
def apply_rietveld_issue(issue, patchset, root, server, _rev_map, _revision,
- email_file, key_file, whitelist=None, blacklist=None):
+ email_file, key_file, oauth2_file,
+ whitelist=None, blacklist=None):
apply_issue_bin = ('apply_issue.bat' if sys.platform.startswith('win')
else 'apply_issue')
cmd = [apply_issue_bin,
@@ -1051,8 +1052,10 @@ def apply_rietveld_issue(issue, patchset, root, server, _rev_map, _revision,
# Don't run gclient sync when it sees a DEPS change.
'--ignore_deps',
]
- # Use an oauth key file if specified.
- if email_file and key_file:
+ # Use an oauth key or json file if specified.
+ if oauth2_file:
+ cmd.extend(['--auth-refresh-token-json', oauth2_file])
+ elif email_file and key_file:
cmd.extend(['--email-file', email_file, '--private-key-file', key_file])
else:
cmd.append('--no-auth')
@@ -1266,8 +1269,9 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
patch_root, issue, patchset, patch_url, rietveld_server,
gerrit_repo, gerrit_ref, gerrit_rebase_patch_ref,
revision_mapping, apply_issue_email_file,
- apply_issue_key_file, buildspec, gyp_env, shallow, runhooks,
- refs, git_cache_dir, gerrit_reset):
+ apply_issue_key_file, apply_issue_oauth2_file, buildspec,
+ gyp_env, shallow, runhooks, refs, git_cache_dir,
+ gerrit_reset):
# Get a checkout of each solution, without DEPS or hooks.
# Calling git directly because there is no way to run Gclient without
# invoking DEPS.
@@ -1296,7 +1300,8 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
elif issue:
apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
revision_mapping, git_ref, apply_issue_email_file,
- apply_issue_key_file, whitelist=[target])
+ apply_issue_key_file, apply_issue_oauth2_file,
+ whitelist=[target])
already_patched.append(target)
elif gerrit_ref and gerrit_rebase_patch_ref:
apply_gerrit_ref(gerrit_repo, gerrit_ref, patch_root, gerrit_reset,
@@ -1333,7 +1338,8 @@ def ensure_checkout(solutions, revisions, first_sln, target_os, target_os_only,
elif issue:
apply_rietveld_issue(issue, patchset, patch_root, rietveld_server,
revision_mapping, git_ref, apply_issue_email_file,
- apply_issue_key_file, blacklist=already_patched)
+ apply_issue_key_file, apply_issue_oauth2_file,
+ blacklist=already_patched)
elif gerrit_ref and not gerrit_rebase_patch_ref:
apply_gerrit_ref(gerrit_repo, gerrit_ref, patch_root, gerrit_reset, False)
@@ -1404,6 +1410,9 @@ def parse_args():
parse.add_option('--apply_issue_key_file',
help='--private-key-file option passthrough for '
'apply_patch.py.')
+ parse.add_option('--apply_issue_oauth2_file',
+ help='--auth-refresh-token-json option passthrough for '
+ 'apply_patch.py.')
parse.add_option('--patch_url', help='Optional URL to SVN patch.')
parse.add_option('--root', dest='patch_root',
help='DEPRECATED: Use --patch_root.')
@@ -1581,6 +1590,7 @@ def checkout(options, git_slns, specs, buildspec, master,
revision_mapping=options.revision_mapping,
apply_issue_email_file=options.apply_issue_email_file,
apply_issue_key_file=options.apply_issue_key_file,
+ apply_issue_oauth2_file=options.apply_issue_oauth2_file,
# For official builders.
buildspec=buildspec,

Powered by Google App Engine
This is Rietveld 408576698