go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/proto/v1/projects.proto (about) 1 // Copyright 2022 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 luci.analysis.v1; 18 19 option go_package = "go.chromium.org/luci/analysis/proto/v1;analysispb"; 20 21 import "go.chromium.org/luci/analysis/proto/v1/project.proto"; 22 23 // Provides methods to access the projects which are using LUCI Analysis. 24 service Projects { 25 // Gets LUCI Analysis configuration for a LUCI Project. 26 // 27 // RPC desigend to comply with https://google.aip.dev/131. 28 rpc GetConfig(GetProjectConfigRequest) returns (ProjectConfig) {}; 29 30 // Lists LUCI Projects visible to the user. 31 // 32 // RPC compliant with https://google.aip.dev/132. 33 // This RPC is incomplete. Future breaking changes are 34 // expressly flagged. 35 rpc List(ListProjectsRequest) returns (ListProjectsResponse) {}; 36 } 37 38 // A request object with data to fetch the list of projects configured 39 // in LUCI Analysis. 40 message ListProjectsRequest {} 41 42 // A response containing the list of projects which are are using 43 // LUCI Analysis. 44 message ListProjectsResponse { 45 // The list of projects using LUCI Analysis. 46 repeated Project projects = 1; 47 } 48 49 message GetProjectConfigRequest { 50 // The name of the project configuration to retrieve. 51 // Format: projects/{project}/config. 52 string name = 1; 53 } 54 55 message ProjectConfig { 56 reserved 2, 3, 4, 5; // Deleted 57 58 // Resource name of the project configuration. 59 // Format: projects/{project}/config. 60 // See also https://google.aip.dev/122. 61 string name = 1; 62 63 // Configuration for automatic bug management. 64 BugManagement bug_management = 6; 65 } 66 67 // Settings related to bug management. 68 message BugManagement { 69 // The set of policies which control the (re-)opening, closure and 70 // prioritization of bugs under the control of LUCI Analysis. 71 repeated BugManagementPolicy policies = 1; 72 73 // Monorail-specific bug filing configuration. 74 MonorailProject monorail = 2; 75 } 76 77 // A bug management policy in LUCI Analysis. 78 // 79 // Bug management policies control when and how bugs are automatically 80 // opened, prioritised, and verified as fixed. Each policy has a user-visible 81 // identity in the UI and can post custom instructions on the bug. 82 // 83 // LUCI Analysis avoids filing multiple bugs for the same failures by 84 // allowing multiple policies to activate on the same failure association 85 // rule. The bug associated with a rule will only be verified if all policies 86 // have de-activated. 87 message BugManagementPolicy { 88 // A unique identifier for the bug management policy. 89 // 90 // Policies are stateful in that LUCI Analysis tracks which bugs have met the 91 // activation condition on the policy (and not since met the deactivation 92 // condition). 93 // 94 // Changing this value changes the identity of the policy and hence results in 95 // the activation state for the policy being lost for all bugs. 96 // 97 // Valid syntax: ^[a-z]([a-z0-9-]{0,62}[a-z0-9])?$. (Syntax designed to comply 98 // with google.aip.dev/122 for resource IDs.) 99 string id = 1; 100 101 // The owners of the policy, who can be contacted if there are issues/concerns 102 // about the policy. Each item in the list should be an @google.com email 103 // address. At least one owner (preferably a group) is required. 104 repeated string owners = 6; 105 106 // A short one-line description for the problem the policy identifies, which 107 // will appear on the UI and in bugs comments. This is a sentence fragment 108 // and not a sentence, so please do NOT include a full stop and or starting 109 // capital letter. 110 // 111 // For example, "test variant(s) are being exonerated in presubmit". 112 string human_readable_name = 2; 113 114 // The priority of the problem this policy defines. 115 // 116 // If: 117 // - the priority of the bug associated with a rule 118 // differs from this priority, and 119 // - the policy is activate on the rule (see `metrics`), and 120 // - LUCI Analysis is controlling the priority of the bug 121 // (the "Update bug priority" switch on the rule is enabled), 122 // the priority of the bug will be updated to match this priority. 123 // 124 // Where are there multiple policies active on the same rule, 125 // the highest priority (of all active policies) will be used. 126 // 127 // For monorail projects, the buganizer priority will be converted to the 128 // equivalent monorail priority (P0 is converted to Pri-0, P1 to Pri-1, 129 // P2 to Pri-2, etc.) until monorail is turned down. 130 BuganizerPriority priority = 3; 131 132 // The set of metrics which will control activation of the bug-filing policy. 133 // If a policy activates on a suggested cluster, a new bug will be filed. 134 // If a policy activates on an existing rule cluster, the bug will be 135 // updated. 136 // 137 // The policy will activate if the activation threshold is met on *ANY* 138 // metric, and will de-activate only if the deactivation threshold is met 139 // on *ALL* metrics. 140 // 141 // Activation on suggested clusters will be based on the metric values after 142 // excluding failures for which a bug has already been filed. This is to 143 // avoid duplicate bug filing. 144 repeated Metric metrics = 4; 145 146 // A metric used to control activation of a bug-filing policy. 147 message Metric { 148 // The identifier of the metric. 149 // 150 // Full list of available metrics here: 151 // https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/internal/analysis/metrics/metrics.go 152 string metric_id = 1; 153 154 // The level at which the policy activates. Activation occurs if the 155 // cluster impact meets or exceeds this threshold. 156 // MUST imply deactivation_threshold. 157 MetricThreshold activation_threshold = 2; 158 159 // The minimum metric level at which the policy remains active. 160 // Deactivation occcurs if the cluster impact is below the de-activation 161 // threshold. Deactivation_threshold should be set significantly lower 162 // than activation_threshold to prevent policies repeatedly activating 163 // and deactivating due to noise in the data, e.g. less tests executed 164 // on weekends. 165 MetricThreshold deactivation_threshold = 3; 166 } 167 168 // Expanatory text of the problem the policy identified, shown on the 169 // user interface when the user requests more information. Required. 170 Explanation explanation = 5; 171 172 // Content displayed on the user interface, to explain the problem and 173 // guide a developer to fix it. 174 message Explanation { 175 // A longer human-readable description of the problem this policy 176 // has identified, in HTML. 177 // 178 // For example, "Test variant(s) in this cluster are being exonerated 179 // (ignored) in presubmit because they are too flaky or failing. This 180 // means they are no longer effective at preventing the breakage of 181 // the functionality the test(s) cover.". 182 // 183 // MUST be sanitised by UI before rendering. Sanitisation is only 184 // required to support simple uses of the following tags: ul, li, a. 185 string problem_html = 1; 186 187 // A description of how a human should go about trying to fix the 188 // problem, in HTML. 189 // 190 // For example, "<ul> 191 // <li>View recent failures</li> 192 // <li><a href="http://goto.google.com/demote-from-cq">Demote</a> the test from CQ</li> 193 // </ul>" 194 // 195 // MUST be sanitised by UI before rendering. Sanitisation is only 196 // required to support simple uses of the following tags: ul, li, a. 197 string action_html = 2; 198 } 199 } 200 201 // This enum represents the Buganizer priorities. 202 // It is equivalent to the one in Buganizer API. 203 enum BuganizerPriority { 204 // Priority unspecified; do not use this value. 205 BUGANIZER_PRIORITY_UNSPECIFIED = 0; 206 // P0, Highest priority. 207 P0 = 1; 208 P1 = 2; 209 P2 = 3; 210 P3 = 4; 211 P4 = 5; 212 } 213 214 // MonorailProject describes the configuration to use when filing bugs 215 // into a given monorail project. 216 message MonorailProject { 217 reserved 3; // Deleted. 218 219 // The monorail project being described. 220 // E.g. "chromium". 221 string project = 1; 222 223 // The prefix that should appear when displaying bugs from the 224 // given bug tracking system. E.g. "crbug.com" or "fxbug.dev". 225 // If no prefix is specified, only the bug number will appear. 226 // Otherwise, the supplifed prefix will appear, followed by a 227 // forward slash ("/"), followed by the bug number. 228 // Valid prefixes match `^[a-z0-9\-.]{0,64}$`. 229 string display_prefix = 2; 230 } 231 232 // MetricThreshold specifies thresholds for a particular metric. 233 // The threshold is considered satisfied if any of the individual metric 234 // thresholds is met or exceeded (i.e. if multiple thresholds are set, they 235 // are combined using an OR-semantic). If no threshold is set, the threshold 236 // as a whole is unsatisfiable. 237 message MetricThreshold { 238 // The threshold for one day. 239 optional int64 one_day = 1; 240 241 // The threshold for three day. 242 optional int64 three_day = 2; 243 244 // The threshold for seven days. 245 optional int64 seven_day = 3; 246 }