-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make federation a first-class citizen #16
Conversation
// | ||
// A Name uniquely identifies a Branch within a BSR instance. | ||
// This is used for requests when a caller only has the branch name and not the ID. | ||
message Name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit: might "read" better to have Branch.Name instead of BranchRef.Name, which also makes me wonder about Branch.Ref)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(which then also makes me wonder about using Branch.Name inside Branch, instead of flattening the fields into the main message) (oops, those are ids vs names huh?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't flatten them because it's in a oneof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I was suggesting unflattening the owner_id, etc, but now I realize those are ids not names)
Closing as we've decided not to move forward with representing federation as-is in the new API, and will evaluate how and when we want to handle federation in the future, likely moving concerns client-side. |
…d module and dependency content (#20) This replaces #17 as #16 was closed. This removes the sending of `buf.yaml` and `buf.lock` files over the wire, and consequently these being part of the structure of `Modules` as we know them, instead sending over the specific information we need on the backend in a structured manner. This fully standardizes on the `Node` terminology. A `Node` is a pointer to some content, either on the request or response side. Within this API now, we have: - `FileNode`: A pointer to file content. - `CreateCommitRequest.ModuleNode` - A set of `FileNodes` and an associated `ModuleRef` that represents the content of a single `Module.`. - `CreateCommitRequest.DepNode` - A set of pointers to dependencies, which are just the `commit_ids` of the dependencies and their associated `Digest` (for verification). - `CreateCommitResponse.CommitNode` - A set of pointers to files and then actual commit dependencies. This renames `GetFileNodes` to `GetCommitNodes`. To be honest, I don't love the `Node` naming, and I think it could use some work, but that's less important for the purpose of this PR. We can work on that. Ideas I've had: - `Info` for new nested types, ie `ModuleInfo, DepInfo, CommitInfo`. - `Data` for new nested types. In general, I think it's an anti-pattern to name a Protobuf message `.*Data`, as all Protobuf messages are data, and it doesn't pluralize well. Open to other suggestions.
This PR makes federation a first-class citizen by effectively adding the concept of
registry_hostname
to all resources.registry_hostname
is a rename of what we currently callremote
within our codebases.Motivation:
buf.yaml
over the wire to the backend - we're defining thebuf.yaml
to not make up part of aModule
, and once you do this, it becomes somewhat easy to deconstruct what you send over the wire. Even moreso, I'd argue this is desirable - the backend should not have to concern itself withbuf.yamls
, their layout, or their parsing, as they will not make up part of aCommit
's digest.ModulePin
right now - aCommit
and its associatedDigest
. However, both historically and likely soon-to-be in the future, we've allowed for federation, meaning that it's possible that some `Commits' may lie outside of the given BSR instance you are calling via the API.Commit
both in the request, and returnedCommit
objects.The path to this PR:
registry_hostname
toCommit
. Easy enough.Commit
as scoped to the BSR instance as denoted byregistry_hostname
. For example,module_id
is now the ID of theModule
on the BSR instance as denoted byregistry_hostname
.registry_hostnames
the whole way down -Modules, Users, Organizations
specifically.registry_hostname
onTag, VCSCommit, Branch
as well.What this PR does:
registry_hostname
to all resources.registry_hostname
..*Refs
:.*FullNames
are moved insideRefs
as a nested messageName
(this is likely a nice cleanup anyways, as we only useFullNames
inside ofRefs
anyways at the API level). Since bothid
andname
must be scoped to aregistry_hostname
, it is not desirable to repeatregistry_hostname
on both a theoreticalid
wrapper, and.*FullName
, hence now defining.*FullName
as a nested message that requires other data in the encapsulating message.CommitRef
that will be used in theCommitService
onCreateCommits
in a future PR.registry_hostnames
need to match the BSR instance you are invoking for now. As this changes, we can relax these comments.To be honest, I don't like it. It feels very messy. But I don't know if there's a better solution here, assuming we need to account for federation.
Let's discuss this on Monday @rodaine @jhump @Alfus @pkwarren @jchadwick-buf @saquibmian @doriable @mfridman and come to a conclusion.