build: check regenerated protobuf bindings
What changed, and why it matters
This change improves a build/CI script that checks whether automatically generated protobuf binding files are up to date. It now also checks Python bindings and deletes old generated files before regenerating them, so stale files cannot hide missing updates. There is no runtime security fix here—only a stronger development safeguard.
No security action required. Treat as normal build-quality improvement.
Security signals we found
No security-relevant code change
Build/CI hardening only
No vulnerability fix or exploit mitigation present in diff
Evidence from the diff
The commit modifies .ci/check-protobuf and the corresponding GitHub Actions step. Previously CI only verified Rust protobuf bindings via git diff. The updated script removes generated output directories for both Rust and Python, regenerates both sets of bindings, then fails if any tracked or untracked changes remain in those directories. This is a build-hygiene improvement, not a patch for a vulnerability.
Changed components
.ci/check-protobuf.github/workflows/ci-common.ymlInspect captured patch +13 / −2
### .ci/check-protobuf
@@ -2,5 +2,16 @@
set -euo pipefail
+rust_dir=src/rust/bitbox-proto
+python_dir=py/bitbox02/bitbox02/communication/generated
+
+rm -rf -- "$rust_dir/src/generated" "$python_dir"
./scripts/generate-protobuf-rust.sh
-git diff --exit-code -- src/rust/bitbox-proto
+make -C py/bitbox02
+
+changes=$(git status --porcelain --untracked-files=all -- "$rust_dir" "$python_dir")
+if [[ -n "$changes" ]]; then
+ git diff -- "$rust_dir" "$python_dir"
+ printf '%s\n' "$changes"
+ exit 1
+fi
### .github/workflows/ci-common.yml
@@ -116,7 +116,7 @@ jobs:
make bootstrap
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- - name: Check protobuf Rust bindings
+ - name: Check protobuf bindings
run: ./.ci/check-protobuf
unit-tests:Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.