-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy authentication files in
GitLocalPrMerge
Signed-off-by: magic_rb <[email protected]>
- Loading branch information
Showing
4 changed files
with
47 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -986,6 +986,7 @@ async def run_vc( | |
pr_head = build_props.getProperty("github.head.sha") or build_props.getProperty( | ||
"head_sha" | ||
) | ||
auth_workdir = self._get_auth_data_workdir() | ||
|
||
# Not a PR, fallback to default behavior | ||
if merge_base is None or pr_head is None: | ||
|
@@ -1005,33 +1006,42 @@ async def run_vc( | |
self.build.path_module.join(self.workdir, ".git") | ||
) | ||
|
||
if not has_git: | ||
await self._dovccmd(["clone", "--recurse-submodules", self.repourl, "."]) | ||
try: | ||
await self._git_auth.download_auth_files_if_needed(auth_workdir) | ||
|
||
patched = await self.sourcedirIsPatched() | ||
if not has_git: | ||
await self._dovccmd( | ||
["clone", "--recurse-submodules", self.repourl, "."] | ||
) | ||
|
||
if patched: | ||
await self._dovccmd(["clean", "-f", "-f", "-d", "-x"]) | ||
patched = await self.sourcedirIsPatched() | ||
|
||
await self._dovccmd(["fetch", "-f", "-t", self.repourl, merge_base, pr_head]) | ||
if patched: | ||
await self._dovccmd(["clean", "-f", "-f", "-d", "-x"]) | ||
|
||
await self._dovccmd(["checkout", "--detach", "-f", pr_head]) | ||
await self._dovccmd( | ||
["fetch", "-f", "-t", self.repourl, merge_base, pr_head] | ||
) | ||
|
||
await self._dovccmd( | ||
[ | ||
"-c", | ||
"[email protected]", | ||
"-c", | ||
"user.name=buildbot", | ||
"merge", | ||
"--no-ff", | ||
"-m", | ||
f"Merge {merge_base} into {pr_head}", | ||
merge_base, | ||
] | ||
) | ||
self.updateSourceProperty("got_revision", pr_head) | ||
return await self.parseCommitDescription() | ||
await self._dovccmd(["checkout", "--detach", "-f", pr_head]) | ||
|
||
await self._dovccmd( | ||
[ | ||
"-c", | ||
"[email protected]", | ||
"-c", | ||
"user.name=buildbot", | ||
"merge", | ||
"--no-ff", | ||
"-m", | ||
f"Merge {merge_base} into {pr_head}", | ||
merge_base, | ||
] | ||
) | ||
self.updateSourceProperty("got_revision", pr_head) | ||
return await self.parseCommitDescription() | ||
finally: | ||
await self._git_auth.remove_auth_files_if_needed(auth_workdir) | ||
|
||
|
||
def nix_eval_config( | ||
|
@@ -1058,8 +1068,12 @@ def nix_eval_config( | |
submodules=True, | ||
haltOnFailure=True, | ||
logEnviron=False, | ||
sshPrivateKey=project.private_key_path.read_text() if project.private_key_path else None, | ||
sshKnownHosts=project.known_hosts_path.read_text() if project.known_hosts_path else None, | ||
sshPrivateKey=project.private_key_path.read_text() | ||
if project.private_key_path | ||
else None, | ||
sshKnownHosts=project.known_hosts_path.read_text() | ||
if project.known_hosts_path | ||
else None, | ||
), | ||
) | ||
drv_gcroots_dir = util.Interpolate( | ||
|
@@ -1416,8 +1430,12 @@ def buildbot_effects_config( | |
method="clean", | ||
submodules=True, | ||
haltOnFailure=True, | ||
sshPrivateKey=project.private_key_path.read_text() if project.private_key_path else None, | ||
sshKnownHosts=project.known_hosts_path.read_text() if project.known_hosts_path else None, | ||
sshPrivateKey=project.private_key_path.read_text() | ||
if project.private_key_path | ||
else None, | ||
sshKnownHosts=project.known_hosts_path.read_text() | ||
if project.known_hosts_path | ||
else None, | ||
), | ||
) | ||
secrets_list = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters