From 8ac6d0383f462e4259be78d7d6efcc69b995682e Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:02:12 +0000 Subject: [PATCH 1/6] chore: redo typo script --- scripts/redo-typo-pr | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/redo-typo-pr diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr new file mode 100755 index 00000000000..03c2f5fd11a --- /dev/null +++ b/scripts/redo-typo-pr @@ -0,0 +1,31 @@ +#!/bin/bash + +set -eux + +# Configuration +ORIGINAL_PR_NUMBER=$1 +REPO='AztecProtocol/aztec-packages' +NEW_BRANCH="chore/typo-redo-$(date +%Y%m%d)" +AUTHOR=`gh pr view 5913 --json author --jq '.author.login'` + +# Step 1: Checkout the PR locally +echo "Checking out PR #$ORIGINAL_PR_NUMBER" +gh pr checkout $ORIGINAL_PR_NUMBER + +# Step 2: Create a new local branch +echo "Creating new local branch $NEW_BRANCH" +git checkout -b $NEW_BRANCH + +# Step 3: Push the new branch to GitHub +echo "Pushing new branch $NEW_BRANCH to GitHub" +git push origin $NEW_BRANCH + +# Step 4: create a new pull request +echo "Creating a new pull request for $NEW_BRANCH" +gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR" --body "Thanks $AUTHOR. Our policy is to redo typo changes to dissuade metric farming." + +# Step 5: Close the original PR +echo "Closing original PR #$ORIGINAL_PR_NUMBER" +gh pr close $ORIGINAL_PR_NUMBER --delete-branch + +echo "Script completed." From cba3e9b84e180eb4b6866ef7081060b17f024991 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:03:41 +0000 Subject: [PATCH 2/6] improve --- scripts/redo-typo-pr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr index 03c2f5fd11a..08153ccf8d5 100755 --- a/scripts/redo-typo-pr +++ b/scripts/redo-typo-pr @@ -6,7 +6,7 @@ set -eux ORIGINAL_PR_NUMBER=$1 REPO='AztecProtocol/aztec-packages' NEW_BRANCH="chore/typo-redo-$(date +%Y%m%d)" -AUTHOR=`gh pr view 5913 --json author --jq '.author.login'` +AUTHOR=`gh pr view $ORIGINAL_PR_NUMBER --json author --jq '.author.login'` # Step 1: Checkout the PR locally echo "Checking out PR #$ORIGINAL_PR_NUMBER" @@ -22,7 +22,7 @@ git push origin $NEW_BRANCH # Step 4: create a new pull request echo "Creating a new pull request for $NEW_BRANCH" -gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR" --body "Thanks $AUTHOR. Our policy is to redo typo changes to dissuade metric farming." +gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script." # Step 5: Close the original PR echo "Closing original PR #$ORIGINAL_PR_NUMBER" From b9f553ff96e545f63077fa81cb6963b93f85d8e4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:27:25 +0000 Subject: [PATCH 3/6] typo push --- scripts/redo-typo-pr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr index 08153ccf8d5..d21ea313120 100755 --- a/scripts/redo-typo-pr +++ b/scripts/redo-typo-pr @@ -5,7 +5,7 @@ set -eux # Configuration ORIGINAL_PR_NUMBER=$1 REPO='AztecProtocol/aztec-packages' -NEW_BRANCH="chore/typo-redo-$(date +%Y%m%d)" +NEW_BRANCH="chore/typo-redo-$ORIGINAL_PR_NUMBER" AUTHOR=`gh pr view $ORIGINAL_PR_NUMBER --json author --jq '.author.login'` # Step 1: Checkout the PR locally From c9bc5c0ae136f21dcce05801039ecea09c92516a Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:29:06 +0000 Subject: [PATCH 4/6] Give author --- scripts/redo-typo-pr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr index d21ea313120..c73b7b0420a 100755 --- a/scripts/redo-typo-pr +++ b/scripts/redo-typo-pr @@ -22,7 +22,7 @@ git push origin $NEW_BRANCH # Step 4: create a new pull request echo "Creating a new pull request for $NEW_BRANCH" -gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script." +gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR by $ORIGINAL_PR_AUTHOR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script." # Step 5: Close the original PR echo "Closing original PR #$ORIGINAL_PR_NUMBER" From 7fa80f35bea83b3c149bce5f8d9f2ff59c2a482f Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:30:42 +0000 Subject: [PATCH 5/6] redo commit with aztecbot --- scripts/redo-typo-pr | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr index c73b7b0420a..72b74ec5fc7 100755 --- a/scripts/redo-typo-pr +++ b/scripts/redo-typo-pr @@ -18,6 +18,7 @@ git checkout -b $NEW_BRANCH # Step 3: Push the new branch to GitHub echo "Pushing new branch $NEW_BRANCH to GitHub" +git commit --amend --author="AztecBot " --no-edit git push origin $NEW_BRANCH # Step 4: create a new pull request From 5b5c826c0edc909c68718dfe7c163c8a75d68645 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 22 Apr 2024 15:37:13 +0000 Subject: [PATCH 6/6] fix --- scripts/redo-typo-pr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/redo-typo-pr b/scripts/redo-typo-pr index 72b74ec5fc7..d265ade3f7b 100755 --- a/scripts/redo-typo-pr +++ b/scripts/redo-typo-pr @@ -23,7 +23,7 @@ git push origin $NEW_BRANCH # Step 4: create a new pull request echo "Creating a new pull request for $NEW_BRANCH" -gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR by $ORIGINAL_PR_AUTHOR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script." +gh pr create --base master --head $NEW_BRANCH --title "chore: redo typo PR by $AUTHOR" --body "Thanks $AUTHOR for https://github.com/$REPO/pull/$ORIGINAL_PR_NUMBER. Our policy is to redo typo changes to dissuade metric farming. This is an automated script." # Step 5: Close the original PR echo "Closing original PR #$ORIGINAL_PR_NUMBER"