| |
| |
| syntax = "proto3"; |
| |
| package bufman.dubbo.apache.org.registry.v1alpha1; |
| |
| import "registry/v1alpha1/repository_tag.proto"; |
| import "google/protobuf/timestamp.proto"; |
| |
| message RepositoryCommit { |
| // primary key, unique, immutable |
| string id = 1; |
| // immutable |
| google.protobuf.Timestamp create_time = 2; |
| // The digest of the commit. |
| string digest = 3; |
| // The name of the commit. |
| // This is what is referenced by users. |
| // Unique, immutable. |
| string name = 4; |
| // The branch on which this commit was created. |
| string branch = 5 [deprecated = true]; |
| // The commit sequence ID for this commit. This |
| // is essentially what number commit this is on |
| // the branch. |
| int64 commit_sequence_id = 6; |
| // The username of the user who authored this commit. |
| string author = 7; |
| // The tags associated with this commit |
| repeated bufman.dubbo.apache.org.registry.v1alpha1.RepositoryTag tags = 8; |
| // The commit's draft name, if it is a draft commit. |
| string draft_name = 9; |
| // spdx_license_id is the license of the commit, based on the |
| // license file pushed, which should be one of the identifier defined in |
| // https://spdx.org/licenses, and will be not set if the license file is not |
| // presented or cannot be classified into a known license. |
| string spdx_license_id = 10; |
| // The manifest digest of the commit. |
| string manifest_digest = 11; |
| } |
| |
| // RepositoryCommitService is the Repository commit service. |
| service RepositoryCommitService { |
| // ListRepositoryCommitsByBranch lists the repository commits associated |
| // with a repository branch on a repository, ordered by their create time. |
| rpc ListRepositoryCommitsByBranch(ListRepositoryCommitsByBranchRequest) returns (ListRepositoryCommitsByBranchResponse) { |
| // ListRepositoryCommitsByBranch has been deprecated, use |
| // ListRepositoryCommitsByReference instead. |
| option deprecated = true; |
| option idempotency_level = NO_SIDE_EFFECTS; |
| } |
| |
| // ListRepositoryCommitsByReference returns repository commits up-to and including |
| // the provided reference. |
| rpc ListRepositoryCommitsByReference(ListRepositoryCommitsByReferenceRequest) returns (ListRepositoryCommitsByReferenceResponse) { |
| option idempotency_level = NO_SIDE_EFFECTS; |
| } |
| // GetRepositoryCommitByReference returns the repository commit matching |
| // the provided reference, if it exists. |
| rpc GetRepositoryCommitByReference(GetRepositoryCommitByReferenceRequest) returns (GetRepositoryCommitByReferenceResponse) { |
| option idempotency_level = NO_SIDE_EFFECTS; |
| } |
| // GetRepositoryCommitBySequenceId returns the repository commit matching |
| // the provided sequence ID and branch, if it exists. |
| rpc GetRepositoryCommitBySequenceId(GetRepositoryCommitBySequenceIdRequest) returns (GetRepositoryCommitBySequenceIdResponse) { |
| option idempotency_level = NO_SIDE_EFFECTS; |
| } |
| // ListRepositoryDraftCommits lists draft commits in a repository. |
| rpc ListRepositoryDraftCommits(ListRepositoryDraftCommitsRequest) returns (ListRepositoryDraftCommitsResponse) { |
| option idempotency_level = NO_SIDE_EFFECTS; |
| } |
| // DeleteRepositoryDraftCommit deletes a draft. |
| rpc DeleteRepositoryDraftCommit(DeleteRepositoryDraftCommitRequest) returns (DeleteRepositoryDraftCommitResponse) { |
| option idempotency_level = IDEMPOTENT; |
| } |
| } |
| |
| message ListRepositoryCommitsByBranchRequest { |
| // The owner of the repository which the repository branch belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the repository branch belongs to. |
| string repository_name = 2; |
| // The name of the repository branch whose commits should be listed. |
| string repository_branch_name = 3; |
| uint32 page_size = 4; |
| // For now this is the id of he last commit returned in the previous page. |
| // This is directly set by the frontend when listing track history starting with a |
| // specific commit. If we page_token to be anything other than a commit id |
| // we need to change the frontend as well. |
| string page_token = 5; |
| bool reverse = 6; |
| } |
| |
| message ListRepositoryCommitsByBranchResponse { |
| repeated RepositoryCommit repository_commits = 1; |
| string next_page_token = 2; |
| } |
| |
| message ListRepositoryCommitsByReferenceRequest { |
| // The owner of the repository which the repository reference belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the repository reference belongs to. |
| string repository_name = 2; |
| // The reference used to resolve repository commits. Can be a tag or commit. |
| string reference = 3; |
| uint32 page_size = 4; |
| string page_token = 5; |
| bool reverse = 6; |
| } |
| |
| message ListRepositoryCommitsByReferenceResponse { |
| repeated RepositoryCommit repository_commits = 1; |
| string next_page_token = 2; |
| } |
| |
| message GetRepositoryCommitByReferenceRequest { |
| // The owner of the repository which the reference belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the reference belongs to. |
| string repository_name = 2; |
| // The reference that should be resolved to a commit. Can be a tag or commit. |
| string reference = 3; |
| } |
| |
| message GetRepositoryCommitByReferenceResponse { |
| RepositoryCommit repository_commit = 1; |
| } |
| |
| message GetRepositoryCommitBySequenceIdRequest { |
| // The owner of the repository which the repository branch belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the repository branch belongs to. |
| string repository_name = 2; |
| // The name of the repository branch which the sequence ID is relative to. |
| string repository_branch_name = 3; |
| // The sequence ID to look up. |
| int64 commit_sequence_id = 4; |
| } |
| |
| message GetRepositoryCommitBySequenceIdResponse { |
| RepositoryCommit repository_commit = 1; |
| } |
| |
| message ListRepositoryDraftCommitsRequest { |
| // The owner of the repository which the repository branch belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the repository branch belongs to. |
| string repository_name = 2; |
| uint32 page_size = 3; |
| string page_token = 4; |
| // By default, draft commits are ordered by last update time descending. |
| // Reverse orders them ascending. |
| bool reverse = 5; |
| } |
| |
| message ListRepositoryDraftCommitsResponse { |
| // Each commit will have draft_name set. |
| repeated RepositoryCommit repository_commits = 1; |
| string next_page_token = 2; |
| } |
| |
| message DeleteRepositoryDraftCommitRequest { |
| // The owner of the repository which the repository branch belongs to. |
| string repository_owner = 1; |
| // The name of the repository which the repository branch belongs to. |
| string repository_name = 2; |
| // The name of the draft to delete. |
| string draft_name = 3; |
| } |
| |
| message DeleteRepositoryDraftCommitResponse {} |