blob: 68a2c7f6a6921573b40ffb850f88facf79f65761 [file] [log] [blame]
// Copyright 2022 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package listener;
import "validate/validate.proto";
option go_package = "go.chromium.org/luci/cv/settings/listener;listenerpb";
// Settings defines fields for configuring listener settings.
message Settings {
message ReceiveSettings {
// The number of goroutines that Listener will spawn for the subscription.
//
// 10, if unset.
//
// This doesn't limit the number of buffered messages that are waiting to
// be processed or are being processed.
//
// Use max_outstanding_messages to limit he number of buffered messages.
uint64 num_goroutines = 1;
// The maximum number of unacknowledged but not yet expired messages.
//
// 1000, if unset.
// If < 0, there will be no limit.
int64 max_outstanding_messages = 2;
}
message GerritSubscription {
// The Gerrit host w/o scheme.
// For example, chromium-review.googlesource.com
string host = 1 [(validate.rules).string = {
min_len: 1
not_contains: "/"
}];
// The subscription ID of the host. If unset, `host` is the subscription ID.
//
// Note that this is subscription ID, not subscription name.
// Subscription name is the full path of a subscription in the format of
// projects/$project/subscription/$sub_id.
string subscription_id = 2;
// Configuration for the pubsub receive function.
ReceiveSettings receive_settings = 3;
enum MessageFormat {
MESSAGE_FORMAT_UNSPECIFIED = 0;
JSON = 1;
PROTO_BINARY = 2;
}
// The format of the pubsub payload.
//
// Must not be MESSAGE_FORMAT_UNSPECIFIED.
MessageFormat message_format = 4;
}
// Subscriptions for the Gerrit hosts that have enabled Gerrit Pub/Sub.
//
// To enable Gerrit pub/sub for a given LUCI project, the subscription of
// all the Gerrit hosts listed in the project config must be added in this
// field. If not, the config validation will fail.
repeated GerritSubscription gerrit_subscriptions = 1;
// If a LUCI Project matches any of the regexps, CV will use the pubsub
// listener to find changes in the Gerrit hosts listed in the project config.
//
// If not, CV will use the incremental poller to find changes in the Gerrit
// hosts.
repeated string enabled_project_regexps = 2 [deprecated=true];
// If a LUCI Project matches any of the regexps, CV will not use the pubsub
// listener to find changes in the Gerrit hosts listed in the project config.
//
// Instead, CV will use the incremental poller to find changes from the Gerrit
// hosts.
repeated string disabled_project_regexps = 3;
}