From 5ab794349057dbb02711695238452a6b5011fb06 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 11 Apr 2024 12:31:22 -0400 Subject: [PATCH 1/2] fix: pull noir --- .github/workflows/pull_noir.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_noir.yml b/.github/workflows/pull_noir.yml index c2caab755eb..66f99ffd3b9 100644 --- a/.github/workflows/pull_noir.yml +++ b/.github/workflows/pull_noir.yml @@ -29,7 +29,11 @@ jobs: PR_URL=$(gh pr list --repo AztecProtocol/aztec-packages --head sync-noir --json url --jq ".[0].url") echo "PR_URL=$PR_URL" >> $GITHUB_ENV # What was our last merge on noir side? - BASE_NOIR_COMMIT=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json mergeCommit --jq=.[0].mergeCommit.oid` + # Detect our last sync commit (written by this action before pushing) with a fallback for the first time we ever do this + BASE_NOIR_COMMIT=$(curl https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/.noir-sync-commit) + if [ "$AZTEC_SYNC_COMMIT" = "404: Not Found" ] ; then + BASE_NOIR_COMMIT="50d2735825454a8638a308156d4ea23b3c4420d8" + fi echo "BASE_NOIR_COMMIT=$BASE_NOIR_COMMIT" >> $GITHUB_ENV # What was our last sync on aztec side? BASE_AZTEC_COMMIT=`curl https://raw.githubusercontent.com/noir-lang/noir/master/.aztec-sync-commit` @@ -88,6 +92,9 @@ jobs: # we need to commit for git-subrepo git commit -am "[$LINES changes] $COMMIT_MESSAGE" if ./scripts/git-subrepo/lib/git-subrepo pull --force $SUBREPO_PATH --branch=master; then + # Read our actual commit sync from git subrepo, stash to file for next time + COMMIT=$(git config --file="$SUBREPO_PATH/.gitrepo" subrepo.commit) + echo "$COMMIT" > .noir-sync-commit && git add .noir-sync-commit git reset --soft "$BASE_AZTEC_COMMIT" # We don't really need the sync commit on our side, and don't need .gitrepo at all except just in time for the command. git checkout origin/master -- noir/noir-repo/.aztec-sync-commit noir/noir-repo/.gitrepo @@ -114,7 +121,7 @@ jobs: - name: Update PR run: | set -xue # print commands - # Formatted for updating the PR, overrides for release-please commit message parsing + # Formatted for updating the PR, overrides for release-please commit message parsing PR_BODY=""" Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE From 9c4835edf2718acfd281a0f95469fcc7fc7f98b4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 11 Apr 2024 12:32:31 -0400 Subject: [PATCH 2/2] Update pull_noir.yml --- .github/workflows/pull_noir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_noir.yml b/.github/workflows/pull_noir.yml index 66f99ffd3b9..1b56629ad53 100644 --- a/.github/workflows/pull_noir.yml +++ b/.github/workflows/pull_noir.yml @@ -31,7 +31,7 @@ jobs: # What was our last merge on noir side? # Detect our last sync commit (written by this action before pushing) with a fallback for the first time we ever do this BASE_NOIR_COMMIT=$(curl https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/.noir-sync-commit) - if [ "$AZTEC_SYNC_COMMIT" = "404: Not Found" ] ; then + if [ "$BASE_NOIR_COMMIT" = "404: Not Found" ] ; then BASE_NOIR_COMMIT="50d2735825454a8638a308156d4ea23b3c4420d8" fi echo "BASE_NOIR_COMMIT=$BASE_NOIR_COMMIT" >> $GITHUB_ENV