Skip to content

Commit

Permalink
Revert "fix(api): fix type mismatch regression with Pipeline boolean …
Browse files Browse the repository at this point in the history
…properties (#1046)"

This reverts commit b082bae.
  • Loading branch information
cristhian-castaneda committed Sep 29, 2021
1 parent a6d7926 commit 50abf78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Pipeline implements Timestamped {
private String lastModified;

@Getter @Setter private String email;
@Getter @Setter private String disabled;
@Getter @Setter private Boolean disabled;
@Getter @Setter private Map<String, Object> template;
@Getter @Setter private List<String> roles;
@Getter @Setter private String serviceAccount;
Expand All @@ -51,8 +51,8 @@ public class Pipeline implements Timestamped {
@Getter @Setter private List<Map<String, Object>> stages;
@Getter @Setter private Map<String, Object> constraints;
@Getter @Setter private Map<String, Object> payloadConstraints;
@Getter @Setter private String keepWaitingPipelines;
@Getter @Setter private String limitConcurrent;
@Getter @Setter private Boolean keepWaitingPipelines;
@Getter @Setter private Boolean limitConcurrent;
@Getter @Setter private List<Map<String, Object>> parameterConfig;
@Getter @Setter private String spelEvaluator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public abstract class PipelineMixins {
@JsonInclude(Include.NON_NULL)
@Getter
@Setter
private String disabled;
private Boolean disabled;

@JsonInclude(Include.NON_NULL)
@Getter
Expand Down Expand Up @@ -137,12 +137,12 @@ public abstract class PipelineMixins {
@JsonInclude(Include.NON_NULL)
@Getter
@Setter
private String keepWaitingPipelines;
private Boolean keepWaitingPipelines;

@JsonInclude(Include.NON_NULL)
@Getter
@Setter
private String limitConcurrent;
private Boolean limitConcurrent;

@JsonInclude(Include.NON_NULL)
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ class PipelineSpec extends Specification {
pipeline == pipelineJSON
}

def 'boolean properties should be strings'() {
given:
String pipelineJSON = '{"id":"1","schema":"1","triggers":[],"disabled":"true","keepWaitingPipelines":"true","limitConcurrent":"true"}'
Pipeline pipelineObj = objectMapper.readValue(pipelineJSON, Pipeline.class)
String pipeline = objectMapper.writeValueAsString(pipelineObj)

expect:
pipeline == pipelineJSON
}

def 'should grab triggers after deserializing JSON into Pipeline'() {
given:
String pipelineJSON = '{"triggers": [{"type": "cron", "id": "a"}, {"type": "cron", "id": "b"}]}'
Expand Down

0 comments on commit 50abf78

Please sign in to comment.