go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/proto/gerrit/source_repo_event.proto (about) 1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 syntax = "proto3"; 6 7 package gerrit; 8 9 import "google/protobuf/timestamp.proto"; 10 11 option go_package = "go.chromium.org/luci/common/proto/gerrit;gerritpb"; 12 13 // Cloud Pub/Sub message payload for all events in Source Repo API. 14 message SourceRepoEvent { 15 // The name of the repo that has changed. Values are of the form 16 // `projects/<project>/repos/<repo>`. 17 string name = 1; 18 19 // URL to clone the repository from Google Cloud Source Repositories. 20 string url = 2; 21 22 // An event that changed references. 23 message RefUpdateEvent { 24 // The user who performed the ref updates. 25 string email = 1; 26 27 // An update on a reference. 28 message RefUpdate { 29 // The name of the reference. Values are of the form `refs/...` (e.g. 30 // `refs/heads/master`). 31 string ref_name = 1; 32 33 // The type of the update. 34 enum UpdateType { 35 UPDATE_TYPE_UNSPECIFIED = 0; 36 // Create a new ref. 37 CREATE = 1; 38 // Update the object that the ref points to. 39 UPDATE_FAST_FORWARD = 2; 40 // Update the object that the ref points to forcibly. 41 UPDATE_NON_FAST_FORWARD = 3; 42 // Delete the ref. 43 DELETE = 4; 44 } 45 46 // The type of the update. 47 UpdateType update_type = 2; 48 49 // The previous object ID that the ref pointed to. 50 string old_id = 3; 51 52 // The new object ID that the ref points to. 53 string new_id = 4; 54 } 55 56 // Updates on references, keyed by the names of the references. 57 map<string, RefUpdate> ref_updates = 2; 58 } 59 60 // An event that created a repository. 61 message CreateRepoEvent { 62 } 63 64 // An event that deleted a repository. 65 message DeleteRepoEvent { 66 } 67 68 // The timestamp that this event happened. 69 google.protobuf.Timestamp event_time = 3; 70 71 // The detail data of the event. 72 oneof event { 73 RefUpdateEvent ref_update_event = 4; 74 CreateRepoEvent create_repo_event = 5; 75 DeleteRepoEvent delete_repo_event = 6; 76 } 77 }