[DEVREL-144] Automate daily OpenAPI sync (regenerate + open bot PR)#584
Merged
Conversation
Add a daily GitHub Actions workflow that pulls the latest OpenAPI spec, regenerates the REST client with oapi-codegen, and opens a brand-new [bot] PR when the output differs from what's committed. Mirrors the automation in client-jvm / client-js, adapted to the Go toolchain (oapi-codegen, not the Java openapi-generator). - scripts/generate.sh: single orchestrator (pull -> gate -> jq preprocess -> pinned oapi-codegen v2.5.1 via 'go run <pkg>@<ver>' -> gate -> fix clashes). - .github/workflows/sync-openapi.yml: schedule + workflow_dispatch; GitHub App token, diff gate, GPG-signed bot commit, unique bot/openapi-sync-<date>-<run_id> branch, best-effort label, Slack notify. - scripts/readme.md: maintainer docs + required secrets/vars. - README.md: automation explainer + regenerate/build instructions; fix dead rest/example link. - Remove superseded rest/generation.sh. https://linear.app/massive-com/issue/DEVREL-144
lukeoleson
approved these changes
Jul 8, 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.
Replicates the live automated OpenAPI regeneration pipeline from client-jvm and client-js in client-go: track spec changes and open a brand-new
[bot]PR with the regenerated client daily, hands-off, instead of the manual regeneration run today.Linear: https://linear.app/massive-com/issue/DEVREL-144/automate-daily-openapi-sync-for-client-go-regenerate-open-bot-pr
Key difference from jvm/js
client-go generates via oapi-codegen (Go-native), not the Java
openapi-generator. So there is noopenapitools.json, nosetup-java, no jar to cache. The Go-native equivalents:oapi-codegen v2.5.1, invoked viago run <pkg>@<version>(single-sourced inscripts/generate.sh). This fixes the real latent break — the oldrest/generation.shcalled a bareoapi-codegenoffPATH(unpinned).setup-go+setup-node(Node runs the spec pull + post-processing).jqis preinstalled on the runner.Generated output is isolated in
rest/gen/client.gen.go; hand-writtenrest/client.go,rest/iterator.go, and the entirewebsocket/package are preserved by not being touched.What's in this PR (pipeline only)
scripts/generate.sh— single orchestrator: pull spec → non-empty-spec gate →jqpreprocess → pinnedoapi-codegen→ client-exists gate →fix-go-clashes.js+gofmt..github/workflows/sync-openapi.yml— dailyschedule+workflow_dispatch; GitHub App token (create-github-app-token@v2), checkoutpersist-credentials,git diff --cachedgate, GPG-signed commit asjustinpolygon, uniquebot/openapi-sync-<date>-<run_id>branch, brand-new[bot]PR every run, best-effortautomatedlabel, Slack notify. Tracked artifacts:rest/scripts/openapi.json+rest/gen/client.gen.go.scripts/readme.md— maintainer docs + required secrets/vars.README.md— automation explainer + "Developing & regenerating" section; fixed deadrest/examplelink.rest/generation.sh.This setup PR is intentionally pipeline-only — I verified a full regen builds/tests cleanly (
go build/vet/test ./...), then reverted the regenerated artifacts. The firstworkflow_dispatchafter merge will produce the spec-sync[bot]PR and validate the automation end-to-end.