golang.org/x/build@v0.0.0-20240506185731-218518f32b70/maintner/maintpb/maintner.proto (about)

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // https://developers.google.com/protocol-buffers/docs/proto3
     6  syntax = "proto3";
     7  
     8  import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
     9  
    10  package maintpb;
    11  
    12  message Mutation {
    13    GithubIssueMutation github_issue = 1; // issue-specific changes
    14    GithubMutation github = 3; // labels, milestones (not issue-specific)
    15  
    16    GitMutation git = 2;
    17    GerritMutation gerrit = 4;
    18  }
    19  
    20  message GithubMutation {
    21    string owner = 1;  // "golang"
    22    string repo = 2;  // "go"
    23  
    24    // Updated labels. (All must have id set at least)
    25    repeated GithubLabel labels = 3;
    26  
    27    // Updated milestones. (All must have id set at least)
    28    repeated GithubMilestone milestones = 4;
    29  }
    30  
    31  message GithubIssueMutation {
    32    string owner = 1;  // "golang"
    33    string repo = 2;  // "go"
    34    int32 number = 3;  // 1, 2, 3... (not the ID)
    35  
    36    // not_exist is set true if the issue has been found to not exist.
    37    // If true, the owner/repo/number fields above must still be set.
    38    // If a future issue mutation for the same number arrives without
    39    // not_exist set, then the issue comes back to life.
    40    bool not_exist = 13;
    41  
    42    int64 id = 12;  // unique across all repos
    43  
    44    GithubUser user = 4;   // only set for new/updated issues, not new comments
    45    repeated GithubUser assignees = 10; // who the issue is assigned to
    46    repeated int64 deleted_assignees = 11; // IDs of users to delete from the assignee list
    47    google.protobuf.Timestamp created = 5; // only needed on new issues
    48    google.protobuf.Timestamp updated = 6; // only set on updated issue text
    49    string title = 9; // issue title
    50  
    51    // body_change changes the body field (the top post, which isn't a comment).
    52    // It is now used in preference to the old body field.
    53    StringChange body_change = 31;
    54    // body was the old way to change the body, but it doesn't support removing the
    55    // body text, which is common on PRs. New mutations use body_change instead.
    56    string body = 7;
    57  
    58    bool no_milestone = 15; // true unsets any previously-set milestone; false ignored.
    59    // When setting a milestone, only the milestone_id must be set.
    60    // TODO: allow num or title to be used if Github only returns those? So far unneeded.
    61    // The num and title, if non-zero, are treated as if they were a GithubMutation.Milestone update.
    62    int64 milestone_id = 16; // sets milestone to this milestone id (e.g. 2386495, global?)
    63    int64 milestone_num = 17; // sets milestone to this milestone number (e.g. 2, per-repo)
    64    string milestone_title = 18;
    65  
    66    BoolChange closed = 19;
    67    BoolChange locked = 25;
    68  
    69    bool pull_request = 28;  // true is the issue is a Pull Request
    70  
    71    google.protobuf.Timestamp closed_at = 21;
    72    GithubUser closed_by = 22;
    73  
    74    repeated int64 remove_label = 23; // label IDs to remove
    75    repeated GithubLabel add_label = 24;
    76  
    77    repeated GithubIssueCommentMutation comment = 8;
    78    GithubIssueSyncStatus comment_status = 14;
    79  
    80    repeated GithubIssueEvent event = 26;  // new events to add
    81    GithubIssueSyncStatus event_status = 27;
    82  
    83    repeated GithubReview review = 29;  // new reviews to add
    84    GithubIssueSyncStatus review_status = 30;
    85  
    86    // Next tag: 32
    87  }
    88  
    89  // BoolChange represents a change to a boolean value.
    90  // (Notably, the wrapper type permits representing a change to false.)
    91  message BoolChange {
    92    bool val = 1;
    93  }
    94  
    95  // StringChange represents a change to a boolean value.
    96  // (Notably, the wrapper type permits representing a change to the empty string.)
    97  message StringChange {
    98    string val = 1;
    99  }
   100  
   101  message GithubLabel {
   102    int64 id = 1;
   103    string name = 2;
   104  }
   105  
   106  message GithubMilestone {
   107    int64 id = 1; // required
   108  
   109    // Following only need to be non-zero on changes:
   110    string title = 2;
   111    BoolChange closed = 3;
   112    int64 number = 4;
   113  }
   114  
   115  // See https://developer.github.com/v3/activity/events/types/#issuesevent
   116  // for some info.
   117  message GithubIssueEvent {
   118    // Required:
   119    int64 id = 1;
   120  
   121    // event_type can be one of "assigned", "unassigned", "labeled",
   122    // "unlabeled", "opened", "edited", "milestoned", "demilestoned",
   123    // "closed", "reopened", "referenced", "renamed" or anything else
   124    // that Github adds in the future.
   125    string event_type = 2;
   126    int64 actor_id = 3;
   127    google.protobuf.Timestamp created = 4; // time of the event
   128  
   129    // label is populated for "labeled" and "unlabeled" events.
   130    // The label will usually not have an ID, due to Github's API
   131    // not returning one.
   132    GithubLabel label = 5;
   133  
   134    // milestone is populated for "milestoned" and "demilestoned" events.
   135    // The label will usually not have an ID, due to Github's API
   136    // not returning one.
   137    GithubMilestone milestone = 6;
   138  
   139    // For "assigned", "unassigned":
   140    int64 assignee_id = 7; // always same as actor_id it seems? Github API doesn't say.
   141    int64 assigner_id = 8;
   142  
   143    // For "referenced", "closed":
   144    GithubCommit commit = 9;
   145  
   146    // For "renamed" events:
   147    string rename_from = 11;
   148    string rename_to = 12;
   149  
   150    int64 reviewer_id = 13;
   151    int64 review_requester_id = 14;
   152    GithubTeam team_reviewer = 16;
   153    // Contents of a dismissed review event, see dismissed_review in
   154    // https://developer.github.com/v3/issues/events/ for more info
   155    GithubDismissedReviewEvent dismissed_review = 15;
   156  
   157    // other_json is usually empty. If Github adds event types or fields
   158    // in the future, this captures those added fields. If non-empty it
   159    // will be a JSON object with the fields that weren't understood.
   160    bytes other_json = 10;
   161  
   162    // Next tag: 17.
   163  }
   164  
   165  // Contents of a dismissed review event - when someone leaves a
   166  // review requesting changes and someone else dismisses it. See
   167  // https://developer.github.com/v3/issues/events for more information.
   168  message GithubDismissedReviewEvent {
   169    int64 review_id = 1; // ID of the review being dismissed
   170    reserved 2; // Old int64 "state" field. Do not use.
   171    string dismissal_message = 3;
   172    string state = 4; // commented, approved, changes_requested
   173  }
   174  
   175  message GithubCommit {
   176    string owner = 1;     // "golang"
   177    string repo = 2;      // "go"
   178    string commit_id = 3; // "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
   179  }
   180  
   181  // Contents of a pull request review - when someone
   182  // comments, requests changes, or approves changes
   183  // on a pull request. See
   184  // https://developer.github.com/v3/pulls/reviews/ for more information.
   185  message GithubReview {
   186    // Required:
   187    int64 id = 1;
   188  
   189    int64 actor_id = 2;
   190    google.protobuf.Timestamp created = 3;  // time of the event
   191    string body = 4;                        // body of the review comment
   192    string state = 5;  // COMMENTED, APPROVED, CHANGES_REQUESTED
   193    string commit_id = 6;
   194    string actor_association = 7;
   195  
   196    // other_json is usually empty.
   197    bytes other_json = 8;
   198  
   199    // Next tag: 9
   200  }
   201  
   202  // GithubIssueSyncStatus notes where syncing is at for comments
   203  // on an issue,
   204  // This mutation type is only made at/after the same top-level mutation
   205  // which created the corresponding comments.
   206  message GithubIssueSyncStatus {
   207    // server_date is the "Date" response header from Github for the
   208    // final HTTP response.
   209    google.protobuf.Timestamp server_date = 1;
   210  }
   211  
   212  message GithubIssueCommentMutation {
   213    int64 id = 1;
   214    GithubUser user = 2; // not present in edits later
   215    string body = 3;   // may not be present in edits later (if only reactions changed? TODO: investigate)
   216    google.protobuf.Timestamp created = 4; // not present in edits later
   217    google.protobuf.Timestamp updated = 5;
   218  }
   219  
   220  message GithubUser {
   221    int64 id = 1;
   222    string login = 2;
   223  }
   224  
   225  message GithubTeam {
   226    int64 id = 1;
   227    string slug = 2;
   228  }
   229  
   230  message GitMutation {
   231    GitRepo repo = 1;
   232  
   233    // commit adds a commit, or adds new information to a commit if fields
   234    // are added in the future.
   235    GitCommit commit = 2;
   236  }
   237  
   238  // GitRepo identifies a git repo being mutated.
   239  message GitRepo {
   240    // If go_repo is set, it identifies a go.googlesource.com/<go_repo> repo.
   241    string go_repo = 1;
   242  
   243    // TODO: code.googlesource.com and github repos later.
   244  }
   245  
   246  message GitCommit {
   247    string sha1 = 1; // the full lowercase 40-hex-byte sha1 sum
   248  
   249    // raw is the "git cat-file commit $sha1" output.
   250    bytes raw = 2;
   251  
   252    GitDiffTree diff_tree = 3;
   253  }
   254  
   255  // git diff-tree --numstat oldtree newtree
   256  message GitDiffTree {
   257    repeated GitDiffTreeFile file = 1;
   258  }
   259  
   260  // GitDiffTreeFile represents one line of `git diff-tree --numstat` output.
   261  message GitDiffTreeFile {
   262    string file = 1;
   263    int64  added = 2;
   264    int64  deleted = 3;
   265    bool   binary = 4;
   266  }
   267  
   268  message GerritMutation {
   269    // Project is the Gerrit server and project, without scheme (https implied) or
   270    // trailing slash.
   271    string project = 1; // "go.googlesource.com/go", "go.googlesource.com/net", etc
   272  
   273    // Commits to add.
   274    repeated GitCommit commits = 2;
   275  
   276    // git refs to update.
   277    repeated GitRef refs = 3;
   278  
   279    // deleted_refs are ref names to delete.
   280    repeated string deleted_refs = 4;
   281  }
   282  
   283  message GitRef {
   284    // ref is the git ref name, such as:
   285    //    HEAD
   286    //    refs/heads/master
   287    //    refs/changes/00/14700/1
   288    //    refs/changes/00/14700/meta
   289    //    refs/meta/config
   290    string ref = 1;
   291  
   292    // sha1 is the lowercase hex sha1
   293    string sha1 = 2;
   294  }