Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: Add fields for Pub/Sub triggers (#211)
Browse files Browse the repository at this point in the history
* feat: Add fields for Pub/Sub triggers

Committer: @gleeper
PiperOrigin-RevId: 368533270

Source-Link: googleapis/googleapis@9a9e296

Source-Link: googleapis/googleapis-gen@3735c39

* 🦉 Updates from OwlBot

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Apr 16, 2021
1 parent ec8a8db commit 0cbc740
Show file tree
Hide file tree
Showing 6 changed files with 783 additions and 2 deletions.
62 changes: 62 additions & 0 deletions protos/google/devtools/cloudbuild/v1/cloudbuild.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ option (google.api.resource_definition) = {
type: "cloudkms.googleapis.com/CryptoKey"
pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}"
};
option (google.api.resource_definition) = {
type: "pubsub.googleapis.com/Subscription"
pattern: "projects/{project}/subscriptions/{subscription}"
};
option (google.api.resource_definition) = {
type: "pubsub.googleapis.com/Topic"
pattern: "projects/{project}/topics/{topic}"
};

// Creates and manages builds on Google Cloud Platform.
//
Expand Down Expand Up @@ -1021,6 +1029,10 @@ message BuildTrigger {
// Mutually exclusive with `trigger_template`.
GitHubEventsConfig github = 13;

// Optional. PubsubConfig describes the configuration of a trigger that
// creates a build whenever a Pub/Sub message is published.
PubsubConfig pubsub_config = 29 [(google.api.field_behavior) = OPTIONAL];

// Template describing the Build request to make when the trigger is matched.
oneof build_template {
// Contents of the build template.
Expand Down Expand Up @@ -1062,6 +1074,9 @@ message BuildTrigger {
// least one of those files matches a included_files glob. If not,
// then we do not trigger a build.
repeated string included_files = 16;

// Optional. A Common Expression Language string.
string filter = 30 [(google.api.field_behavior) = OPTIONAL];
}

// GitHubEventsConfig describes the configuration of a trigger that creates a
Expand Down Expand Up @@ -1092,6 +1107,53 @@ message GitHubEventsConfig {
}
}

// PubsubConfig describes the configuration of a trigger that
// creates a build whenever a Pub/Sub message is published.
message PubsubConfig {
// Enumerates potential issues with the underlying Pub/Sub subscription
// configuration.
enum State {
// The subscription configuration has not been checked.
STATE_UNSPECIFIED = 0;

// The Pub/Sub subscription is properly configured.
OK = 1;

// The subscription has been deleted.
SUBSCRIPTION_DELETED = 2;

// The topic has been deleted.
TOPIC_DELETED = 3;

// Some of the subscription's field are misconfigured.
SUBSCRIPTION_MISCONFIGURED = 4;
}

// Output only. Name of the subscription. Format is
// `projects/{project}/subscriptions/{subscription}`.
string subscription = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];

// The name of the topic from which this subscription is receiving messages.
// Format is `projects/{project}/topics/{topic}`.
string topic = 2 [
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
];

// Service account that will make the push request.
string service_account_email = 3 [(google.api.resource_reference) = {
type: "iam.googleapis.com/ServiceAccount"
}];

// Potential issues with the underlying Pub/Sub subscription configuration.
// Only populated on get requests.
State state = 4;
}

// PullRequestFilter contains filter properties for matching GitHub Pull
// Requests.
message PullRequestFilter {
Expand Down
132 changes: 132 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0cbc740

Please sign in to comment.