Trigger prototype client regeneration on API changes - #172
Open
josephschorr wants to merge 3 commits into
Open
Conversation
|
The latest Buf updates on your PR. Results from workflow Lint / lint (pull_request).
|
josephschorr
marked this pull request as ready for review
August 26, 2026 22:54
miparnisari
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft — merge last. Part 3 of 3 wiring automatic client regeneration into
authzed/spicedb-clients-prototype(see that repo's PRs #58 and #59). Nothing here affects this repo's own builds; it only fires arepository_dispatchoutward.Deliberately a new file —
manual-client-update.yamlandrelease-client-update.yamlare untouched, so the legacy five-client pipeline is unaffected and this prototype wiring is onegit rmaway if it's ever abandoned.What it does
Chains off
LintandReleasecompleting successfully, then dispatches to the prototype repo with aBUFTAGpinning the exact upstream revision:api_main_update—BUFTAGis the api git SHAapi_release_update—BUFTAGis the release tagWhy chained off
Lintrather than triggered on pushLintis what pushes the module to the BSR. Dispatching straight fromon: pushraces that upload, and the receiving side pins to an exact BSR ref — so losing the race means the ref doesn't exist yet. Chaining on successful completion removes the race and also ensures we never regenerate from a commit whosebufbreaking-change check failed.Two related details that are deliberate and look wrong at a glance:
workflow_run.head_sha, notgithub.sha. Underworkflow_run,github.sharesolves to the default-branch head, not the triggering commit.on: workflow_runsupports nopaths:filter, so the proto-relevance check uses the compare API.docs/is excluded because it holds buf-generated swagger, downstream of the protos.Security: the trigger must reject fork-originated runs
This is the part worth reviewing closely.
lint.yamlruns onpull_requestfor all branches, so a fork PR produces a completedLintrun — andworkflow_runfires for those in the base repo with secrets. Filtering onhead_branch !== 'main'does not stop it, because for a fork PRhead_branchis the fork's branch name: attacker-chosen, andmainby default on a fresh fork.Without a guard, an external contributor could cause the prototype repo to spin up an 8-core runner and materialize a Claude credential into a job, repeatedly. The job therefore also requires:
Both intended paths — Lint on a push to main, Release on a tag push — are same-repo push events, so nothing legitimate is lost.
Fails open on an unenumerable commit
GitHub's Get-a-commit API caps
filesat 300 entries and omits the field entirely for very large commits. Treating that as "no relevant files" would skip the dispatch with a green job and no error anywhere — leaving clients silently stale, the exact failure this design exists to prevent. When the list can't be fully enumerated the workflow dispatches anyway and logs why: a needless regeneration finds no proto diff and opens no PR, while a missed one is invisible.🤖 Generated with Claude Code