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