go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/api/config/legacy/tricium.proto (about)

     1  // Copyright 2016 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package cv.legacy.tricium;
    18  
    19  option go_package = "go.chromium.org/luci/cv/api/config/legacy;tricium";
    20  
    21  // Tricium project configuration.
    22  //
    23  // Specifies details needed to connect a project to Tricium.
    24  // Adds project-specific functions and selects shared function
    25  // implementations.
    26  message ProjectConfig {
    27    // Analyzer definitions.
    28    //
    29    // Each analyzer generally corresponds to one builder.
    30    repeated Function functions = 1;
    31    // Selection of function implementations to run for this project.
    32    //
    33    // An analyzer is only enabled if there is a selections entry. Generally all
    34    // defined functions are listed as selections. Note that the function
    35    // (analyzer) name must match.
    36    repeated Selection selections = 2;
    37    // Repositories, including Gerrit details.
    38    repeated RepoDetails repos = 3;
    39    // General service account for this project.
    40    string service_account = 4;
    41  }
    42  
    43  // Tricium analyzer definition.
    44  message Function {
    45    enum Type {
    46      NONE     = 0;
    47      ANALYZER = 1;
    48    }
    49    // The type of this function. Required.
    50    //
    51    // Should always be ANALYZER.
    52    Type type = 1;
    53    // The name of the analyzer. Required.
    54    //
    55    // The name must be unique among Tricium functions within a Tricium instance.
    56    // The name is expected to be CamelCase; no spaces, underscores or dashes are
    57    // allowed.
    58    string name = 2;
    59    // Data needed by this analyzer. Required.
    60    //
    61    // Should always be GIT_FILE_DETAILS.
    62    DataType needs = 3;
    63    // Data provided by this analyzer. Required.
    64    //
    65    // Should always be RESULTS.
    66    DataType provides = 4;
    67    // Path filters for this analyzer.
    68    //
    69    // Defined as a glob. The path filters only apply to the last part of the
    70    // path.
    71    repeated string path_filters = 5; // Default: "*"
    72    // Function implementations.
    73    //
    74    // Originally the idea was that an analyzer may run on many different
    75    // platforms and the comments from different platforms may be merged.
    76    //
    77    // This was not done in practice, so the number of impls should always be one.
    78    repeated Impl impls = 6;
    79  }
    80  
    81  // Analyzer implementation.
    82  message Impl {
    83    Platform provides_for_platform = 1;
    84    // The platform to run this implementation on.
    85    //
    86    // This particular value of this field isn't significant, because
    87    // the platform is determined by the builder.
    88    Platform runtime_platform = 2;
    89    // Recipe for recipe-based implementation.
    90    Recipe recipe = 3;
    91  }
    92  
    93  // Specification of a recipe for a recipe-based analyzer.
    94  message Recipe {
    95    // Project ID, e.g. "chromium".
    96    string project = 1;
    97    // Bucket name, e.g. "try".
    98    string bucket = 2;
    99    // Builder name, e.g. "linux-rel".
   100    string builder = 3;
   101  }
   102  
   103  // Selection of function implementations to run for a project.
   104  message Selection {
   105    // Name of function to run.
   106    string function = 1;
   107    // Name of platform to retrieve results from.
   108    Platform platform = 2;
   109  }
   110  
   111  // All supported data types.
   112  enum DataType {
   113    NONE = 0;
   114    GIT_FILE_DETAILS = 1;
   115    RESULTS = 2;
   116  }
   117  
   118  enum Platform {
   119    UNSPECIFIED = 0;
   120    LINUX = 1;
   121  }
   122  
   123  // Repository details for one repository.
   124  message RepoDetails {
   125    // Specifies a Gerrit project and its corresponding git repo.
   126    message GerritProject {
   127      // The Gerrit host to connect to.
   128      //
   129      // Value must not include the schema part; it will be assumed to be "https".
   130      string host = 1;
   131      // Gerrit project name.
   132      string project = 2;
   133      // Full URL for the corresponding git repo.
   134      string git_url = 3;
   135    }
   136    GerritProject gerrit_project = 1;
   137    // Whitelisted groups.
   138    //
   139    // The owner of a change will be checked for membership of a whitelisted
   140    // group. Absence of this field means all groups are whitelisted.
   141    //
   142    // Group names must be known to the Chrome infra auth service,
   143    // https://chrome-infra-auth.appspot.com. Contact a Chromium trooper
   144    // if you need to add or modify a group: g.co/bugatrooper.
   145    repeated string whitelisted_group = 7;
   146  
   147    // Whether we want to process REWORK changes (code changes), or all of them
   148    // including rebases and changes in the commit message (default run only
   149    // on REWORK). Check all the types at:
   150    // https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#revision-info
   151    bool check_all_revision_kinds = 8;
   152  }