From 5e9a06d35c90d24bdd60f0bc1725179f58ce813d Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Mon, 6 Nov 2023 13:19:23 +1100 Subject: [PATCH] chore: add buf breaking change detection to CI For now this will just add warnings to the PR, but once we've stabilised we should make these errors. --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ protos/xyz/block/ftl/v1/ftl.proto | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76b300a483..3a5442cc54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,12 +62,34 @@ jobs: run: go-check-sumtype ./... - name: shellcheck run: shellcheck -e SC2016 scripts/* + proto-breaking: + name: Proto Breaking Change Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Init Hermit + uses: cashapp/activate-hermit@v1 + - name: Proto Breaking Change Check + run: | + set -euo pipefail + buf breaking --against .git#branch=main | while read -r line; do + # Extract the file path, line number, and column number from the warning message + file_path=$(echo "$line" | cut -d':' -f1) + line_number=$(echo "$line" | cut -d':' -f2) + column_number=$(echo "$line" | cut -d':' -f3) + + # Output the warning message in the format expected by GitHub Actions + echo "::warning file=$file_path,line=$line_number,col=$column_number::$line" + done console: name: Console runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Init Hermit uses: cashapp/activate-hermit@v1 - name: Console NPM Install diff --git a/protos/xyz/block/ftl/v1/ftl.proto b/protos/xyz/block/ftl/v1/ftl.proto index b2d9e4263c..a14907fccd 100644 --- a/protos/xyz/block/ftl/v1/ftl.proto +++ b/protos/xyz/block/ftl/v1/ftl.proto @@ -19,7 +19,7 @@ message PingResponse { message Metadata { message Pair { string key = 1; - string value = 2; + int32 value = 2; } repeated Pair values = 1; }