30
30
import os
31
31
import traceback
32
32
from retrying import retry
33
+ import random
34
+ import string
33
35
34
36
import bottle
35
37
bottle .BaseRequest .MEMFILE_MAX = 1024 * 1024 * 10
@@ -241,9 +243,12 @@ def rollup(user_gh, state, repo_label, repo_cfg, repo):
241
243
base_ref = rollup_states [0 ].base_ref
242
244
243
245
base_sha = repo .ref ('heads/' + base_ref ).object .sha
246
+ branch_name = 'rollup-' + '' .join (
247
+ random .choice (string .digits + string .ascii_lowercase ) for _ in range (7 )
248
+ )
244
249
utils .github_set_ref (
245
250
user_repo ,
246
- 'heads/' + repo_cfg . get ( 'branch' , {}). get ( 'rollup' , 'rollup' ) ,
251
+ 'heads/' + branch_name ,
247
252
base_sha ,
248
253
force = True ,
249
254
)
@@ -265,8 +270,7 @@ def rollup(user_gh, state, repo_label, repo_cfg, repo):
265
270
)
266
271
267
272
try :
268
- rollup = repo_cfg .get ('branch' , {}).get ('rollup' , 'rollup' )
269
- user_repo .merge (rollup , state .head_sha , merge_msg )
273
+ user_repo .merge (branch_name , state .head_sha , merge_msg )
270
274
except github3 .models .GitHubError as e :
271
275
if e .code != 409 :
272
276
raise
@@ -286,11 +290,10 @@ def rollup(user_gh, state, repo_label, repo_cfg, repo):
286
290
body += '\n r? @ghost'
287
291
288
292
try :
289
- rollup = repo_cfg .get ('branch' , {}).get ('rollup' , 'rollup' )
290
293
pull = base_repo .create_pull (
291
294
title ,
292
295
state .base_ref ,
293
- user_repo .owner .login + ':' + rollup ,
296
+ user_repo .owner .login + ':' + branch_name ,
294
297
body ,
295
298
)
296
299
except github3 .models .GitHubError as e :
0 commit comments