From 1efc367655cbc88f37eff2bf07de280419fb4bcf Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 5 Mar 2024 17:19:21 -0500 Subject: [PATCH 1/4] Update mirror_noir_subrepo.yml --- .github/workflows/mirror_noir_subrepo.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 6538d3a50370..4769b5278550 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -35,6 +35,9 @@ jobs: # Do we have a PR active? PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV + # What was our last merge? + LAST_PR_MERGE=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` + echo "LAST_PR_MERGE=$LAST_PR_MERGE" >> $GITHUB_ENV - name: Generate PR body run: | @@ -73,9 +76,12 @@ jobs: # otherwise we first reset our staging branch STAGING_BRANCH=$BRANCH-staging fi - BASE_NOIR_COMMIT=`git config --file=$SUBREPO_PATH/.gitrepo subrepo.commit` - COMMIT=$(git rev-parse HEAD) + + BASE_NOIR_COMMIT="$LAST_PR_MERGE" + COMMIT=$(git rev-parse HEAD) COMMIT_MESSAGE=$(git log -1 --pretty=format:%B) + # Fix Aztec PR links and output message + COMMIT_MESSAGE=$(echo "$COMMIT_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-packages\/pull\/\1)/g') # clone noir repo for manipulations, we use aztec bot token for writeability git clone https://x-access-token:${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}@github.com/noir-lang/noir.git noir-repo From 397aac542ef07823bc12ef01d068ffb7f75e1016 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 5 Mar 2024 17:44:48 -0500 Subject: [PATCH 2/4] Update mirror_noir_subrepo.yml --- .github/workflows/mirror_noir_subrepo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 4769b5278550..b84362e3d8a4 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -36,7 +36,7 @@ jobs: PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV # What was our last merge? - LAST_PR_MERGE=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` + LAST_PR_MERGE=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json mergeCommit --jq=.[0].mergeCommit` echo "LAST_PR_MERGE=$LAST_PR_MERGE" >> $GITHUB_ENV - name: Generate PR body From c57036c76b8f84a6c8a4ea9b5fb657313dd6ac25 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 5 Mar 2024 17:46:14 -0500 Subject: [PATCH 3/4] Update mirror_noir_subrepo.yml --- .github/workflows/mirror_noir_subrepo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index b84362e3d8a4..5bfdd846cc6d 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -36,7 +36,7 @@ jobs: PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV # What was our last merge? - LAST_PR_MERGE=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json mergeCommit --jq=.[0].mergeCommit` + LAST_PR_MERGE=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json mergeCommit --jq=.[0].mergeCommit.oid` echo "LAST_PR_MERGE=$LAST_PR_MERGE" >> $GITHUB_ENV - name: Generate PR body From 1b76bd725d0ed0caafa011b37e7fd1208f68ecd7 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 5 Mar 2024 17:56:37 -0500 Subject: [PATCH 4/4] Update mirror_noir_subrepo.yml --- .github/workflows/mirror_noir_subrepo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 5bfdd846cc6d..651f2e231342 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -98,6 +98,8 @@ jobs: # force_sync_staging: Push to our aztec-packages staging branch. function force_sync_staging() { echo "$COMMIT" > $SUBREPO_PATH/.aztec-sync-commit && git add $SUBREPO_PATH/.aztec-sync-commit + # force gitrepo to point to the right HEAD (we ignore .gitrepo contents otherwise) + git config --file="$SUBREPO_PATH/.gitrepo" subrepo.commit "$BASE_NOIR_COMMIT" # make a new commit with our previous message git commit -am "$COMMIT_MESSAGE" # Now push to it with subrepo with computed commit messages