From b0cb703a698e085eb824855b37481f7fcadce7c2 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Fri, 17 Mar 2023 14:14:08 -0500 Subject: [PATCH 1/4] Add call to create PR in AzDo servicing. --- eng/push-tarball.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eng/push-tarball.sh b/eng/push-tarball.sh index 3d3db61dd1..e0454a16dc 100755 --- a/eng/push-tarball.sh +++ b/eng/push-tarball.sh @@ -112,8 +112,17 @@ pushd "$vmr_path" if [ "$is_dry_run" = true ]; then echo "Doing a dry run, not pushing to upstream. List of changes:" git log --name-status HEAD^..HEAD || echo "No changes to commit." + echo "Would push $new_brance_name to $upstream_url" + echo "Would create PR from $new_branch_name to $target_branch" else echo "Pushing branch to upstream." git push -u upstream "$new_branch_name" + + echo "Creating PR from $new_branch_name to $target_branch" + curl -d "{ + \"sourceRefName\": \"$new_branch_name\", + \"targetRefName\": \"$target_branch\", + \"title\": \"Source-build update to \"$sdk_version\" + }" "https://dev.azure.com/dotnet-security-partners/dotnet/_apis/git/repositories/dotnet/pullrequests?api-version=7.0" fi popd From 69ed8ffdd4304a133ec12d85e6058711c89824d1 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Fri, 17 Mar 2023 14:15:32 -0500 Subject: [PATCH 2/4] Fix typo. --- eng/push-tarball.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/push-tarball.sh b/eng/push-tarball.sh index e0454a16dc..ed51a497b8 100755 --- a/eng/push-tarball.sh +++ b/eng/push-tarball.sh @@ -112,7 +112,7 @@ pushd "$vmr_path" if [ "$is_dry_run" = true ]; then echo "Doing a dry run, not pushing to upstream. List of changes:" git log --name-status HEAD^..HEAD || echo "No changes to commit." - echo "Would push $new_brance_name to $upstream_url" + echo "Would push $new_branch_name to $upstream_url" echo "Would create PR from $new_branch_name to $target_branch" else echo "Pushing branch to upstream." From bbc61bc5ee6fd129a89da161fb64c9d78072621f Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Mon, 20 Mar 2023 13:38:30 -0500 Subject: [PATCH 3/4] Some debugging and simplification from it. --- eng/push-tarball.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/eng/push-tarball.sh b/eng/push-tarball.sh index ed51a497b8..4b5cac87f5 100755 --- a/eng/push-tarball.sh +++ b/eng/push-tarball.sh @@ -109,20 +109,26 @@ pushd "$vmr_path" git add -f . git diff --staged --quiet || git commit -m "Update to .NET $sdk_version" + pr_url=$(echo $upstream_url | sed "s,_git.*,_apis/git/repositories/security-partners-dotnet/pullrequests?api-version=7.0,g") + data="{ + \"sourceRefName\": \"refs/heads/$new_branch_name\", + \"targetRefName\": \"refs/heads/$target_branch\", + \"title\": \"Source-build update to $sdk_version\", + \"description\": \"Update to $sdk_version\" + }" + if [ "$is_dry_run" = true ]; then echo "Doing a dry run, not pushing to upstream. List of changes:" git log --name-status HEAD^..HEAD || echo "No changes to commit." echo "Would push $new_branch_name to $upstream_url" echo "Would create PR from $new_branch_name to $target_branch" + echo "PR creation payload: $data" + echo "PR creation URL: $pr_url" else echo "Pushing branch to upstream." git push -u upstream "$new_branch_name" echo "Creating PR from $new_branch_name to $target_branch" - curl -d "{ - \"sourceRefName\": \"$new_branch_name\", - \"targetRefName\": \"$target_branch\", - \"title\": \"Source-build update to \"$sdk_version\" - }" "https://dev.azure.com/dotnet-security-partners/dotnet/_apis/git/repositories/dotnet/pullrequests?api-version=7.0" + curl -H 'Content-Type: application/json' -d "$data" "$pr_url" fi popd From 2c336e7140b560fcb430e727f7e0752d4aded7e1 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Mon, 20 Mar 2023 13:57:38 -0500 Subject: [PATCH 4/4] Update eng/push-tarball.sh Co-authored-by: Michael Simons --- eng/push-tarball.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/push-tarball.sh b/eng/push-tarball.sh index 4b5cac87f5..ec5ea72142 100755 --- a/eng/push-tarball.sh +++ b/eng/push-tarball.sh @@ -113,7 +113,7 @@ pushd "$vmr_path" data="{ \"sourceRefName\": \"refs/heads/$new_branch_name\", \"targetRefName\": \"refs/heads/$target_branch\", - \"title\": \"Source-build update to $sdk_version\", + \"title\": \"Update to $sdk_version\", \"description\": \"Update to $sdk_version\" }"