Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Protobufs to Buf Schema Registry #4923

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,35 @@ jobs:
with:
name: artifacts
path: ./out/artifacts


protobuf-schemas:
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Setup Buf
uses: bufbuild/buf-setup-action@v1

- name: Lint Protocol Buffers
uses: bufbuild/buf-lint-action@v1
with:
input: apis

- name: Detect Breaking Changes in Protocol Buffers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a local part of the workflow here? e.g. make reviewable does this same check so devs can have confidence in their commit before opening a PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have, but I feel a sense of urgency to have something in place and I don't want to take on teaching the Makefile and/or build submodule about buf right now. I've raised #4924 to track this.

uses: bufbuild/buf-breaking-action@v1
with:
input: apis
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=master,subdir=apis"

- name: Push Protocol Buffers to Buf Schema Registry
if: github.ref == 'refs/heads/master'
uses: bufbuild/buf-push-action@v1
with:
input: apis
buf_token: ${{ secrets.BUF_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the Buf Schema Registry doesn't seem to support robots, so I'll need to create a token associated with my account and use that. We'll also need at least one other maintainer to create an account for redundancy.

7 changes: 7 additions & 0 deletions apis/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by buf. DO NOT EDIT.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the expected workflow for this type of file being updated? is it something a developer will ever need to do with the buf tooling and include in a PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceedingly rarely. The command is buf mod update, which I've mentioned in #4924 for now.

version: v1
deps:
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes
commit: 44e83bc050a4497fa7b36b34d95ca156
10 changes: 10 additions & 0 deletions apis/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1
name: buf.build/crossplane/crossplane
deps:
- buf.build/protocolbuffers/wellknowntypes:v24.4
breaking:
use:
- FILE
lint:
use:
- DEFAULT