Skip to content

Commit

Permalink
chore(ci)!: upgrade to v2 buf configs (#1085)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
joroshiba authored May 23, 2024
1 parent 691888b commit ed473f6
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 2 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
6 changes: 6 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/googleapis/googleapis
commit: 4ed3bc159a8b4ac68fe253218760d035
digest: b5:74a7798987b123218c004cf28543a2835e432ca04a69de99cd394a29dbad24d9ed38344f0b7c97ad6476039506c4eb38c2f4a8eef9cec3da2e38e4216a22d495
8 changes: 0 additions & 8 deletions buf.work.yaml

This file was deleted.

96 changes: 96 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 0 additions & 15 deletions proto/composerapis/buf.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions proto/executionapis/buf.lock

This file was deleted.

17 changes: 0 additions & 17 deletions proto/executionapis/buf.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions proto/primitives/buf.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions proto/protocolapis/buf.lock

This file was deleted.

21 changes: 0 additions & 21 deletions proto/protocolapis/buf.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions proto/sequencerblockapis/buf.lock

This file was deleted.

18 changes: 0 additions & 18 deletions proto/sequencerblockapis/buf.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions proto/vendored/buf.lock

This file was deleted.

8 changes: 0 additions & 8 deletions proto/vendored/buf.yaml

This file was deleted.

0 comments on commit ed473f6

Please sign in to comment.