From c33d2f0dec13b6e1baa1150825b653cdcdad3ba9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 12 Feb 2024 14:14:55 +0000 Subject: [PATCH 1/6] fix: mirror_noir_subrepo.yml - accidentally unused step removed - fixes blank space typo preventing this check from kicking in --- .github/workflows/mirror_noir_subrepo.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 7d8cb1ed5b75..357d166bc39e 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -21,25 +21,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Get noir master's last sync commit - id: last_merge_hash - uses: actions/github-script@v7 - with: - script: | - // NOTE: more robust heuristic needed if aztecbot opens different kinds of PRs - const response = await github.rest.search.commits({ - q: 'author:AztecBot committer:web-flow repo:noir-lang/noir sort:committer-date' - }); - console.log(response.data.items); - return response.data.items[0].sha; - - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} - - name: Setup env run: | set -xue # print commands @@ -55,7 +42,7 @@ jobs: LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` # Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push) COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true) - if [[ " $COMMIT_HEURISTIC" = "" ]] ; then + if [[ "$COMMIT_HEURISTIC" = "" ]] ; then # It it fails, just use our gitrepo parent commit (last time we pushed or pulled) COMMIT_HEURISTIC=$BASE_AZTEC_COMMIT fi From 53d09bc03b6ea6d12e114ca8dfb555751a503b77 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 12 Feb 2024 14:15:59 +0000 Subject: [PATCH 2/6] REVERTME: test branch --- .github/workflows/mirror_noir_subrepo.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 357d166bc39e..32a7a5f21bf5 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -33,13 +33,13 @@ jobs: # Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" # Do we have a PR active? - PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") + PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-test-sync --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV # compute_commit_message: Create a filtered git log for release-please changelog / metadata function compute_commit_message() { # Get the last sync PR's last commit state - LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` + LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-test-sync --json headRefOid --jq=.[0].headRefOid` # Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push) COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true) if [[ "$COMMIT_HEURISTIC" = "" ]] ; then @@ -49,7 +49,7 @@ jobs: # Create a filtered git log for release-please changelog / metadata RAW_MESSAGE=$(git log --pretty=format:"%s" $COMMIT_HEURISTIC..HEAD -- noir/ ':!noir/.gitrepo' | grep -v 'git subrepo' || true) # Fix Aztec PR links and output message - echo "$RAW_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-packages\/pull\/\1)/g' + echo "$RAW_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-test-sync\/pull\/\1)/g' } echo "$(compute_commit_message)" >> .COMMIT_MESSAGE @@ -61,7 +61,7 @@ jobs: # Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" SUBREPO_PATH=noir - BRANCH=aztec-packages + BRANCH=aztec-test-sync if [[ "$PR_URL" == "" ]]; then # if no staging branch, we can overwrite STAGING_BRANCH=$BRANCH @@ -78,7 +78,7 @@ jobs: # 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 - # reset_pr: Reset aztec-packages staging. If no PR, this is the PR branch. + # reset_pr: Reset aztec-test-sync staging. If no PR, this is the PR branch. function reset_noir_staging_branch() { cd noir-repo git checkout $STAGING_BRANCH || git checkout -b $STAGING_BRANCH @@ -87,7 +87,7 @@ jobs: git push origin $STAGING_BRANCH --force cd .. } - # force_sync_staging: Push to our aztec-packages staging branch. + # force_sync_staging: Push to our aztec-test-sync staging branch. function force_sync_staging() { MESSAGE=$(cat .COMMIT_MESSAGE) git commit --allow-empty -m"chore: Sync to noir-lang/noir" -m"$MESSAGE" @@ -102,7 +102,7 @@ jobs: exit 1 fi } - # merge_staging_branch: Merge our staging branch into aztec-packages. + # merge_staging_branch: Merge our staging branch into aztec-test-sync. function merge_staging_branch() { # Fix PR branch cd noir-repo @@ -129,7 +129,7 @@ jobs: # for cross-opening PR in noir repo, we use aztecbot's token export GH_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} if [[ "$PR_URL" == "" ]]; then - gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-packages" --body "$PR_BODY" --base master --head aztec-packages + gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-test-sync" --body "$PR_BODY" --base master --head aztec-test-sync else gh pr edit "$PR_URL" --body "$PR_BODY" fi From dc92b268129179d4ea4bdf8b699adccbf0035508 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 12 Feb 2024 14:21:31 +0000 Subject: [PATCH 3/6] fix: mirror subrepo --- .github/workflows/mirror_noir_subrepo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 32a7a5f21bf5..f7bd41f74cf5 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -42,6 +42,7 @@ jobs: LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-test-sync --json headRefOid --jq=.[0].headRefOid` # Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push) COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true) + BASE_AZTEC_COMMIT=`git config --file=noir/.gitrepo subrepo.parent` if [[ "$COMMIT_HEURISTIC" = "" ]] ; then # It it fails, just use our gitrepo parent commit (last time we pushed or pulled) COMMIT_HEURISTIC=$BASE_AZTEC_COMMIT From ad506dbd390370cb62d2971496d128de51467816 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Mon, 12 Feb 2024 14:23:18 +0000 Subject: [PATCH 4/6] chore: Sync to noir-lang/noir chore: Pull noir (https://github.com/AztecProtocol/aztec-test-sync/pull/4546) feat: Added cast opcode and cast calldata (https://github.com/AztecProtocol/aztec-test-sync/pull/4423) refactor: cleanup of `abi.nr` in `aztec-nr` (https://github.com/AztecProtocol/aztec-test-sync/pull/4473) [skip ci] --- noir/.gitrepo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noir/.gitrepo b/noir/.gitrepo index f8b66efc1198..b33dde1c465a 100644 --- a/noir/.gitrepo +++ b/noir/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/noir-lang/noir - branch = aztec-packages - commit = 6ff518af281afe601edb8574d425b07d9d2f9c5d - parent = 2082fedfb03d4882a269881f51c5337263bc539b + branch = aztec-test-sync + commit = be6ae018e484621f7a0743df5951f8ef0a45af98 + parent = ac87124e8fbb756cc34180a174011e33bfe19217 method = merge cmdver = 0.4.6 From c774cbda9e7495e28f96ff2fd695dfdaaebe8118 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 12 Feb 2024 14:24:55 +0000 Subject: [PATCH 5/6] revert the test branch name --- .github/workflows/mirror_noir_subrepo.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index f7bd41f74cf5..2c8174675c52 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -33,13 +33,13 @@ jobs: # Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" # Do we have a PR active? - PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-test-sync --json url --jq ".[0].url") + PR_URL=$(gh pr list --repo noir-lang/noir --head aztec-packages --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV # compute_commit_message: Create a filtered git log for release-please changelog / metadata function compute_commit_message() { # Get the last sync PR's last commit state - LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-test-sync --json headRefOid --jq=.[0].headRefOid` + LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` # Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push) COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true) BASE_AZTEC_COMMIT=`git config --file=noir/.gitrepo subrepo.parent` @@ -50,7 +50,7 @@ jobs: # Create a filtered git log for release-please changelog / metadata RAW_MESSAGE=$(git log --pretty=format:"%s" $COMMIT_HEURISTIC..HEAD -- noir/ ':!noir/.gitrepo' | grep -v 'git subrepo' || true) # Fix Aztec PR links and output message - echo "$RAW_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-test-sync\/pull\/\1)/g' + echo "$RAW_MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-packages\/pull\/\1)/g' } echo "$(compute_commit_message)" >> .COMMIT_MESSAGE @@ -62,7 +62,7 @@ jobs: # Enable gh executable. We spread out the API requests between the github actions bot token, and aztecbot export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" SUBREPO_PATH=noir - BRANCH=aztec-test-sync + BRANCH=aztec-packages if [[ "$PR_URL" == "" ]]; then # if no staging branch, we can overwrite STAGING_BRANCH=$BRANCH @@ -79,7 +79,7 @@ jobs: # 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 - # reset_pr: Reset aztec-test-sync staging. If no PR, this is the PR branch. + # reset_pr: Reset aztec-packages staging. If no PR, this is the PR branch. function reset_noir_staging_branch() { cd noir-repo git checkout $STAGING_BRANCH || git checkout -b $STAGING_BRANCH @@ -88,7 +88,7 @@ jobs: git push origin $STAGING_BRANCH --force cd .. } - # force_sync_staging: Push to our aztec-test-sync staging branch. + # force_sync_staging: Push to our aztec-packages staging branch. function force_sync_staging() { MESSAGE=$(cat .COMMIT_MESSAGE) git commit --allow-empty -m"chore: Sync to noir-lang/noir" -m"$MESSAGE" @@ -103,7 +103,7 @@ jobs: exit 1 fi } - # merge_staging_branch: Merge our staging branch into aztec-test-sync. + # merge_staging_branch: Merge our staging branch into aztec-packages. function merge_staging_branch() { # Fix PR branch cd noir-repo @@ -130,7 +130,7 @@ jobs: # for cross-opening PR in noir repo, we use aztecbot's token export GH_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} if [[ "$PR_URL" == "" ]]; then - gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-test-sync" --body "$PR_BODY" --base master --head aztec-test-sync + gh pr create --repo noir-lang/noir --title "feat: Sync from aztec-packages" --body "$PR_BODY" --base master --head aztec-packages else gh pr edit "$PR_URL" --body "$PR_BODY" fi From 1fd3f7c8777e5f929561306796ec128395296d5c Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 12 Feb 2024 14:26:20 +0000 Subject: [PATCH 6/6] revert noir sync --- noir/.gitrepo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noir/.gitrepo b/noir/.gitrepo index b33dde1c465a..f8b66efc1198 100644 --- a/noir/.gitrepo +++ b/noir/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/noir-lang/noir - branch = aztec-test-sync - commit = be6ae018e484621f7a0743df5951f8ef0a45af98 - parent = ac87124e8fbb756cc34180a174011e33bfe19217 + branch = aztec-packages + commit = 6ff518af281afe601edb8574d425b07d9d2f9c5d + parent = 2082fedfb03d4882a269881f51c5337263bc539b method = merge cmdver = 0.4.6