Skip to content

Commit

Permalink
chore: check breaking change in protobuf (#7609)
Browse files Browse the repository at this point in the history
This PR adds the workflow of detecting breaking changes in protobuf to the CI workflow. Here is an example of error reporting:
- c1dd48e

We've set the rule category to `WIRE_JSON` which is explained [here](https://docs.buf.build/breaking/rules). Actually `WIRE` is enough for our major usages, while `WIRE_JSON` ensures that the name of the fields is not modified, which brings less confusion to the codebase and also makes the JSON-based dashboard easier to maintain (e.g., avoid #7262 from happening).

We may not need to add this workflow to GitHub's branch protection rule until the next release.

Approved-By: TennyZhuang
  • Loading branch information
BugenZhao authored Jan 31, 2023
1 parent c52e550 commit 9a4ee14
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/dashboard_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths: [dashboard/**, proto/**]

concurrency:
group: dashbaord-build-${{ github.ref }}
group: dashboard-build-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/protobuf-breaking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Protobuf Breaking Check

on:
pull_request:
branches: [main]
paths: [proto/**]

jobs:
buf-breaking-check:
runs-on: ubuntu-latest
name: Check breaking changes in Protobuf files
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
# Run breaking change detection against the `main` branch
- uses: bufbuild/buf-breaking-action@v1
with:
input: 'proto'
against: 'https://github.com/risingwavelabs/risingwave.git#branch=main,subdir=proto'
3 changes: 3 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: v1
breaking:
use:
- WIRE_JSON # https://docs.buf.build/breaking/rules
lint:
use:
- DEFAULT
Expand Down

0 comments on commit 9a4ee14

Please sign in to comment.