go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/settings/listener/settings.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 syntax = "proto3"; 15 16 package listener; 17 18 import "validate/validate.proto"; 19 20 option go_package = "go.chromium.org/luci/cv/settings/listener;listenerpb"; 21 22 // Settings defines fields for configuring listener settings. 23 message Settings { 24 message ReceiveSettings { 25 // The number of goroutines that Listener will spawn for the subscription. 26 // 27 // 10, if unset. 28 // 29 // This doesn't limit the number of buffered messages that are waiting to 30 // be processed or are being processed. 31 // 32 // Use max_outstanding_messages to limit he number of buffered messages. 33 uint64 num_goroutines = 1; 34 35 // The maximum number of unacknowledged but not yet expired messages. 36 // 37 // 1000, if unset. 38 // If < 0, there will be no limit. 39 int64 max_outstanding_messages = 2; 40 } 41 42 message GerritSubscription { 43 // The Gerrit host w/o scheme. 44 // For example, chromium-review.googlesource.com 45 string host = 1 [(validate.rules).string = { 46 min_len: 1 47 not_contains: "/" 48 }]; 49 50 // The subscription ID of the host. If unset, `host` is the subscription ID. 51 // 52 // Note that this is subscription ID, not subscription name. 53 // Subscription name is the full path of a subscription in the format of 54 // projects/$project/subscription/$sub_id. 55 string subscription_id = 2; 56 57 // Configuration for the pubsub receive function. 58 ReceiveSettings receive_settings = 3; 59 60 enum MessageFormat { 61 MESSAGE_FORMAT_UNSPECIFIED = 0; 62 JSON = 1; 63 PROTO_BINARY = 2; 64 } 65 // The format of the pubsub payload. 66 // 67 // Must not be MESSAGE_FORMAT_UNSPECIFIED. 68 MessageFormat message_format = 4; 69 } 70 71 // Subscriptions for the Gerrit hosts that have enabled Gerrit Pub/Sub. 72 // 73 // To enable Gerrit pub/sub for a given LUCI project, the subscription of 74 // all the Gerrit hosts listed in the project config must be added in this 75 // field. If not, the config validation will fail. 76 repeated GerritSubscription gerrit_subscriptions = 1; 77 // If a LUCI Project matches any of the regexps, CV will use the pubsub 78 // listener to find changes in the Gerrit hosts listed in the project config. 79 // 80 // If not, CV will use the incremental poller to find changes in the Gerrit 81 // hosts. 82 repeated string enabled_project_regexps = 2 [deprecated=true]; 83 // If a LUCI Project matches any of the regexps, CV will not use the pubsub 84 // listener to find changes in the Gerrit hosts listed in the project config. 85 // 86 // Instead, CV will use the incremental poller to find changes from the Gerrit 87 // hosts. 88 repeated string disabled_project_regexps = 3; 89 }