Repository navigation
feat(ci): detect breaking protobuf API changes in branch checks #3794
Description
User Story
As an OpenShell maintainer reviewing a protobuf change, I want CI to identify breaking changes against the target branch, so that I can catch unintended client incompatibilities before merging.
Problem Statement
The repository defines a Buf FILE breaking-change policy in buf.yaml, but Branch Checks run buf lint without running buf breaking against a previous revision. The Go SDK's proto check verifies that generated bindings are current; SDK builds and tests use the proposed schema. None of these checks compares the proposed protobuf contract with the existing one.
Impact / Why This Matters
A change can be well-formed, regenerate successfully, and pass in-tree tests while breaking existing gRPC or generated-SDK consumers. Reviewers must inspect schema diffs manually or run a local compatibility comparison. That workaround is easy to miss and does not provide a consistent, visible result for every pull request or merge-queue run.
Proposed Design
For changes to public protobuf contracts, Branch Checks should report compatibility against the appropriate target-branch baseline. Compatible additions should pass; a breaking change should produce an actionable CI failure that identifies the affected contract. The result should remain visible when a change enters the merge queue. If an intentional pre-stability break is permitted, its disposition should be explicit and reviewable rather than silently disabling the check.
Keep the public API boundary distinct from the gateway's storage-only protobuf module, which has separate durability rules.
Acceptance Criteria
- A pull request that changes public
.protofiles receives a protobuf breaking-change result against the target branch; merge-queue runs receive an equivalent result. - A representative breaking change to an existing public message or RPC fails the check with a useful diagnostic, while a compatible additive change passes.
- The comparison covers the public protobuf descriptor closure used by generated SDKs and does not accidentally classify storage-only declarations as public API.
- The documented process for an intentional breaking change preserves a reviewer-visible compatibility result and records why the break is allowed.
- Contributor documentation describes the check and how to reproduce it locally.
Alternatives Considered
- Rely on Buf lint, generated-binding freshness, and SDK builds. These validate the proposed schema but do not compare it with an existing contract.
- Rely on manual review or release qualification alone. This delays detection and produces no consistent signal on the pull request where the change is introduced.
Agent Investigation
buf.yamldeclares the repo-level modules (proto/andcrates/openshell-server/proto/) andbreaking: use: [FILE].tasks/typescript.tomldefinesproto:lintasbuf lint;sdk:ts:ciincludes that task..github/workflows/branch-checks.ymlrunssdk:ts:ciandgo:ci.tasks/go.tomldefinesgo:proto:checkas a generated-file freshness check. No task or workflow invokesbuf breaking.architecture/gateway.mddistinguishes public API compatibility from storage compatibility.rfc/0014-release-stability/release-qualification.mdspecifies a breaking API review, while the current qualification summary lists that review as a missing suite. This issue targets detection in branch CI.- Related API-stabilization tracker: Stabilize public API, SDK, and extension contracts for
0.1.0#2565.
Activity
mrunalp commentedon Sep 28, 2026
Implementation Plan
Issue type:
featComplexity: Medium
Confidence: High — the Buf comparison and CI baselines can be verified locally; intentional breaks require a maintainer policy decision.
Summary
Add a required Branch Checks job that compares the
proto/module, including SDK and extension contracts, with the exact target-branch commit. Use Buf's existingFILEpolicy and report actionable violations on both mirrored PR pushes and merge-group runs.Scope
tasks/scripts/check-proto-breaking.shand aproto:breakingmise task: compare the current and baselineproto/modules, leaving the storage-only module outside this API check..github/workflows/branch-checks.yml: resolve the PR base SHA or merge-group base SHA, fetch it, and run the check as a standard job.CI.md,proto/README.md, and the existingarchitecture/gateway.mdsection: document the gate, local reproduction, and the public/storage boundary..agents/skills/watch-github-actions/SKILL.mdfor changed CI diagnostics and update it only if its guidance becomes inaccurate.Implementation Steps
Test Plan
proto/module comparison.e2e/behavior changes.Risks & Open Questions
base_shain their event payload.Documentation Impact
Revision 2 — cover all versioned proto/ contracts, including extension APIs
Revision 1 — initial plan
mrunalp commentedon Sep 28, 2026
Implementation Complete
PR: #3805
What was built
Branch Checks now compare the public
proto/module with the exact PR or merge-group base using Buf's existingFILEcompatibility policy. The check reports incompatible changes as GitHub annotations; the gateway storage-only module remains outside the public API check.Tests
mise run pre-commit,mise run ci, and comparison againstorigin/mainpassed.Docs updated
CI.md,proto/README.md, andarchitecture/gateway.md.The issue will auto-close when the PR is merged.
fix(ci): qualify protobuf compatibility by release train (NVIDIA#4049)