// SPDX-License-Identifier: MIT syntax = "proto3"; package ermite; import "ermite/git.proto"; import "ermite/types.proto"; import "google/protobuf/timestamp.proto"; // MergeRequestState is where a merge request is in its life. enum MergeRequestState { // Not set. In ListMergeRequestsRequest.state it means every state. Never // returned by the server. MERGE_REQUEST_STATE_UNSPECIFIED = 0; // The merge request awaits review; it can be commented on, merged or closed. MERGE_REQUEST_STATE_OPEN = 1; // The source branch was merged into the target. Final. MERGE_REQUEST_STATE_MERGED = 2; // The merge request was closed without merging. Final. MERGE_REQUEST_STATE_CLOSED = 3; } // DiffSide is the side of a diff a line comment is attached to. enum DiffSide { // Not set. On a Comment it means the comment is general, not attached to a // line. In AddCommentRequest it is valid only for a general comment. DIFF_SIDE_UNSPECIFIED = 0; // The old side: the line is a Line.old_number (a deletion or a context line). DIFF_SIDE_OLD = 1; // The new side: the line is a Line.new_number (an addition or a context // line). DIFF_SIDE_NEW = 2; } // Verdict is the judgement a reviewer gives with a comment. enum Verdict { // Not set. The comment carries no verdict. In AddCommentRequest it means a // plain comment. VERDICT_UNSPECIFIED = 0; // The reviewer approves the merge request. The comment is created resolved. VERDICT_APPROVE = 1; // The reviewer asks for changes. The comment starts unresolved. VERDICT_CHANGES_REQUESTED = 2; } // MergeabilityState tells whether the head of an open merge request can be // merged into its target. enum MergeabilityState { // Not set. MERGEABILITY_STATE_UNSPECIFIED = 0; // The server has no result yet for the current tips of both branches. It // is replaced by another state when the check completes. MERGEABILITY_STATE_CHECKING = 1; // The target is an ancestor of the head: every mode can merge. MERGEABILITY_STATE_UP_TO_DATE = 2; // The target has commits the head lacks, but the head merges cleanly: // squash and merge commit can merge, fast-forward cannot. MERGEABILITY_STATE_BEHIND = 3; // The head does not merge cleanly into the target, or the branches share no // history: no mode can merge. MERGEABILITY_STATE_CONFLICT = 4; } // Mergeability is the result of checking an open merge request against the // tips of its branches. message Mergeability { // State is the result. MergeabilityState state = 1; // TargetId is the commit the target branch pointed to when checked. Empty // while CHECKING. string target_id = 2; // HeadId is the commit the source branch pointed to when checked. Empty // while CHECKING. string head_id = 3; // Behind is the number of commits of the target that the head lacks. Set // only when state is BEHIND. int32 behind = 4; // BehindCapped says that Behind is a lower bound: the server stops counting // at 1,000. bool behind_capped = 5; // ConflictPaths are the paths that conflict, at most 20. Set only when // state is CONFLICT; empty when the branches share no history. repeated string conflict_paths = 6; // ConflictPathsTruncated says that more paths conflict than listed. bool conflict_paths_truncated = 7; // CheckedAt is when the server computed the result. Unset while CHECKING. google.protobuf.Timestamp checked_at = 8; } // AutoMerge is the pending auto-merge of an open merge request: the server // merges it by itself once its checks pass. Set only by servers with the // "merge_requests.auto_merge" feature. message AutoMerge { // Mode is the merge mode used. Never MERGE_MODE_UNSPECIFIED. MergeMode mode = 1; // HeadId is the head the auto-merge was enabled for. A new head cancels the // auto-merge. string head_id = 2; // EnabledBy names who enabled the auto-merge, like MergeRequest.author. string enabled_by = 3; // EnabledAt is when the auto-merge was enabled. google.protobuf.Timestamp enabled_at = 4; } // MergeRequest asks to merge one branch of a repository into another branch // of the same repository. It is about a branch, not about who wrote it. message MergeRequest { // Repo is the name of the repository. string repo = 1; // Number identifies the merge request within its repository, starting at 1 // and never reused. It is written "!" in messages and URLs. int64 number = 2; // Title is a one-line plain-text title, at most 120 characters. string title = 3; // Description is a plain-text description, at most 8,000 characters. It may // be empty. Clients show it escaped, with line breaks kept. string description = 4; // SourceBranch is the short name of the branch to merge, for example // "feat/x". string source_branch = 5; // TargetBranch is the short name of the branch to merge into, for example // "main". string target_branch = 6; // State is where the merge request is in its life. MergeRequestState state = 7; // Author names who created the merge request: the label of the token that // was used, "root" for the root token, or "owner" for a web session. It is // informational: labels are not unique and the token may be gone. string author = 8; // CreatedAt is when the merge request was created. google.protobuf.Timestamp created_at = 9; // UpdatedAt is when the merge request last changed: title, description, // state, or a comment added or resolved. Pushes to the source branch do not // change it. google.protobuf.Timestamp updated_at = 10; // HeadId is the id of the commit the source branch points to. While the // merge request is open it is read from Git at every call, so it changes // when the branch is pushed; it is empty if the branch was deleted. Once // merged or closed it is the head at that moment. string head_id = 11; // MergedCommitId is the id of the commit the target branch points to after // the merge: the head for a fast-forward, the new commit for a squash or a // merge commit. // Empty unless state is MERGED. string merged_commit_id = 12; // MergeMode is how the merge request was merged. MERGE_MODE_UNSPECIFIED // unless state is MERGED. MergeMode merge_mode = 13; // Mergeability tells whether the head can be merged into the target. Set // while the merge request is OPEN, with state CHECKING until the server has // a result for the current tips; never set once merged or closed. It is a // hint: MergeMergeRequest checks again. Set only by servers with the // "merge_requests.mergeability" feature. Mergeability mergeability = 14; // AutoMerge is the pending auto-merge. Set only while the merge request is // OPEN and auto-merge is enabled; unset once merged or closed. Set only by // servers with the "merge_requests.auto_merge" feature. AutoMerge auto_merge = 15; // AutoMerged is true when the server merged the merge request by auto-merge. // Always false unless state is MERGED. bool auto_merged = 16; } // Comment is a note on a merge request, either general or attached to a line // of its diff. message Comment { // Id identifies the comment within its merge request. Opaque. string id = 1; // Author names who wrote the comment, like MergeRequest.author. string author = 2; // Path is the path of the commented file in the diff (the new path, or the // old path of a deleted file). Empty for a general comment. string path = 3; // Line is the 1-based line number on side. 0 for a general comment. int32 line = 4; // Side tells whether line counts on the old or the new side of the diff. // DIFF_SIDE_UNSPECIFIED for a general comment. DiffSide side = 5; // CommitId is the head of the merge request when the comment was written. // When it differs from the current head the line may have moved; clients // may show the comment as outdated. string commit_id = 6; // Text is the Markdown source, at most 8,000 characters. Clients render it // as Markdown without raw HTML; "^" refers to a note of the same merge // request. Empty when deleted is true, and possibly empty for a comment // that carries a verdict. string text = 7; // Resolved is true once the comment was marked resolved. bool resolved = 8; // CreatedAt is when the comment was written. google.protobuf.Timestamp created_at = 9; // ReplyTo is the id of the root comment this comment replies to. Empty for // a root comment. A reply has the path, line, start_line and side of its // root, and its commit_id is the head when the reply was written. Threads // have one level: a reply never has replies. string reply_to = 10; // StartLine is the 1-based first line of a range that ends at line, on the // same side. 0 for a comment on a single line or a general comment. int32 start_line = 11; // Verdict is the judgement given with the comment. Only a root comment has // one; it never changes after creation. Verdict verdict = 12; // EditedAt is when the text was last changed or the comment was deleted. // Unset if it never was. google.protobuf.Timestamp edited_at = 13; // Deleted is true once the author deleted the comment. Its text is then // empty; its id, anchor, replies and verdict remain. bool deleted = 14; } // AuthorVerdict is the current verdict of one author on a merge request: the // one given with the author's latest comment that carries a verdict. message AuthorVerdict { // Author names who gave the verdict, like Comment.author. string author = 1; // Verdict is the current verdict. Never VERDICT_UNSPECIFIED. Verdict verdict = 2; // CommentId is the id of the comment that carries the verdict. string comment_id = 3; // CommitId is the head of the merge request when the verdict was given. string commit_id = 4; // CreatedAt is when the verdict was given. google.protobuf.Timestamp created_at = 5; // Stale is true for an approval given on a commit that is not the current // head. A request for changes is never stale. bool stale = 6; } // MergeRequestService reviews and merges branches. // // Every RPC takes the repository name and, except for creation and listing, // the merge request number. A repository that does not exist or that the // caller cannot read gives not_found; so does an unknown number. Reading // (ListMergeRequests, GetMergeRequest) needs the same access as reading the // repository: nothing for a public one, the repo:read scope for a private // one. Writing needs a scope on the repository, given per RPC; a caller // without it gets permission_denied. // // Text fields follow the same rules everywhere: valid UTF-8, no control // characters (except the line break in description and comment text) and no // Unicode bidirectional override or isolate characters; title is one line of // at most 120 characters, description and comment text at most 8,000 // characters. A request that breaks a rule is rejected whole with // invalid_argument, and the error carries a BadRequest detail naming the // fields. // // Servers that implement this service list "merge_requests" in // GetVersionResponse.features. service MergeRequestService { // CreateMergeRequest opens a merge request. Needs the mr:write scope. Fails // with invalid_argument if a text rule is broken, if a branch does not exist // or if source and target are the same branch, and with already_exists if an // open merge request already has the same source and target. rpc CreateMergeRequest(CreateMergeRequestRequest) returns (CreateMergeRequestResponse); // ListMergeRequests lists the merge requests of a repository, highest // number (newest) first, optionally restricted to one state. The listed // merge requests carry no diff or comments; head_id is set. Fails with // not_found if the repository does not exist or is not readable. rpc ListMergeRequests(ListMergeRequestsRequest) returns (ListMergeRequestsResponse); // GetMergeRequest returns one merge request with its commits, its diff and // its comments. The diff compares the target with the head (what the merge // would bring: "target...head"), or, with since_last_read, the head the // caller last marked read with the current head. Fails with not_found if // the repository or the number is unknown. rpc GetMergeRequest(GetMergeRequestRequest) returns (GetMergeRequestResponse); // AddComment adds a general comment, a comment on a line or a range of // lines of the diff, or a reply to a root comment. Needs the mr:write // scope; setting a verdict also needs the mr:review scope (permission_denied // without it). Fails with invalid_argument if the text breaks a rule (it may // be empty only with a verdict), if path, line, start_line and side do not // designate lines of the current diff of the merge request, if reply_to is // not the id of a root comment that is not deleted, if a reply sets path, // line, start_line, side or verdict, or if a verdict is set on a reply; and // with failed_precondition if the merge request is not open. A comment with // VERDICT_APPROVE is created resolved. rpc AddComment(AddCommentRequest) returns (AddCommentResponse); // EditComment replaces the text of a comment. Needs the mr:write scope, and // only the author of the comment can edit it (permission_denied // otherwise). Fails with invalid_argument if the text breaks a rule (it may // be empty only for a comment with a verdict), with not_found if the comment // is unknown, and with failed_precondition if the merge request is not open // or the comment was deleted. Sending the current text succeeds and changes // nothing. rpc EditComment(EditCommentRequest) returns (EditCommentResponse); // DeleteComment deletes a comment: its text is emptied and deleted is set, // while its id, anchor, replies and verdict remain. Needs the mr:write // scope, and only the author of the comment can delete it // (permission_denied otherwise). Fails with not_found if the comment is // unknown and with failed_precondition if the merge request is not open. // Deleting a comment already deleted succeeds and changes nothing. rpc DeleteComment(DeleteCommentRequest) returns (DeleteCommentResponse); // ResolveComment marks a thread resolved or unresolved. Needs the mr:write // scope. Resolution belongs to the root comment: on a reply it fails with // invalid_argument. Fails with not_found if the comment is unknown and with // failed_precondition if the merge request is not open. Setting the state // the comment already has succeeds and changes nothing. rpc ResolveComment(ResolveCommentRequest) returns (ResolveCommentResponse); // CloseMergeRequest closes an open merge request without merging it. Needs // the mr:write scope. Fails with failed_precondition if the merge request // is not open. A closed merge request cannot be reopened: open a new one. rpc CloseMergeRequest(CloseMergeRequestRequest) returns (CloseMergeRequestResponse); // MarkReady removes the draft prefix ("WIP:" or "[WIP]") from the title so // the merge request can be merged. Needs the mr:write scope. Fails with // failed_precondition if the merge request is not open or is not a draft. // Publishes no event: there is none for a change of title. Needs the // "merge_requests.ready" feature. rpc MarkReady(MarkReadyRequest) returns (MarkReadyResponse); // MergeMergeRequest merges an open merge request. Needs the mr:merge scope, // which merges only when the checks on the head allow it: none failed and // none queued or running (a head with no checks may be merged; success, // skipped and neutral pass). The mr:force-merge scope allows ignore_checks. // The caller passes the head it reviewed: the server merges only if the // source branch still points to it, so a push between review and merge is // never merged unseen. Fails with invalid_argument if head_id is empty or // not a commit id, and with failed_precondition if the merge request is not // open, if the source branch no longer points to head_id ("branch moved, // read again"), if the mode is fast-forward and the target is not an // ancestor of the head (rebase and push again, or merge with squash or // merge commit), if the mode is squash or merge commit and the head // conflicts with the target or shares no history with it (rebase and push // again), if the mode is not allowed by RepoSettings, or if a check failed or // has not finished, unless ignore_checks is set. Merges of one // repository run one at a time. Repeating a call that succeeded fails with // failed_precondition (not open). On success the server publishes // MergeRequestMerged then Pushed for the target branch. rpc MergeMergeRequest(MergeMergeRequestRequest) returns (MergeMergeRequestResponse); // EnableAutoMerge asks the server to merge an open merge request by itself // once at least one check passed on its head, every run created on that head // is complete, and no check failed. It does not take ignore_checks. Needs // the mr:merge scope and, for a token limited to branches, write access to // the target branch // (permission_denied otherwise). The server records the caller, the mode and // the head the caller saw; it merges as the caller, after resolving the caller // again, and cancels the auto-merge if the caller can no longer merge, if the // mode is no longer allowed, if the source branch moves or if the setting is // turned off. Fails with invalid_argument if the mode is not a merge mode or // if head_id is empty or not a commit id, and with failed_precondition if the // merge request is not open, if the source branch no longer points to head_id // ("branch moved, read again"), is a draft, // RepoSettings.allow_auto_merge is off, the mode is not allowed by // RepoSettings, or the server has no CI. Enabling again replaces the mode. // Publishes MergeRequestAutoMergeEnabled. Needs the // "merge_requests.auto_merge" feature. rpc EnableAutoMerge(EnableAutoMergeRequest) returns (EnableAutoMergeResponse); // CancelAutoMerge cancels the pending auto-merge of an open merge request. // Needs the mr:merge scope and, for a token limited to branches, write access // to the target branch. Fails with failed_precondition if auto-merge is not // enabled. Publishes MergeRequestAutoMergeCancelled. rpc CancelAutoMerge(CancelAutoMergeRequest) returns (CancelAutoMergeResponse); // MarkRead records the head the caller has reviewed, for the since_last_read // option of GetMergeRequest. There is one read position per merge request, // the reviewer's. Needs the mr:write scope. Marking a commit that does not // exist in the repository is invalid_argument. rpc MarkRead(MarkReadRequest) returns (MarkReadResponse); } // CreateMergeRequestRequest describes the merge request to open. message CreateMergeRequestRequest { // Repo is the repository name. string repo = 1; // Title is the one-line title. Required. string title = 2; // Description is the optional description. string description = 3; // SourceBranch is the short name of the branch to merge. Required; the // branch must exist. string source_branch = 4; // TargetBranch is the short name of the branch to merge into. Empty means // the default branch of the repository. The branch must exist and differ // from source_branch. string target_branch = 5; } // CreateMergeRequestResponse holds the new merge request. message CreateMergeRequestResponse { // MergeRequest is the created merge request. MergeRequest merge_request = 1; } // ListMergeRequestsRequest selects a page of merge requests. message ListMergeRequestsRequest { // Repo is the repository name. string repo = 1; // State restricts the result to one state. MERGE_REQUEST_STATE_UNSPECIFIED // means every state. MergeRequestState state = 2; // PageSize is the maximum number of merge requests to return. 0 means the // server default; values above the server maximum are lowered to it. int32 page_size = 3; // PageToken is the next_page_token of a previous response, to continue the // same listing. Empty for the first page. Other fields must be unchanged. string page_token = 4; } // ListMergeRequestsResponse is one page of merge requests. message ListMergeRequestsResponse { // MergeRequests are the merge requests of this page, highest number first. repeated MergeRequest merge_requests = 1; // NextPageToken is passed as page_token to get the next page. Empty when // there is no next page. string next_page_token = 2; } // MergeRequestIssueState is where an issue named by a merge request is in its // life. Values share their numbers with IssueState (3, awaiting moderation, // is never shown here). It exists because issue.proto imports this file and // cannot be imported back. enum MergeRequestIssueState { // Not set. Never returned by the server. MERGE_REQUEST_ISSUE_STATE_UNSPECIFIED = 0; // The issue is open. MERGE_REQUEST_ISSUE_STATE_OPEN = 1; // The issue is closed without being resolved. MERGE_REQUEST_ISSUE_STATE_CLOSED = 2; // The issue was resolved, by a merge or by hand. MERGE_REQUEST_ISSUE_STATE_RESOLVED = 4; } // MergeRequestIssue is an issue of the same repository that a merge request // names ("#N"). message MergeRequestIssue { // Number is the number of the issue. int64 number = 1; // Title is the title of the issue. string title = 2; // State is where the issue is in its life. MergeRequestIssueState state = 3; // Closes says that a closing reference names the issue: merging the request // resolves it. bool closes = 4; } // IssueEventKind is what happened in an IssueEvent. enum IssueEventKind { // Not set. Never returned by the server. ISSUE_EVENT_KIND_UNSPECIFIED = 0; // A merge request started naming the issue; closes says whether with a // closing reference. ISSUE_EVENT_KIND_REFERENCED = 1; // The issue was closed without being resolved. ISSUE_EVENT_KIND_CLOSED = 2; // The issue was reopened. ISSUE_EVENT_KIND_REOPENED = 3; // The issue was resolved; merge_request is set when a merge resolved it. ISSUE_EVENT_KIND_RESOLVED = 4; } // IssueEvent is one entry in the history of an issue. Events are append-only: // a reference that later disappears does not remove its event. message IssueEvent { // Id identifies the event within its issue. Opaque. Events of different // issues can share an id: key them by (issue, id). string id = 1; // Kind is what happened. IssueEventKind kind = 2; // Issue is the number of the issue. int64 issue = 3; // MergeRequest is the number of the merge request involved; 0 if none. int64 merge_request = 4; // MergeRequestTitle is the title of that merge request at read time; empty // if none. string merge_request_title = 5; // Closes says that the reference was a closing one. Only set for // ISSUE_EVENT_KIND_REFERENCED. bool closes = 6; // Actor names who caused the event, like Issue.author: the label of the // token or session. For events triggered by a merge, the label of who // merged. string actor = 7; // CreatedAt is when the event happened. google.protobuf.Timestamp created_at = 8; } // GetMergeRequestRequest selects a merge request. message GetMergeRequestRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // SinceLastRead asks for the diff between the head recorded by MarkRead and // the current head instead of the diff against the target. It works after a // force-push as long as the recorded commit still exists in the repository. // When nothing was marked read, or the recorded commit is gone, the response // holds the diff against the target and says so in last_read_id and // last_read_lost. bool since_last_read = 3; } // GetMergeRequestResponse holds a merge request with its review data. message GetMergeRequestResponse { // MergeRequest is the merge request. MergeRequest merge_request = 1; // Commits are the commits of the head that are not in the target // ("target..head"), newest first. At most 100 are returned (a server limit // that may change; rely on commits_truncated, not on the number). Empty when // the source branch was deleted. repeated Commit commits = 2; // CommitsTruncated is true when the branch has more commits than commits // holds. bool commits_truncated = 3; // DiffBaseId is the id of the commit the diff compares from: the merge base // of the target and the head, or the last read head when since_last_read // applied. Empty when the source branch was deleted; diff is then empty. string diff_base_id = 4; // Stats are the totals of the diff, including files that it omits or // truncates. DiffStats stats = 5; // Diff is the structured diff from diff_base_id to the head, with the same // limits and truncated flags as GetCommitResponse.diff. Diff diff = 6; // Comments are every comment of the merge request, oldest first. repeated Comment comments = 7; // LastReadId is the head recorded by MarkRead, whether or not // since_last_read was set. Empty when nothing was marked read. string last_read_id = 8; // LastReadLost is true when since_last_read was set, a head was recorded, // but that commit no longer exists in the repository: the diff is then the // diff against the target. A client should tell the reader to review the // whole change again. bool last_read_lost = 9; // Verdicts are the current verdicts, one per author who gave one, ordered // by the comment that carries them, oldest first. repeated AuthorVerdict verdicts = 10; // Issues are the issues of the same repository that the merge request names, // ascending by number, at most 100. Empty when issues are off. repeated MergeRequestIssue issues = 11; // IssueEvents are the history entries that involve this merge request: the // REFERENCED and RESOLVED events of the issues it names or once named, // oldest first, at most 500. An event can name an issue that is no longer // in issues. Empty when issues are off. repeated IssueEvent issue_events = 12; } // AddCommentRequest describes the comment to add. message AddCommentRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // Path is the file the comment is attached to, as given by the diff of the // merge request: FileDiff.new_path, or old_path for a deleted file. Empty // for a general comment; then line must be 0 and side unspecified. string path = 3; // Line is the 1-based line number on side. It must be the old_number or // new_number of a Line of a hunk of the file; a line outside the hunks is // invalid_argument. 0 for a general comment. int32 line = 4; // Side is the side line counts on. Required when path is set. DiffSide side = 5; // Text is the Markdown source. Required, except when verdict is set. string text = 6; // ReplyTo is the id of the root comment to reply to. Empty for a new root // comment. A reply takes the anchor of its root: path, line, start_line, // side and verdict must then be unset. string reply_to = 7; // StartLine is the 1-based first line of a range ending at line. 0 for a // single line. Needs path; it must be lower than line, and both ends must // be lines of the diff on side. int32 start_line = 8; // Verdict is the judgement to give. Needs the mr:review scope and a root // comment. VERDICT_UNSPECIFIED for a plain comment. Verdict verdict = 9; } // AddCommentResponse holds the new comment. message AddCommentResponse { // Comment is the created comment. Comment comment = 1; } // EditCommentRequest describes the new text of a comment. message EditCommentRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // CommentId is the Comment.id to edit. string comment_id = 3; // Text is the new Markdown source. Required, except for a comment that // carries a verdict. string text = 4; } // EditCommentResponse holds the comment after the edit. message EditCommentResponse { // Comment is the updated comment. Comment comment = 1; } // DeleteCommentRequest names the comment to delete. message DeleteCommentRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // CommentId is the Comment.id to delete. string comment_id = 3; } // DeleteCommentResponse holds the comment after the deletion. message DeleteCommentResponse { // Comment is the deleted comment. Comment comment = 1; } // ResolveCommentRequest changes the resolved state of a comment. message ResolveCommentRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // CommentId is the Comment.id to change. string comment_id = 3; // Resolved is the new state: true to resolve, false to unresolve. bool resolved = 4; } // ResolveCommentResponse holds the comment after the change. message ResolveCommentResponse { // Comment is the updated comment. Comment comment = 1; } // CloseMergeRequestRequest names the merge request to close. message CloseMergeRequestRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; } // CloseMergeRequestResponse holds the merge request after closing. message CloseMergeRequestResponse { // MergeRequest is the closed merge request. MergeRequest merge_request = 1; } // MarkReadyRequest names the draft merge request to mark ready. message MarkReadyRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; } // MarkReadyResponse holds the merge request after marking it ready. message MarkReadyResponse { // MergeRequest is the merge request with its title stripped of the draft // prefix. MergeRequest merge_request = 1; } // MergeMergeRequestRequest describes the merge to perform. message MergeMergeRequestRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // Mode is how to merge. MERGE_MODE_UNSPECIFIED means fast-forward. The mode // must be in RepoSettings.allowed_merge_modes of the repository. MergeMode mode = 3; // HeadId is the full id of the commit the caller reviewed, that is the // MergeRequest.head_id it was shown. Required. The merge happens only if the // source branch still points to it. string head_id = 4; // DeleteSourceBranch deletes the source branch after the merge. The merge // is refused before anything changes when the source branch is the default // branch of the repository or the source or target of another open merge // request. Servers without the "merge_requests.delete_branch" feature ignore // it. bool delete_source_branch = 5; // IgnoreChecks merges whatever the checks say. Needs the mr:force-merge // scope (permission_denied otherwise). Servers without the // "merge_requests.ignore_checks" feature ignore it: check the feature // before setting it. bool ignore_checks = 6; } // MergeMergeRequestResponse holds the merged merge request. message MergeMergeRequestResponse { // MergeRequest is the merge request after the merge: state MERGED, // merged_commit_id set to the new tip of the target branch and merge_mode // set to the mode used. MergeRequest merge_request = 1; // SourceBranchDeleted is true when delete_source_branch was set: the server // deletes the branch after answering. The deletion is skipped, and the // branch kept, if the branch moved or another open merge request uses it // by then; the merge stands either way. Watch reports the deletion with a // Pushed event for the source branch. bool source_branch_deleted = 2; } // EnableAutoMergeRequest describes the auto-merge to enable. message EnableAutoMergeRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // Mode is how to merge. MERGE_MODE_UNSPECIFIED means fast-forward. The mode // must be in RepoSettings.allowed_merge_modes of the repository. MergeMode mode = 3; // HeadId is the full id of the commit the caller reviewed, that is the // MergeRequest.head_id it was shown. Required. The auto-merge is enabled // only if the source branch still points to it; failed_precondition (branch // moved) otherwise. string head_id = 4; } // EnableAutoMergeResponse holds the merge request with auto-merge enabled. message EnableAutoMergeResponse { // MergeRequest is the merge request, with auto_merge set. MergeRequest merge_request = 1; } // CancelAutoMergeRequest names the merge request whose auto-merge to cancel. message CancelAutoMergeRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; } // CancelAutoMergeResponse holds the merge request after the cancellation. message CancelAutoMergeResponse { // MergeRequest is the merge request, with auto_merge unset. MergeRequest merge_request = 1; } // MarkReadRequest records a read position. message MarkReadRequest { // Repo is the repository name. string repo = 1; // Number is the merge request number. int64 number = 2; // HeadId is the full id of the commit the caller has reviewed, usually the // MergeRequest.head_id it was shown. Empty means the current head of the // source branch. string head_id = 3; } // MarkReadResponse is empty. message MarkReadResponse {}