From 520e46c6a788a443b4118f3b6ca0af8b3ff7e7eb Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 27 Nov 2023 22:38:04 +0000 Subject: [PATCH] feat: first noir mirror --- .github/workflows/mirror_noir_subrepo.yml | 56 +++++++++++++++++++++++ noir/.gitrepo | 6 +-- noir/deny.toml | 1 + scripts/fix_subrepo_edge_case.sh | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/mirror_noir_subrepo.yml diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml new file mode 100644 index 000000000000..2f0524a1ce27 --- /dev/null +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -0,0 +1,56 @@ +# Mirror a special 'aztec' branch on noir any changes that have accumulated in aztec. +# Might fail if we have pushed changes to noir that we don't expect - in which case we need an explicit pull PR. +# See the last example of such a PR for instructions. +name: Mirror to noir repo + +on: + push: + branches: + - ad/sync-noir + paths: + - 'noir/**' + - '!noir/.gitrepo' + +jobs: + mirror_repo: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} + + # We push using git subrepo (https://github.com/ingydotnet/git-subrepo) + # with some logic to recover from squashed parent commits + # We push to subrepo, commit to master. The commit is needed + # to continue to replay. If we still hit issues such as this + # action failing due to upstream changes, a manual resolution + # PR with ./scripts/git_subrepo.sh pull will be needed. + - name: Push to branch + run: | + SUBREPO_PATH=noir + BRANCH=aztec + # identify ourselves, needed to commit + git config --global user.name AztecBot + git config --global user.email tech@aztecprotocol.com + if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=$BRANCH; then + git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" + git push + fi + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: noir-lang/noir + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + - name: Create PR for Aztec Branch + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} + pr_title: 'feat: aztec-packages' + pr_body: 'Change this to a description of the body of changes.' + destination_branch: 'master' + source_branch: 'aztec' diff --git a/noir/.gitrepo b/noir/.gitrepo index 9cded80286a4..6203c8d6afd6 100644 --- a/noir/.gitrepo +++ b/noir/.gitrepo @@ -4,9 +4,9 @@ ; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme ; [subrepo] - remote = git@github.com:noir-lang/noir + remote = https://github.com/noir-lang/noir branch = master commit = 90a63042d5b5eb2edf03378dff46ce75c9cb33ba - parent = 8f1cb832cd0adeff0da69da293bb45a3748583e7 - method = merge + parent = bef260888e9f3799543d5a76f5ba40d9b9e4db89 + method = pull cmdver = 0.4.6 diff --git a/noir/deny.toml b/noir/deny.toml index d9ffd4d37f0e..146d2fc2595b 100644 --- a/noir/deny.toml +++ b/noir/deny.toml @@ -8,6 +8,7 @@ unsound = "warn" yanked = "warn" notice = "warn" + # This section is considered when running `cargo deny check bans`. # More documentation about the 'bans' section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html diff --git a/scripts/fix_subrepo_edge_case.sh b/scripts/fix_subrepo_edge_case.sh index 6888875eaff6..bf0d1601e8bf 100755 --- a/scripts/fix_subrepo_edge_case.sh +++ b/scripts/fix_subrepo_edge_case.sh @@ -22,4 +22,4 @@ git config --file="$SUBREPO_PATH/.gitrepo" subrepo.parent $new_parent # Commit this change git add "$SUBREPO_PATH/.gitrepo" # This commit should only go into squashed PRs -git commit -m "git_subrepo.sh: Fix parent in .gitrepo file." +git commit -m "git_subrepo.sh: Fix parent in .gitrepo file. [skip ci]"