From fa795fb74a5e459e95dcb2e6e2206aadc60dace8 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 11:51:40 +0100 Subject: [PATCH 01/20] make debug easier --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5252a0f98d..2d0f8ade94 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -362,7 +362,8 @@ jobs: - uses: jwalton/gh-find-current-pr@v1 id: find_pr # TODO: https://stackoverflow.com/a/75429845 consider splitting w/ gql to reduce limit hit - - run: | + - name: Fetch Metadata for ${steps.find_pr.outputs.pr} + run: | # Fetch the metadata metadata="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER)" From 431e962826c5b15dcb0137036fd4d416a4a92f1a Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:17:59 +0100 Subject: [PATCH 02/20] fix --- .github/workflows/go.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2d0f8ade94..6a420d6741 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -353,16 +353,14 @@ jobs: needs: cancel-outdated # currently, this matches the logic in the go generate check. If we ever add more checks that run on all packages, we should # change this to run on those pushes - if: ${{ github.event_name != 'pull_request' && format('refs/heads/{0}', github.event.repository.default_branch) != github.ref }} + if: ${{ github.event_name != 'push' && format('refs/heads/{0}', github.event.repository.default_branch) != github.ref }} outputs: issue_number: ${{ steps.find_pr.outputs.pr }} metadata: ${{ steps.metadata.outputs.METADATA }} labels: ${{ steps.metadata.outputs.LABELS }} steps: - - uses: jwalton/gh-find-current-pr@v1 - id: find_pr # TODO: https://stackoverflow.com/a/75429845 consider splitting w/ gql to reduce limit hit - - name: Fetch Metadata for ${steps.find_pr.outputs.pr} + - name: Fetch Metadata for ${{github.event.number}} run: | # Fetch the metadata metadata="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER)" @@ -381,7 +379,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OWNER: ${{ github.repository_owner }} REPO_NAME: ${{ github.event.repository.name }} - PULL_REQUEST_NUMBER: ${{ steps.find_pr.outputs.pr }} + PULL_REQUEST_NUMBER: ${{github.event.number}} # check if we need to rerun go generate as a result of solidity changes. Note, this will only run on solidity changes. # TODO: consolidate w/ go change check. This will run twice on agents @@ -389,7 +387,7 @@ jobs: name: Go Generate (Solidity Only) runs-on: ubuntu-latest needs: [changes, pr_metadata] - if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.solidity_changes == 'true' }} + if: ${{ github.event_name != 'push' && needs.changes.outputs.solidity_changes == 'true' }} strategy: fail-fast: false matrix: @@ -477,7 +475,7 @@ jobs: with: add-labels: 'needs-go-generate-${{matrix.package}}' repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.pr_metadata.outputs.issue_number }} + issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} @@ -485,13 +483,13 @@ jobs: with: remove-labels: 'needs-go-generate-${{matrix.package}}' repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.pr_metadata.outputs.issue_number }} + issue-number: ${{github.event.number}} remove-label-generation: name: Remove Generate Label From Unused Jobs runs-on: ubuntu-latest needs: [changes, pr_metadata] - if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.unchanged_package_count_deps > 0 && contains(needs.pr_metadata.outputs.labels, 'needs-go-generate') }} + if: ${{ github.event_name != 'push' && needs.changes.outputs.unchanged_package_count_deps > 0 && contains(needs.pr_metadata.outputs.labels, 'needs-go-generate') }} strategy: fail-fast: false max-parallel: 1 @@ -506,7 +504,7 @@ jobs: with: remove-labels: 'needs-go-generate-${{matrix.package}}' repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.pr_metadata.outputs.issue_number }} + issue-number: ${{github.event.number}} @@ -514,7 +512,7 @@ jobs: name: Go Generate (Module Changes) runs-on: ubuntu-latest needs: [changes, pr_metadata] - if: ${{ github.event_name != 'pull_request' && needs.changes.outputs.package_count_deps > 0 }} + if: ${{ github.event_name != 'push' && needs.changes.outputs.package_count_deps > 0 }} strategy: fail-fast: false matrix: @@ -640,7 +638,7 @@ jobs: with: add-labels: 'needs-go-generate-${{matrix.package}}' repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.pr_metadata.outputs.issue_number }} + issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} @@ -648,4 +646,4 @@ jobs: with: remove-labels: 'needs-go-generate-${{matrix.package}}' repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.pr_metadata.outputs.issue_number }} + issue-number: ${{github.event.number}} From b26a708de173711e51c29199e480c75054ec3ce9 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:18:26 +0100 Subject: [PATCH 03/20] devnet goreleaser --- tools/.goreleaser.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/.goreleaser.yml b/tools/.goreleaser.yml index 56b547a7fc..63c6744b21 100644 --- a/tools/.goreleaser.yml +++ b/tools/.goreleaser.yml @@ -75,6 +75,26 @@ builds: - linux goarch: - amd64 + + - id: devnet-amd64 + binary: devnet-amd64 + env: + # probably not neccesary for this module + - CGO_CFLAGS=-I/usr/local/include + - CGO_ENABLED=1 + - CGO_LDFLAGS=-L/usr/local/lib -lrocksdb -lstdc++ -lm -lz -lsnappy -lzstd -lbz2 + # see: https://github.com/cosmos/iavl/pull/465/files + ldflags: + - -s -w + main: devnet/main.go + flags: + - -tags=builtin_static,rocksdb,static # probably not neccesary for this module + goos: + - linux + goarch: + - amd64 + + # add a source archive at release time source: enabled: true From b9901d23c62cda8e43cb7b14efbdd88894e3cf72 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:18:29 +0100 Subject: [PATCH 04/20] Revert "devnet goreleaser" This reverts commit b26a708de173711e51c29199e480c75054ec3ce9. --- tools/.goreleaser.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tools/.goreleaser.yml b/tools/.goreleaser.yml index 63c6744b21..56b547a7fc 100644 --- a/tools/.goreleaser.yml +++ b/tools/.goreleaser.yml @@ -75,26 +75,6 @@ builds: - linux goarch: - amd64 - - - id: devnet-amd64 - binary: devnet-amd64 - env: - # probably not neccesary for this module - - CGO_CFLAGS=-I/usr/local/include - - CGO_ENABLED=1 - - CGO_LDFLAGS=-L/usr/local/lib -lrocksdb -lstdc++ -lm -lz -lsnappy -lzstd -lbz2 - # see: https://github.com/cosmos/iavl/pull/465/files - ldflags: - - -s -w - main: devnet/main.go - flags: - - -tags=builtin_static,rocksdb,static # probably not neccesary for this module - goos: - - linux - goarch: - - amd64 - - # add a source archive at release time source: enabled: true From f8588cb7550420a663ad64a23c6ac39afe63d5f7 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:38:51 +0100 Subject: [PATCH 05/20] add composite action --- .github/actions/add-label/README.md | 5 ++++ .github/actions/add-label/action.yml | 43 ++++++++++++++++++++++++++++ .github/workflows/go.yml | 10 +++++-- 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/actions/add-label/README.md create mode 100644 .github/actions/add-label/action.yml diff --git a/.github/actions/add-label/README.md b/.github/actions/add-label/README.md new file mode 100644 index 0000000000..e87d2cb086 --- /dev/null +++ b/.github/actions/add-label/README.md @@ -0,0 +1,5 @@ +## Add Label + +## Inputs +* `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) +* diff --git a/.github/actions/add-label/action.yml b/.github/actions/add-label/action.yml new file mode 100644 index 0000000000..769b9814bf --- /dev/null +++ b/.github/actions/add-label/action.yml @@ -0,0 +1,43 @@ +name: Add Label +description: Add a label to the issue or pull request +inputs: + issue_number: + description: 'The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action.' + required: false + default: '' + label: + description: 'The label to add.' + required: true + +runs: + using: "composite" + steps: + - name: Resolve issue number + id: resolve_issue_number + run: | + if [[ -n "${{ inputs.issue_number }}" ]]; then + echo "Using input issue number: ${{ inputs.issue_number }}" + echo "::set-output name=issue::${{ inputs.issue_number }}" + elif [[ -n "${{ github.event.number }}" ]]; then + echo "Using event number: ${{ github.event.number }}" + echo "::set-output name=issue::${{ github.event.number }}" + elif [[ -n "${{ github.event.issue.number }}" ]]; then + echo "Using event issue number: ${{ github.event.issue.number }}" + echo "::set-output name=issue::${{ github.event.issue.number }}" + else + echo "Could not determine issue number" + exit 1 + fi + shell: bash + + - name: Add Label + uses: actions/github-script@v6 + if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} + with: + script: | + github.rest.issues.addLabels({ + issue_number: ${{ steps.resolve_issue_number.outputs.issue }}, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["${{ inputs.label }}"] + }) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6a420d6741..80927e4997 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -471,11 +471,15 @@ jobs: # TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow - name: Add Label if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + uses: ./actions/add-label with: - add-labels: 'needs-go-generate-${{matrix.package}}' - repo-token: ${{ secrets.GITHUB_TOKEN }} + label: 'needs-go-generate-${{matrix.package}}' issue-number: ${{github.event.number}} +# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 +# with: +# add-labels: 'needs-go-generate-${{matrix.package}}' +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} From 5ce64d2f3a8aff8ebb50eb6a44c0faeeefde8186 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:39:31 +0100 Subject: [PATCH 06/20] test composite action from f8588cb75 by changing --- core/go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/core/go.mod b/core/go.mod index c60d1ea638..37767f2d61 100644 --- a/core/go.mod +++ b/core/go.mod @@ -23,6 +23,7 @@ require ( github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.1 + github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc github.com/ipfs/go-log v1.0.5 github.com/jpillora/backoff v1.0.0 From d13549c3e470a5b02556b7a54d908aa2813bb7e5 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:41:55 +0100 Subject: [PATCH 07/20] remove needs copied from #1465 --- .github/actions/add-label/action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/add-label/action.yml b/.github/actions/add-label/action.yml index 769b9814bf..310b2ce7a4 100644 --- a/.github/actions/add-label/action.yml +++ b/.github/actions/add-label/action.yml @@ -2,11 +2,11 @@ name: Add Label description: Add a label to the issue or pull request inputs: issue_number: - description: 'The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action.' + description: "The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action." required: false - default: '' + default: "" label: - description: 'The label to add.' + description: "The label to add." required: true runs: @@ -32,7 +32,6 @@ runs: - name: Add Label uses: actions/github-script@v6 - if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} with: script: | github.rest.issues.addLabels({ From e2cc44346ea68ec6aff8eecbc4a72d287eee744b Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:48:32 +0100 Subject: [PATCH 08/20] fix quoting issue introduced in f8588cb7550420a663ad64a23c6ac39afe63d5f7 --- .github/actions/add-label/action.yml | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/actions/add-label/action.yml b/.github/actions/add-label/action.yml index 310b2ce7a4..d46b9cacec 100644 --- a/.github/actions/add-label/action.yml +++ b/.github/actions/add-label/action.yml @@ -2,30 +2,30 @@ name: Add Label description: Add a label to the issue or pull request inputs: issue_number: - description: "The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action." + description: 'The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action.' required: false - default: "" + default: '' label: - description: "The label to add." + description: 'The label to add.' required: true runs: - using: "composite" + using: 'composite' steps: - name: Resolve issue number id: resolve_issue_number run: | - if [[ -n "${{ inputs.issue_number }}" ]]; then - echo "Using input issue number: ${{ inputs.issue_number }}" - echo "::set-output name=issue::${{ inputs.issue_number }}" - elif [[ -n "${{ github.event.number }}" ]]; then - echo "Using event number: ${{ github.event.number }}" - echo "::set-output name=issue::${{ github.event.number }}" - elif [[ -n "${{ github.event.issue.number }}" ]]; then - echo "Using event issue number: ${{ github.event.issue.number }}" - echo "::set-output name=issue::${{ github.event.issue.number }}" + if [[ -n '${{ inputs.issue_number }}' ]]; then + echo 'Using input issue number: ${{ inputs.issue_number }}' + echo '::set-output name=issue::${{ inputs.issue_number }}' + elif [[ -n '${{ github.event.number }}' ]]; then + echo 'Using event number: ${{ github.event.number }}' + echo '::set-output name=issue::${{ github.event.number }}' + elif [[ -n '${{ github.event.issue.number }}' ]]; then + echo 'Using event issue number: ${{ github.event.issue.number }}' + echo '::set-output name=issue::${{ github.event.issue.number }}' else - echo "Could not determine issue number" + echo 'Could not determine issue number' exit 1 fi shell: bash @@ -38,5 +38,5 @@ runs: issue_number: ${{ steps.resolve_issue_number.outputs.issue }}, owner: context.repo.owner, repo: context.repo.repo, - labels: ["${{ inputs.label }}"] + labels: ['${{ inputs.label }}'] }) From 1211823e4d836dec8cfc764f333c11732307adac Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:49:34 +0100 Subject: [PATCH 09/20] Revert "test composite action from f8588cb75 by changing" (this didn't test anything because needs-go-generate doesn't run go mod tidy) This reverts commit 5ce64d2f3a8aff8ebb50eb6a44c0faeeefde8186. --- core/go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/core/go.mod b/core/go.mod index 37767f2d61..c60d1ea638 100644 --- a/core/go.mod +++ b/core/go.mod @@ -23,7 +23,6 @@ require ( github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.1 - github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc github.com/ipfs/go-log v1.0.5 github.com/jpillora/backoff v1.0.0 From 558efd0fb54cb8a678ed25c4eef52cc170239bfc Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 12:50:49 +0100 Subject: [PATCH 10/20] modify `core/processlog/readertype_string.go` to test f8588cb7550420a663ad64a23c6ac39afe63d5f7 --- core/processlog/readertype_string.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/processlog/readertype_string.go b/core/processlog/readertype_string.go index d4f5c6db2f..ad6feadfc3 100644 --- a/core/processlog/readertype_string.go +++ b/core/processlog/readertype_string.go @@ -2,6 +2,7 @@ package processlog + import "strconv" func _() { From 1b218248a54b99b692c91c0f2c6853d5a67cb777 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 13:04:29 +0100 Subject: [PATCH 11/20] retest addition w/ labels removed --- .github/actions/add-label/README.md | 2 +- .github/actions/add-label/action.yml | 1 + .github/actions/remove-label/README.md | 5 +++ .github/actions/remove-label/action.yml | 43 +++++++++++++++++++++++++ .github/workflows/go.yml | 5 ++- 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 .github/actions/remove-label/README.md create mode 100644 .github/actions/remove-label/action.yml diff --git a/.github/actions/add-label/README.md b/.github/actions/add-label/README.md index e87d2cb086..4a3250272b 100644 --- a/.github/actions/add-label/README.md +++ b/.github/actions/add-label/README.md @@ -2,4 +2,4 @@ ## Inputs * `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) -* +* `label`: The label to add to the issue diff --git a/.github/actions/add-label/action.yml b/.github/actions/add-label/action.yml index d46b9cacec..d9503ff11e 100644 --- a/.github/actions/add-label/action.yml +++ b/.github/actions/add-label/action.yml @@ -12,6 +12,7 @@ inputs: runs: using: 'composite' steps: + # # TODO, dedupe w/ remove-label - name: Resolve issue number id: resolve_issue_number run: | diff --git a/.github/actions/remove-label/README.md b/.github/actions/remove-label/README.md new file mode 100644 index 0000000000..4a3250272b --- /dev/null +++ b/.github/actions/remove-label/README.md @@ -0,0 +1,5 @@ +## Add Label + +## Inputs +* `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) +* `label`: The label to add to the issue diff --git a/.github/actions/remove-label/action.yml b/.github/actions/remove-label/action.yml new file mode 100644 index 0000000000..37449c34ed --- /dev/null +++ b/.github/actions/remove-label/action.yml @@ -0,0 +1,43 @@ +name: Add Label +description: Add a label to the issue or pull request +inputs: + issue_number: + description: 'The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action.' + required: false + default: '' + label: + description: 'The label to add.' + required: true + +runs: + using: 'composite' + steps: + # TODO, dedupe w/ add-label + - name: Resolve issue number + id: resolve_issue_number + run: | + if [[ -n '${{ inputs.issue_number }}' ]]; then + echo 'Using input issue number: ${{ inputs.issue_number }}' + echo '::set-output name=issue::${{ inputs.issue_number }}' + elif [[ -n '${{ github.event.number }}' ]]; then + echo 'Using event number: ${{ github.event.number }}' + echo '::set-output name=issue::${{ github.event.number }}' + elif [[ -n '${{ github.event.issue.number }}' ]]; then + echo 'Using event issue number: ${{ github.event.issue.number }}' + echo '::set-output name=issue::${{ github.event.issue.number }}' + else + echo 'Could not determine issue number' + exit 1 + fi + shell: bash + + - name: Remove Label + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.removeLabel({ + issue_number: ${{ steps.resolve_issue_number.outputs.issue }}, + owner: context.repo.owner, + repo: context.repo.repo, + name: ['${{ inputs.label }}'] + }) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 80927e4997..67642dce4b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -638,10 +638,9 @@ jobs: # TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow - name: Add Label if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + uses: ./actions/add-label with: - add-labels: 'needs-go-generate-${{matrix.package}}' - repo-token: ${{ secrets.GITHUB_TOKEN }} + label: 'needs-go-generate-${{matrix.package}}' issue-number: ${{github.event.number}} - name: Remove Label From 7367c57866b111bcfc2e9a17841af9d97ca9565b Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 13:11:12 +0100 Subject: [PATCH 12/20] fix bug in 1b218248a54b99b692c91c0f2c6853d5a67cb777 to re-add https://github.com/synapsecns/sanguine/pull/1466#event-10723630165 --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 67642dce4b..588c7959d1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -471,7 +471,7 @@ jobs: # TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow - name: Add Label if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} - uses: ./actions/add-label + uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' issue-number: ${{github.event.number}} @@ -638,7 +638,7 @@ jobs: # TODO: this can run into a bit of a race condition if any other label is removed/added while this is run, look into fixing this by dispatching another workflow - name: Add Label if: ${{ !contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed == 'true' }} - uses: ./actions/add-label + uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' issue-number: ${{github.event.number}} From 153657b9f348e3984324caa2b82100dfb0d862ae Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 13:17:04 +0100 Subject: [PATCH 13/20] try remove --- .github/actions/add-label/README.md | 11 +++++++++ .github/workflows/go.yml | 36 +++++++++++++++++------------ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/actions/add-label/README.md b/.github/actions/add-label/README.md index 4a3250272b..01faaf1498 100644 --- a/.github/actions/add-label/README.md +++ b/.github/actions/add-label/README.md @@ -3,3 +3,14 @@ ## Inputs * `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) * `label`: The label to add to the issue + + +## Usage: + +```yaml + - name: Add Label + uses: ./.github/actions/add-label + with: + label: 'needs-go-generate-${{matrix.package}}' + issue-number: ${{github.event.number}} +``` diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 588c7959d1..cec4b07879 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -474,7 +474,7 @@ jobs: uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' - issue-number: ${{github.event.number}} +# issue-number: ${{github.event.number}} # uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 # with: # add-labels: 'needs-go-generate-${{matrix.package}}' @@ -483,11 +483,11 @@ jobs: - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + uses: ./.github/actions/remove-label with: - remove-labels: 'needs-go-generate-${{matrix.package}}' - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{github.event.number}} + label: 'needs-go-generate-${{matrix.package}}' +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# issue-number: ${{github.event.number}} remove-label-generation: name: Remove Generate Label From Unused Jobs @@ -503,12 +503,15 @@ jobs: steps: - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) }} - # labels can't be removed in parallel - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + + uses: ./.github/actions/remove-label with: - remove-labels: 'needs-go-generate-${{matrix.package}}' - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{github.event.number}} + label: 'needs-go-generate-${{matrix.package}}' +# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 +# with: +# remove-labels: 'needs-go-generate-${{matrix.package}}' +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# issue-number: ${{github.event.number}} @@ -641,12 +644,15 @@ jobs: uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' - issue-number: ${{github.event.number}} +# issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + uses: ./.github/actions/remove-label with: - remove-labels: 'needs-go-generate-${{matrix.package}}' - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{github.event.number}} + label: 'needs-go-generate-${{matrix.package}}' +# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 +# with: +# remove-labels: 'needs-go-generate-${{matrix.package}}' +# repo-token: ${{ secrets.GITHUB_TOKEN }} +# issue-number: ${{github.event.number}} From c83cdd42c1b9f16b4a0a1c9f1811d953048453bb Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 13:18:02 +0100 Subject: [PATCH 14/20] undo generate in core (should try to remove labels) fore core, but not agents because of tob fixes --- .github/actions/remove-label/README.md | 9 +++++++++ core/processlog/readertype_string.go | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/remove-label/README.md b/.github/actions/remove-label/README.md index 4a3250272b..612468677e 100644 --- a/.github/actions/remove-label/README.md +++ b/.github/actions/remove-label/README.md @@ -3,3 +3,12 @@ ## Inputs * `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) * `label`: The label to add to the issue + + +```yaml + - name: Remove Label + uses: ./.github/actions/remove-label + with: + label: 'needs-go-generate-${{matrix.package}}' + issue-number: ${{github.event.number}} +``` diff --git a/core/processlog/readertype_string.go b/core/processlog/readertype_string.go index ad6feadfc3..d4f5c6db2f 100644 --- a/core/processlog/readertype_string.go +++ b/core/processlog/readertype_string.go @@ -2,7 +2,6 @@ package processlog - import "strconv" func _() { From 496a219e6bf3f196551028fee1611c1b29da6783 Mon Sep 17 00:00:00 2001 From: trajan0x <83933037+trajan0x@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:30:39 -0400 Subject: [PATCH 15/20] Remove Max Paralell (#1468) Co-authored-by: Trajan0x --- .github/workflows/go.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cec4b07879..79e7625109 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -496,14 +496,18 @@ jobs: if: ${{ github.event_name != 'push' && needs.changes.outputs.unchanged_package_count_deps > 0 && contains(needs.pr_metadata.outputs.labels, 'needs-go-generate') }} strategy: fail-fast: false - max-parallel: 1 +# max-parallel: 1 matrix: # only do on agents for now. Anything that relies on solidity in a package should do this package: ${{ fromJSON(needs.changes.outputs.unchanged_deps) }} steps: + # needed for remove label action + - uses: actions/checkout@v4 + if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) }} + with: + fetch-depth: 1 - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) }} - uses: ./.github/actions/remove-label with: label: 'needs-go-generate-${{matrix.package}}' From 8409ab14281a765946e4358eb0a4449b9a10d7f8 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 13:33:14 +0100 Subject: [PATCH 16/20] more reverts --- .github/workflows/go.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cec4b07879..971032cfa7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -474,20 +474,12 @@ jobs: uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' -# issue-number: ${{github.event.number}} -# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 -# with: -# add-labels: 'needs-go-generate-${{matrix.package}}' -# repo-token: ${{ secrets.GITHUB_TOKEN }} -# issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} uses: ./.github/actions/remove-label with: label: 'needs-go-generate-${{matrix.package}}' -# repo-token: ${{ secrets.GITHUB_TOKEN }} -# issue-number: ${{github.event.number}} remove-label-generation: name: Remove Generate Label From Unused Jobs @@ -496,23 +488,20 @@ jobs: if: ${{ github.event_name != 'push' && needs.changes.outputs.unchanged_package_count_deps > 0 && contains(needs.pr_metadata.outputs.labels, 'needs-go-generate') }} strategy: fail-fast: false - max-parallel: 1 matrix: # only do on agents for now. Anything that relies on solidity in a package should do this package: ${{ fromJSON(needs.changes.outputs.unchanged_deps) }} steps: + # needed for remove label action + - uses: actions/checkout@v4 + if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) }} + with: + fetch-depth: 1 - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) }} - uses: ./.github/actions/remove-label with: label: 'needs-go-generate-${{matrix.package}}' -# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 -# with: -# remove-labels: 'needs-go-generate-${{matrix.package}}' -# repo-token: ${{ secrets.GITHUB_TOKEN }} -# issue-number: ${{github.event.number}} - check-generation: @@ -644,15 +633,9 @@ jobs: uses: ./.github/actions/add-label with: label: 'needs-go-generate-${{matrix.package}}' -# issue-number: ${{github.event.number}} - name: Remove Label if: ${{ contains(fromJson(needs.pr_metadata.outputs.labels), format('needs-go-generate-{0}', matrix.package)) && steps.verify-changed-files.outputs.files_changed != 'true' }} uses: ./.github/actions/remove-label with: label: 'needs-go-generate-${{matrix.package}}' -# uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 -# with: -# remove-labels: 'needs-go-generate-${{matrix.package}}' -# repo-token: ${{ secrets.GITHUB_TOKEN }} -# issue-number: ${{github.event.number}} From 3ffaef2464b2815d39447dafdfd09b90a30e2aec Mon Sep 17 00:00:00 2001 From: trajan0x <83933037+trajan0x@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:15:31 -0400 Subject: [PATCH 17/20] Test/yarn fix (#1469) * try to fix yarn install time * yarn workflow mod * undo me (modified sdk-router yarn.lock, used to test #1466) * ignore me * Revert "ignore me" This reverts commit 6ae9e607265eede56877c3be6319ea0523310d81. * fix spelling issue, try again * yarnrc fix * undo me * Revert "undo me" (Test warm cache) This reverts commit 032e1e74379e3922ae35cb16f98b730cba14ea5f. --------- Co-authored-by: Trajan0x --- .github/actions/setup-nodejs/action.yml | 5 +++++ .github/workflows/packages.yml | 16 ++++++---------- packages/sdk-router/yarn.lock | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-nodejs/action.yml b/.github/actions/setup-nodejs/action.yml index bbf20ef3c3..f7bce16077 100644 --- a/.github/actions/setup-nodejs/action.yml +++ b/.github/actions/setup-nodejs/action.yml @@ -23,6 +23,11 @@ runs: shell: bash id: nvmrc + - name: Setup Globals + shell: bash + run: | + echo "enableGlobalCache true" >> ~/.yarnrc + - uses: actions/setup-node@v3 with: node-version: '${{ steps.nvmrc.outputs.NVMRC }}' diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 1441c3045c..e633e5f962 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -60,20 +60,16 @@ jobs: yarn.lock - name: Add Label - if: steps.verify-yarn-lock.outputs.files_changed == 'true' - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + if: ${{ steps.verify-yarn-lock.outputs.files_changed == 'true' && github.event_name != 'push' }} + uses: ./.github/actions/add-label with: - add-labels: 'needs-yarn-install' - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.issue_number.outputs.issue_number }} + label: 'needs-yarn-install' - name: Remove Label - if: steps.verify-yarn-lock.outputs.files_changed != 'true' - uses: andymckay/labeler@3a4296e9dcdf9576b0456050db78cfd34853f260 + if: ${{ steps.verify-yarn-lock.outputs.files_changed != 'true' && github.event_name != 'push' }} + uses: ./.github/actions/add-label with: - remove-labels: 'needs-yarn-install' - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ needs.issue_number.outputs.issue_number }} + label: 'needs-yarn-install' - name: Run tests # Run tests of all packages diff --git a/packages/sdk-router/yarn.lock b/packages/sdk-router/yarn.lock index e582d37482..8be51ce789 100644 --- a/packages/sdk-router/yarn.lock +++ b/packages/sdk-router/yarn.lock @@ -1,3 +1,4 @@ + # This file is generated by running "yarn install" inside your project. # Manual changes might be lost - proceed with caution! From f8564517afecc65baf7c7aa352077753f6b03b5a Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 14:17:01 +0100 Subject: [PATCH 18/20] undo test from #1469 --- packages/sdk-router/yarn.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/sdk-router/yarn.lock b/packages/sdk-router/yarn.lock index 8be51ce789..e582d37482 100644 --- a/packages/sdk-router/yarn.lock +++ b/packages/sdk-router/yarn.lock @@ -1,4 +1,3 @@ - # This file is generated by running "yarn install" inside your project. # Manual changes might be lost - proceed with caution! From 18f6ed19bad513b9cdcaf73051d570c6df49b094 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 14:19:44 +0100 Subject: [PATCH 19/20] description fix --- .github/actions/remove-label/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/remove-label/action.yml b/.github/actions/remove-label/action.yml index 37449c34ed..9b5ec0c653 100644 --- a/.github/actions/remove-label/action.yml +++ b/.github/actions/remove-label/action.yml @@ -1,5 +1,5 @@ -name: Add Label -description: Add a label to the issue or pull request +name: Remove Label +description: Remove a label to the issue or pull request inputs: issue_number: description: 'The issue number to associate with. Defaults to the current issue or pull request number used to trigger the action.' From 74e225a9ba713cef5d12b699212ef2c9949c7d20 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Fri, 20 Oct 2023 14:20:33 +0100 Subject: [PATCH 20/20] fix --- .github/actions/add-label/README.md | 2 ++ .github/actions/remove-label/README.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/add-label/README.md b/.github/actions/add-label/README.md index 01faaf1498..b497acbcba 100644 --- a/.github/actions/add-label/README.md +++ b/.github/actions/add-label/README.md @@ -1,5 +1,7 @@ ## Add Label +This action adds a specified label to an issue or pull request. + ## Inputs * `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr)) * `label`: The label to add to the issue diff --git a/.github/actions/remove-label/README.md b/.github/actions/remove-label/README.md index 612468677e..b84b4fb322 100644 --- a/.github/actions/remove-label/README.md +++ b/.github/actions/remove-label/README.md @@ -1,4 +1,6 @@ -## Add Label +## Remove Label + +This action removes a specified label to an issue or pull request. ## Inputs * `issue_number`: The issue number derived from the event payload. Default is `${{ github.event.number }}` then `${{ github.event.issue.number }}`. Action will fail if neither of these is present. If you need to use this action on a push event (or any event not associated directly with an `issue` or `pull_request`, please see [gh-find-current-pr](https://github.com/jwalton/gh-find-current-pr))