Skip to content

Commit

Permalink
chore(triggers): add application and pipeline fields to Trigger (#532)
Browse files Browse the repository at this point in the history
These are used in pipeline triggers of type "pipeline". Since the Trigger
model did not know about these fields, it caused duplicate ids to be
generated for these triggers, and made debugging harder/toString less
useful.
  • Loading branch information
dreynaud authored Apr 23, 2019
1 parent d52a17a commit d6e85e3
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@JsonDeserialize(builder = Trigger.TriggerBuilder.class)
@Builder(toBuilder = true)
@Wither
@ToString(of = {"id", "parent", "type", "master", "job", "cronExpression", "source", "project", "slug", "account", "repository", "tag", "parameters", "payloadConstraints", "attributeConstraints", "branch", "runAsUser", "subscriptionName", "pubsubSystem", "expectedArtifactIds", "payload", "status", "artifactName", "link", "linkText"}, includeFieldNames = false)
@ToString(of = {"id", "parent", "type", "master", "job", "cronExpression", "source", "project", "slug", "account", "repository", "tag", "parameters", "payloadConstraints", "attributeConstraints", "branch", "runAsUser", "subscriptionName", "pubsubSystem", "expectedArtifactIds", "payload", "status", "artifactName", "link", "linkText", "application", "pipeline"}, includeFieldNames = false)
@Value
@EqualsAndHashCode(exclude = "parent")
public class Trigger {
Expand All @@ -48,7 +48,8 @@ public enum Type {
DOCKER("docker"),
WEBHOOK("webhook"),
PUBSUB("pubsub"),
DRYRUN("dryrun");
DRYRUN("dryrun"),
PIPELINE("pipeline");

private final String type;

Expand All @@ -68,10 +69,13 @@ public String toString() {
String type;
boolean enabled;

// Configuration for pipeline triggers
String parentPipelineId;
String parentPipelineApplication;

// Configuration for pipeline triggers
String application;
String pipeline;

// Configuration for git triggers
String project;
String slug;
Expand Down

0 comments on commit d6e85e3

Please sign in to comment.