From ed473f685d63a6b8eabd1f6af27925bd42215c4a Mon Sep 17 00:00:00 2001 From: Jordan Oroshiba Date: Thu, 23 May 2024 12:08:49 -0700 Subject: [PATCH] chore(ci)!: upgrade to v2 buf configs (#1085) ## Summary Upgrade to v2 buf, simplifying deployment. ## Background Previously buf has had a lacking support for monorepos. The newest updates supports a single higher level modules file and pushing all at once without odd buf.lock dependency hacks. ## Changes - Upgraded buf and run `buf config update` ## Testing Will test push and upgrade in the PR. ## Breaking Changelist - Requires users run latest version of buf. --- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 47 +-------------- .github/workflows/test.yml | 2 +- buf.lock | 6 ++ buf.work.yaml | 8 --- buf.yaml | 96 +++++++++++++++++++++++++++++++ proto/composerapis/buf.yaml | 15 ----- proto/executionapis/buf.lock | 13 ----- proto/executionapis/buf.yaml | 17 ------ proto/primitives/buf.yaml | 15 ----- proto/protocolapis/buf.lock | 13 ----- proto/protocolapis/buf.yaml | 21 ------- proto/sequencerblockapis/buf.lock | 13 ----- proto/sequencerblockapis/buf.yaml | 18 ------ proto/vendored/buf.lock | 8 --- proto/vendored/buf.yaml | 8 --- 16 files changed, 106 insertions(+), 196 deletions(-) create mode 100644 buf.lock delete mode 100644 buf.work.yaml create mode 100644 buf.yaml delete mode 100644 proto/composerapis/buf.yaml delete mode 100644 proto/executionapis/buf.lock delete mode 100644 proto/executionapis/buf.yaml delete mode 100644 proto/primitives/buf.yaml delete mode 100644 proto/protocolapis/buf.lock delete mode 100644 proto/protocolapis/buf.yaml delete mode 100644 proto/sequencerblockapis/buf.lock delete mode 100644 proto/sequencerblockapis/buf.yaml delete mode 100644 proto/vendored/buf.lock delete mode 100644 proto/vendored/buf.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b4730aadaf..785c180e89 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v1 with: - version: "1.15.1" + version: "1.32.0" github_token: ${{ github.token }} - uses: bufbuild/buf-lint-action@v1 - run: buf format -d --exit-code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d80b908b35..500aad0c1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v1 with: - version: "1.15.1" + version: "1.32.0" github_token: ${{ github.token }} - name: "Get Buf Branch Annotation" run: | @@ -28,53 +28,10 @@ jobs: else echo "buf_repo_ending=main" >> $GITHUB_ENV fi - - name: "Upload Composer API Protos" + - name: "Upload all Protos" uses: bufbuild/buf-push-action@v1 with: draft: ${{ github.ref_name != 'main'}} - input: "proto/composerapis" - buf_token: ${{ secrets.BUF_TOKEN }} - - name: "Upload Primitive API Protos" - uses: bufbuild/buf-push-action@v1 - with: - draft: ${{ github.ref_name != 'main'}} - input: "proto/primitives" - buf_token: ${{ secrets.BUF_TOKEN }} - - name: "Update Sequencer Block API dependency" - run: | - cd proto/sequencerblockapis - BUF_COMMIT=$(buf beta registry commit get buf.build/astria/primitives:${{ env.buf_repo_ending }} --format=json | jq -r '.commit') - sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/primitives:$BUF_COMMIT/" buf.yaml - buf mod update --only buf.build/astria/primitives - - name: "Upload Sequencer Block API Protos" - uses: bufbuild/buf-push-action@v1 - with: - draft: ${{ github.ref_name != 'main'}} - input: "proto/sequencerblockapis" - buf_token: ${{ secrets.BUF_TOKEN }} - - name: "Update Execution API dependency" - run: | - cd proto/executionapis - BUF_COMMIT=$(buf beta registry commit get buf.build/astria/sequencerblock-apis:${{ env.buf_repo_ending }} --format=json | jq -r '.commit') - sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/sequencerblock-apis:$BUF_COMMIT/" buf.yaml - buf mod update --only buf.build/astria/sequencerblock-apis - - name: "Upload Execution API Protos" - uses: bufbuild/buf-push-action@v1 - with: - draft: ${{ github.ref_name != 'main'}} - input: "proto/executionapis" - buf_token: ${{ secrets.BUF_TOKEN }} - - name: "Update Protocol API dependency" - run: | - cd proto/protocolapis - BUF_COMMIT=$(buf beta registry commit get buf.build/astria/primitives:${{ env.buf_repo_ending }} --format=json | jq -r '.commit') - sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/primitives:$BUF_COMMIT/" buf.yaml - buf mod update --only buf.build/astria/primitives - - name: "Upload Protocol API Protos" - uses: bufbuild/buf-push-action@v1 - with: - draft: ${{ github.ref_name != 'main'}} - input: "proto/protocolapis" buf_token: ${{ secrets.BUF_TOKEN }} charts: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45930225d3..86916b66bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Install `buf` protobuf manager uses: bufbuild/buf-setup-action@v1 with: - version: "1.17.0" + version: "1.32.0" github_token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@1.76.0 diff --git a/buf.lock b/buf.lock new file mode 100644 index 0000000000..c6571c8f90 --- /dev/null +++ b/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/googleapis/googleapis + commit: 4ed3bc159a8b4ac68fe253218760d035 + digest: b5:74a7798987b123218c004cf28543a2835e432ca04a69de99cd394a29dbad24d9ed38344f0b7c97ad6476039506c4eb38c2f4a8eef9cec3da2e38e4216a22d495 diff --git a/buf.work.yaml b/buf.work.yaml deleted file mode 100644 index 7e70993487..0000000000 --- a/buf.work.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -directories: - - proto/primitives - - proto/executionapis - - proto/composerapis - - proto/protocolapis - - proto/sequencerblockapis - - proto/vendored diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000000..ffedb39540 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,96 @@ +version: v2 +modules: + - path: proto/composerapis + name: buf.build/astria/composer-apis + lint: + use: + - BASIC + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX + - FILE_LOWER_SNAKE_CASE + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - SERVICE_SUFFIX + disallow_comment_ignores: true + breaking: + use: + - WIRE_JSON + ignore_unstable_packages: true + - path: proto/executionapis + name: buf.build/astria/execution-apis + lint: + use: + - BASIC + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX + - FILE_LOWER_SNAKE_CASE + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - SERVICE_SUFFIX + disallow_comment_ignores: true + breaking: + use: + - WIRE_JSON + ignore_unstable_packages: true + - path: proto/primitives + name: buf.build/astria/primitives + lint: + use: + - BASIC + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX + - FILE_LOWER_SNAKE_CASE + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - SERVICE_SUFFIX + disallow_comment_ignores: true + breaking: + use: + - FILE + ignore_unstable_packages: true + - path: proto/protocolapis + name: buf.build/astria/protocol-apis + lint: + use: + - BASIC + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX + - FILE_LOWER_SNAKE_CASE + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - SERVICE_SUFFIX + ignore_only: + PACKAGE_VERSION_SUFFIX: + - proto/protocolapis/astria_vendored/tendermint + disallow_comment_ignores: true + breaking: + use: + - WIRE_JSON + ignore_unstable_packages: true + - path: proto/sequencerblockapis + name: buf.build/astria/sequencerblock-apis + lint: + use: + - BASIC + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX + - FILE_LOWER_SNAKE_CASE + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - SERVICE_SUFFIX + disallow_comment_ignores: true + breaking: + use: + - WIRE_JSON + ignore_unstable_packages: true + - path: proto/vendored + name: buf.build/astria/vendored + lint: + use: + - MINIMAL + except: + - PACKAGE_DIRECTORY_MATCH + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +deps: + - buf.build/googleapis/googleapis diff --git a/proto/composerapis/buf.yaml b/proto/composerapis/buf.yaml deleted file mode 100644 index 74a2fa6158..0000000000 --- a/proto/composerapis/buf.yaml +++ /dev/null @@ -1,15 +0,0 @@ -version: v1 -name: buf.build/astria/composer-apis -breaking: - ignore_unstable_packages: true - use: - - WIRE_JSON -lint: - use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_VERSION_SUFFIX - - SERVICE_SUFFIX diff --git a/proto/executionapis/buf.lock b/proto/executionapis/buf.lock deleted file mode 100644 index 9b27072755..0000000000 --- a/proto/executionapis/buf.lock +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: astria - repository: sequencerblock-apis - commit: 172c219fe23d410fba22fb24a1df29e5 - digest: shake256:65152e1778e8545855bf04783be514df0dda1d34949f8c6e3b5b3b53d8260d2aa39c35ea51d7723b0bc1e3e702b031203bbc16c18fb6f364124d9d794456b7ed - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 7a6bc1e3207144b38e9066861e1de0ff - digest: shake256:d646836485c34192401253703c4e7ce899c826fceec060bf4b2a62c4749bd9976dc960833e134a1f814725e1ffd60b1bb3cf0335a7e99ef0e8cec34b070ffb66 diff --git a/proto/executionapis/buf.yaml b/proto/executionapis/buf.yaml deleted file mode 100644 index 10bab3d74f..0000000000 --- a/proto/executionapis/buf.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: v1 -name: buf.build/astria/execution-apis -breaking: - ignore_unstable_packages: true - use: - - WIRE_JSON -deps: - - buf.build/astria/sequencerblock-apis -lint: - use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_VERSION_SUFFIX - - SERVICE_SUFFIX diff --git a/proto/primitives/buf.yaml b/proto/primitives/buf.yaml deleted file mode 100644 index c23e27664a..0000000000 --- a/proto/primitives/buf.yaml +++ /dev/null @@ -1,15 +0,0 @@ -version: v1 -name: buf.build/astria/primitives -breaking: - ignore_unstable_packages: true - use: - - FILE -lint: - use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_VERSION_SUFFIX - - SERVICE_SUFFIX diff --git a/proto/protocolapis/buf.lock b/proto/protocolapis/buf.lock deleted file mode 100644 index b12d7e2a37..0000000000 --- a/proto/protocolapis/buf.lock +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: astria - repository: primitives - commit: 6cc11931ae3546deb1fa54f71c0549c3 - digest: shake256:5864646bd5df05fc5a70b82a427a9973a24f71509892e49789b2287ab9e1dba5a8b22fe9977e6592da0ab1092d5d7d78e68fa13a7505f602e4fbb1451aa993f9 - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 4ed3bc159a8b4ac68fe253218760d035 - digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 diff --git a/proto/protocolapis/buf.yaml b/proto/protocolapis/buf.yaml deleted file mode 100644 index 0a35b92c6b..0000000000 --- a/proto/protocolapis/buf.yaml +++ /dev/null @@ -1,21 +0,0 @@ -version: v1 -name: buf.build/astria/protocol-apis -breaking: - ignore_unstable_packages: true - use: - - WIRE_JSON -deps: - - buf.build/astria/primitives - - buf.build/googleapis/googleapis -lint: - ignore_only: - PACKAGE_VERSION_SUFFIX: - - "astria_vendored/tendermint" - use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_VERSION_SUFFIX - - SERVICE_SUFFIX diff --git a/proto/sequencerblockapis/buf.lock b/proto/sequencerblockapis/buf.lock deleted file mode 100644 index b12d7e2a37..0000000000 --- a/proto/sequencerblockapis/buf.lock +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: astria - repository: primitives - commit: 6cc11931ae3546deb1fa54f71c0549c3 - digest: shake256:5864646bd5df05fc5a70b82a427a9973a24f71509892e49789b2287ab9e1dba5a8b22fe9977e6592da0ab1092d5d7d78e68fa13a7505f602e4fbb1451aa993f9 - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 4ed3bc159a8b4ac68fe253218760d035 - digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 diff --git a/proto/sequencerblockapis/buf.yaml b/proto/sequencerblockapis/buf.yaml deleted file mode 100644 index 347623c080..0000000000 --- a/proto/sequencerblockapis/buf.yaml +++ /dev/null @@ -1,18 +0,0 @@ -version: v1 -name: buf.build/astria/sequencerblock-apis -breaking: - ignore_unstable_packages: true - use: - - WIRE_JSON -deps: - - buf.build/googleapis/googleapis - - buf.build/astria/primitives -lint: - use: - - BASIC - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX - - FILE_LOWER_SNAKE_CASE - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_VERSION_SUFFIX - - SERVICE_SUFFIX diff --git a/proto/vendored/buf.lock b/proto/vendored/buf.lock deleted file mode 100644 index 1b0eba1cea..0000000000 --- a/proto/vendored/buf.lock +++ /dev/null @@ -1,8 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 4ed3bc159a8b4ac68fe253218760d035 - digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 diff --git a/proto/vendored/buf.yaml b/proto/vendored/buf.yaml deleted file mode 100644 index 0f9939ebb8..0000000000 --- a/proto/vendored/buf.yaml +++ /dev/null @@ -1,8 +0,0 @@ -version: v1 -deps: - - buf.build/googleapis/googleapis -lint: - use: - - MINIMAL - except: - - PACKAGE_DIRECTORY_MATCH