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

Unified Diff: recipes/recipe_modules/recipe_autoroller/api.py

Issue 2242653003: recipe_autoroller: ensure the trivial roll CLs always have CQ bit set (attempt #3) (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: 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
« no previous file with comments | « no previous file | recipes/recipes/recipe_autoroller.expected/previously_uploaded_match.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/recipe_modules/recipe_autoroller/api.py
diff --git a/recipes/recipe_modules/recipe_autoroller/api.py b/recipes/recipe_modules/recipe_autoroller/api.py
index d27c9b95162b6ef70a0641b697a4192589c89f28..9de9819c22fa9e41f44a98bc9f64f3843aad5946 100644
--- a/recipes/recipe_modules/recipe_autoroller/api.py
+++ b/recipes/recipe_modules/recipe_autoroller/api.py
@@ -89,6 +89,10 @@ TRIVIAL_ROLL_TBR_EMAILS = (
ROLL_SUCCESS, ROLL_EMPTY, ROLL_FAILURE = range(3)
+_AUTH_REFRESH_TOKEN_FLAG = (
+ '--auth-refresh-token-json=/creds/refresh_tokens/recipe-roller')
+
+
def get_commit_message(roll_result, tbrs=()):
"""Construct a roll commit message from 'recipes.py autoroll' result.
"""
@@ -244,6 +248,12 @@ class RecipeAutorollerApi(recipe_api.RecipeApi):
if change_data['diff_digest'] != diff_digest:
need_to_upload = True
rebase = True
+ elif roll_result['trivial']:
+ # We won't be uploading. Make sure trivial rolls don't get stuck
+ # if previous CQ attempt failed because of flake.
+ # Pass --rietveld flag to match upload args below.
+ self.m.git('cl', 'set-commit', '--rietveld', _AUTH_REFRESH_TOKEN_FLAG,
+ cwd=workdir)
if need_to_upload:
tbrs = []
@@ -259,8 +269,7 @@ class RecipeAutorollerApi(recipe_api.RecipeApi):
upload_args.extend(['--bypass-hooks', '-f'])
# git cl upload doesn't work yet with gerrit and git cache.
upload_args.extend(['--rietveld'])
- upload_args.extend([
- '--auth-refresh-token-json=/creds/refresh_tokens/recipe-roller'])
+ upload_args.extend([_AUTH_REFRESH_TOKEN_FLAG])
self.m.git_cl.upload(
commit_message, upload_args, name='git cl upload', cwd=workdir)
issue_result = self.m.git(
« no previous file with comments | « no previous file | recipes/recipes/recipe_autoroller.expected/previously_uploaded_match.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698