-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+8 - switch upstream pretest to force-tracking branches
- Loading branch information
Showing
1 changed file
with
9 additions
and
15 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 |
---|---|---|
|
@@ -105,17 +105,10 @@ jobs: | |
$repo_name = $matches[2] | ||
$fork_url = "[email protected]:SunSerega/${repo_name}.git" | ||
$mergeable_prs = @() | ||
foreach ($l in Get-GitRemoteBranches $repo_url 'refs/pull/*/merge') { | ||
$pr_num = $l.matches[1] | ||
$mergeable_prs += $pr_num | ||
} | ||
$head_sha_by_pr = @{} | ||
foreach ($l in Get-GitRemoteBranches $repo_url 'refs/pull/*/head') { | ||
foreach ($l in Get-GitRemoteBranches $fork_url 'refs/force-tracking/*') { | ||
$sha = $l.sha | ||
$pr_num = $l.matches[1] | ||
if ($pr_num -notin $mergeable_prs) { continue } | ||
Write-Host "- Found open PR $pr_num with latest sha $sha" | ||
$head_sha_by_pr.Add($pr_num, $sha) | ||
} | ||
|
@@ -373,8 +366,8 @@ jobs: | |
$b_fork_main = 'custom' | ||
$b_fork_pretest = "pretest/$pr_num" | ||
$b_fork_merged_pr_head = "$pr_num/merged_pr_head" # $pr_num/head + main | ||
$b_fork_virgin_merge_test = "$pr_num/virgin_merge_test" # $b_merged_pr_head + custom | ||
$b_fork_merged_pr_head = "$pr_num/merged_pr_head" # force-tracking/$pr_num + main | ||
$b_fork_virgin_merge_test = "$pr_num/virgin_merge_test" # $b_fork_merged_pr_head + custom | ||
$b_core_main = '${{ github.event.repository.default_branch }}' | ||
$b_core_subm_pretest = "subm-pretest/$org_repo/$pr_num" | ||
|
@@ -385,11 +378,12 @@ jobs: | |
Write-Host "Updating subm fork..." | ||
Push-Location './fork' | ||
git remote add $remote_official "[email protected]:${org_repo}.git" | ||
git config --add "remote.$remote_official.fetch" "+refs/pull/*:refs/remotes/$remote_official/pull/*" | ||
git fetch --all 2>&1 | Out-Null | ||
if (-not $?) { throw "git remote add failed" } | ||
git fetch $remote_official main 2>&1 | Out-Null | ||
if (-not $?) { throw "git fetch failed" } | ||
Write-Host "- Creating $b_fork_merged_pr_head" | ||
git checkout "remotes/$remote_official/pull/$pr_num/head" | ||
git checkout "remotes/origin/force-tracking/$pr_num" | ||
if (-not $?) { throw "git checkout failed" } | ||
git checkout -b $b_fork_merged_pr_head | ||
if (-not $?) { throw "git checkout -b failed" } | ||
|
@@ -427,7 +421,7 @@ jobs: | |
if (-not $?) { throw "git merge failed" } | ||
Write-Host "--- Merging with PR head:" | ||
git merge "remotes/$remote_official/pull/$pr_num/head" | ||
git merge "remotes/origin/force-tracking/$pr_num" | ||
if (-not $?) { throw "git merge failed" } | ||
Write-Host "--- Merging with ${b_fork_upstream_main}:" | ||
|
@@ -626,7 +620,7 @@ jobs: | |
Write-Host "Adding meta to fork repo..." | ||
Push-Location './fork' | ||
$pr_head_sha = git rev-parse "remotes/0_official/pull/$pr_num/head" | ||
$pr_head_sha = git rev-parse "remotes/origin/force-tracking/$pr_num" | ||
if (-not $?) { throw "git rev-parse failed" } | ||
$meta_commit_message = @() | ||
|