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

Conversation

negz
Copy link
Member

@negz negz commented Oct 27, 2023

Description of your changes

This registry generates us documentation. I believe it also allows us to avoid copying around protobuf files, which we currently need to do for each SDK (e.g. https://github.com/crossplane/function-sdk-go/tree/main/proto). The buf tool is OSS but the Schema Registry is a commercial product of https://buf.build. It does appear to be free for OSS use.

Example docs: https://buf.build/crossplane/crossplane/docs/main:apiextensions.fn.proto.v1beta1

I'd like to link to these docs from https://docs.crossplane.io.

I have:

Need help with this checklist? See the cheat sheet.

@negz negz requested a review from a team as a code owner October 27, 2023 21:34
@negz negz requested a review from phisco October 27, 2023 21:34
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.

This registry generates us documentation. I believe it also allows us to
avoid copying around protobuf files, which we currently need to do for
each SDK (e.g. https://github.com/crossplane/function-sdk-go/tree/main/proto).

Signed-off-by: Nic Cope <nicc@rk0n.org>
Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Directionally, this seems reasonable, and we could always change direction in the future if we wanted more direct integration of some fashion with docs.crossplane.io.

A few question about the expected workflow here, but overall this is reasonable.

@@ -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.

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.

@negz
Copy link
Member Author

negz commented Oct 27, 2023

@phisco @turkenh @bobh66 FYI I'm wanting to move fast on this to get Functions documented for the v1.14 release. I'm going to use @jbw976's steering committee approval as a stand-in for maintainer approval. Let me know if you have any concerns with this PR.

@negz negz merged commit 83c5887 into crossplane:master Oct 27, 2023
18 checks passed
@negz negz deleted the buf-horses branch October 27, 2023 22:24
@negz
Copy link
Member Author

negz commented Nov 2, 2023

/backport

Copy link

github-actions bot commented Nov 2, 2023

Git push to origin failed for release-1.14 with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants