@@ -988,6 +988,7 @@ async def run_vc(
988
988
pr_head = build_props .getProperty ("github.head.sha" ) or build_props .getProperty (
989
989
"head_sha"
990
990
)
991
+ auth_workdir = self ._get_auth_data_workdir ()
991
992
992
993
# Not a PR, fallback to default behavior
993
994
if merge_base is None or pr_head is None :
@@ -1007,33 +1008,42 @@ async def run_vc(
1007
1008
self .build .path_module .join (self .workdir , ".git" )
1008
1009
)
1009
1010
1010
- if not has_git :
1011
- await self ._dovccmd ([ "clone" , "--recurse-submodules" , self . repourl , "." ] )
1011
+ try :
1012
+ await self ._git_auth . download_auth_files_if_needed ( auth_workdir )
1012
1013
1013
- patched = await self .sourcedirIsPatched ()
1014
+ if not has_git :
1015
+ await self ._dovccmd (
1016
+ ["clone" , "--recurse-submodules" , self .repourl , "." ]
1017
+ )
1014
1018
1015
- if patched :
1016
- await self ._dovccmd (["clean" , "-f" , "-f" , "-d" , "-x" ])
1019
+ patched = await self .sourcedirIsPatched ()
1017
1020
1018
- await self ._dovccmd (["fetch" , "-f" , "-t" , self .repourl , merge_base , pr_head ])
1021
+ if patched :
1022
+ await self ._dovccmd (["clean" , "-f" , "-f" , "-d" , "-x" ])
1019
1023
1020
- await self ._dovccmd (["checkout" , "--detach" , "-f" , pr_head ])
1024
+ await self ._dovccmd (
1025
+ ["fetch" , "-f" , "-t" , self .repourl , merge_base , pr_head ]
1026
+ )
1021
1027
1022
- await self ._dovccmd (
1023
- [
1024
- "-c" ,
1025
- "user.email=buildbot@example.com" ,
1026
- "-c" ,
1027
- "user.name=buildbot" ,
1028
- "merge" ,
1029
- "--no-ff" ,
1030
- "-m" ,
1031
- f"Merge { merge_base } into { pr_head } " ,
1032
- merge_base ,
1033
- ]
1034
- )
1035
- self .updateSourceProperty ("got_revision" , pr_head )
1036
- return await self .parseCommitDescription ()
1028
+ await self ._dovccmd (["checkout" , "--detach" , "-f" , pr_head ])
1029
+
1030
+ await self ._dovccmd (
1031
+ [
1032
+ "-c" ,
1033
+ "user.email=buildbot@example.com" ,
1034
+ "-c" ,
1035
+ "user.name=buildbot" ,
1036
+ "merge" ,
1037
+ "--no-ff" ,
1038
+ "-m" ,
1039
+ f"Merge { merge_base } into { pr_head } " ,
1040
+ merge_base ,
1041
+ ]
1042
+ )
1043
+ self .updateSourceProperty ("got_revision" , pr_head )
1044
+ return await self .parseCommitDescription ()
1045
+ finally :
1046
+ await self ._git_auth .remove_auth_files_if_needed (auth_workdir )
1037
1047
1038
1048
1039
1049
def nix_eval_config (
@@ -1060,8 +1070,12 @@ def nix_eval_config(
1060
1070
submodules = True ,
1061
1071
haltOnFailure = True ,
1062
1072
logEnviron = False ,
1063
- sshPrivateKey = project .private_key_path .read_text () if project .private_key_path else None ,
1064
- sshKnownHosts = project .known_hosts_path .read_text () if project .known_hosts_path else None ,
1073
+ sshPrivateKey = project .private_key_path .read_text ()
1074
+ if project .private_key_path
1075
+ else None ,
1076
+ sshKnownHosts = project .known_hosts_path .read_text ()
1077
+ if project .known_hosts_path
1078
+ else None ,
1065
1079
),
1066
1080
)
1067
1081
drv_gcroots_dir = util .Interpolate (
@@ -1370,6 +1384,8 @@ def nix_skipped_build_config(
1370
1384
collapseRequests = False ,
1371
1385
env = {},
1372
1386
factory = factory ,
1387
+ do_build_if = lambda build : do_register_gcroot_if (build , branch_config_dict )
1388
+ and outputs_path is not None ,
1373
1389
)
1374
1390
1375
1391
@@ -1419,8 +1435,12 @@ def buildbot_effects_config(
1419
1435
method = "clean" ,
1420
1436
submodules = True ,
1421
1437
haltOnFailure = True ,
1422
- sshPrivateKey = project .private_key_path .read_text () if project .private_key_path else None ,
1423
- sshKnownHosts = project .known_hosts_path .read_text () if project .known_hosts_path else None ,
1438
+ sshPrivateKey = project .private_key_path .read_text ()
1439
+ if project .private_key_path
1440
+ else None ,
1441
+ sshKnownHosts = project .known_hosts_path .read_text ()
1442
+ if project .known_hosts_path
1443
+ else None ,
1424
1444
),
1425
1445
)
1426
1446
secrets_list = []
0 commit comments