blob: 87fdd363c2d98b4ff5c69d1c71d003ca73444343 [file] [log] [blame]
syntax = "proto3";
package bufman.dubbo.apache.org.registry.v1alpha1;
import "registry/v1alpha1/git_metadata.proto";
import "registry/v1alpha1/repository_commit.proto";
import "registry/v1alpha1/repository_tag.proto";
message Reference {
reserved 1, 4;
reserved "branch", "track";
oneof reference {
// The requested reference is a tag.
RepositoryTag tag = 2;
// The requested reference is a commit.
RepositoryCommit commit = 3;
// The requested reference is the default reference.
RepositoryMainReference main = 5;
// The requested reference is a draft commit.
RepositoryDraft draft = 6;
}
}
message RepositoryMainReference {
// Name is always 'main'.
string name = 1;
// The latest commit in this repository. If the repository has no commits,
// this will be empty.
RepositoryCommit commit = 2;
}
message RepositoryDraft {
// The name of the draft
string name = 1;
// The commit this draft points to.
RepositoryCommit commit = 2;
}
// ReferenceService is a service that provides RPCs that allow the BSR to query
// for reference information.
service ReferenceService {
// GetReferenceByName takes a reference name and returns the
// reference either as 'main', a tag, or commit.
rpc GetReferenceByName(GetReferenceByNameRequest) returns (GetReferenceByNameResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// ListGitCommitMetadataForReference takes a string reference and returns all the git commit
// metadata associated with the resolved reference commit.
rpc ListGitCommitMetadataForReference(ListGitCommitMetadataForReferenceRequest) returns (ListGitCommitMetadataForReferenceResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
message GetReferenceByNameRequest {
// Name of the requested reference.
string name = 1;
// Owner of the repository the reference belongs to.
string owner = 2;
// Name of the repository the reference belongs to.
string repository_name = 3;
}
message GetReferenceByNameResponse {
Reference reference = 1;
}
message ListGitCommitMetadataForReferenceRequest {
// String that represents the name of the reference.
string reference = 1;
// Owner of the repository the reference belongs to.
string owner = 2;
// Name of the repository the reference belongs to.
string repository_name = 3;
}
message ListGitCommitMetadataForReferenceResponse {
// ID of the BSR commit the reference resolved to.
string commit_id = 1;
// List of git commits and metadata associated with the resolved reference.
repeated GitCommitMetadata git_commit_metadatas = 2;
}