summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-05-09 16:40:01 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-05-09 16:40:01 +0200
commitfdc5bf6d20317d158dcb05b927e73716254c1310 (patch)
tree0beeeb034446795f91a3cd38d41230f9793b19d2 /controller-api
parentf1bc55d4a00a5f7fb449139aee46a2a8d4286de7 (diff)
Replace ScrewdriverBuildJob with a boolean
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/DeployOptions.java11
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/GitRevision.java55
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ScrewdriverBuildJob.java47
-rw-r--r--controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/DeployOptionsTest.java4
4 files changed, 7 insertions, 110 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/DeployOptions.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/DeployOptions.java
index 31280076de4..255684d0b66 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/DeployOptions.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/DeployOptions.java
@@ -14,18 +14,17 @@ import java.util.Optional;
@JsonIgnoreProperties(ignoreUnknown = true)
public class DeployOptions {
- // TODO: Add build number here, so we can replace job timeout (12 hours) with triggering timeout (a few minutes?)
- public final Optional<ScrewdriverBuildJob> screwdriverBuildJob;
+ public final boolean deployDirectly;
public final Optional<String> vespaVersion;
public final boolean ignoreValidationErrors;
public final boolean deployCurrentVersion;
@JsonCreator
- public DeployOptions(@JsonProperty("screwdriverBuildJob") Optional<ScrewdriverBuildJob> screwdriverBuildJob,
+ public DeployOptions(@JsonProperty("deployDirectly") boolean deployDirectly,
@JsonProperty("vespaVersion") Optional<Version> vespaVersion,
@JsonProperty("ignoreValidationErrors") boolean ignoreValidationErrors,
@JsonProperty("deployCurrentVersion") boolean deployCurrentVersion) {
- this.screwdriverBuildJob = screwdriverBuildJob;
+ this.deployDirectly = deployDirectly;
this.vespaVersion = vespaVersion.map(Version::toString);
this.ignoreValidationErrors = ignoreValidationErrors;
this.deployCurrentVersion = deployCurrentVersion;
@@ -34,7 +33,7 @@ public class DeployOptions {
@Override
public String toString() {
return "DeployData{" +
- "screwdriverBuildJob=" + screwdriverBuildJob.map(ScrewdriverBuildJob::toString).orElse("None") +
+ "deployDirectly=" + deployDirectly +
", vespaVersion=" + vespaVersion.orElse("None") +
", ignoreValidationErrors=" + ignoreValidationErrors +
", deployCurrentVersion=" + deployCurrentVersion +
@@ -42,6 +41,6 @@ public class DeployOptions {
}
public static DeployOptions none() {
- return new DeployOptions(Optional.empty(), Optional.empty(), false, false);
+ return new DeployOptions(false, Optional.empty(), false, false);
}
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/GitRevision.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/GitRevision.java
deleted file mode 100644
index 317da739103..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/GitRevision.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.application.v4.model;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.yahoo.vespa.hosted.controller.api.identifiers.GitBranch;
-import com.yahoo.vespa.hosted.controller.api.identifiers.GitCommit;
-import com.yahoo.vespa.hosted.controller.api.identifiers.GitRepository;
-
-import java.util.Objects;
-
-/**
- * @author gv
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class GitRevision {
-
- public final GitRepository repository;
- public final GitBranch branch;
- public final GitCommit commit;
-
- @JsonCreator
- public GitRevision(@JsonProperty("repository") GitRepository repository,
- @JsonProperty("branch") GitBranch branch,
- @JsonProperty("commit") GitCommit commit) {
- this.repository = repository;
- this.branch = branch;
- this.commit = commit;
- }
-
- @Override
- public String toString() {
- return "GitRevision{" +
- "repository=" + repository +
- ", branch=" + branch +
- ", commit=" + commit +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- GitRevision that = (GitRevision) o;
- return Objects.equals(repository, that.repository) &&
- Objects.equals(branch, that.branch) &&
- Objects.equals(commit, that.commit);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(repository, branch, commit);
- }
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ScrewdriverBuildJob.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ScrewdriverBuildJob.java
deleted file mode 100644
index 032b97c5424..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ScrewdriverBuildJob.java
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.application.v4.model;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.yahoo.vespa.hosted.controller.api.identifiers.ScrewdriverId;
-
-import java.util.Objects;
-
-/**
- * @author gjoranv
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ScrewdriverBuildJob {
- public final ScrewdriverId screwdriverId;
- public final GitRevision gitRevision;
-
- @JsonCreator
- public ScrewdriverBuildJob(@JsonProperty("screwdriverId") ScrewdriverId screwdriverId,
- @JsonProperty("gitRevision") GitRevision gitRevision) {
- this.screwdriverId = screwdriverId;
- this.gitRevision = gitRevision;
- }
-
- @Override
- public String toString() {
- return "ScrewdriverBuildJob{" +
- "screwdriverId=" + screwdriverId +
- ", gitRevision=" + gitRevision +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- ScrewdriverBuildJob that = (ScrewdriverBuildJob) o;
- return Objects.equals(screwdriverId, that.screwdriverId) &&
- Objects.equals(gitRevision, that.gitRevision);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(screwdriverId, gitRevision);
- }
-}
diff --git a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/DeployOptionsTest.java b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/DeployOptionsTest.java
index 4a02fe23dec..a97fde0a6d6 100644
--- a/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/DeployOptionsTest.java
+++ b/controller-api/src/test/java/com/yahoo/vespa/hosted/controller/api/identifiers/DeployOptionsTest.java
@@ -20,12 +20,12 @@ public class DeployOptionsTest {
@Test
public void it_serializes_version() throws IOException {
- DeployOptions options = new DeployOptions(Optional.empty(), Optional.of(new Version("6.98.227")), false, false);
+ DeployOptions options = new DeployOptions(false, Optional.of(new Version("6.98.227")), false, false);
final ObjectMapper objectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.registerModule(new Jdk8Module());
String string = objectMapper.writeValueAsString(options);
- assertEquals("{\"screwdriverBuildJob\":null,\"vespaVersion\":\"6.98.227\",\"ignoreValidationErrors\":false,\"deployCurrentVersion\":false}", string);
+ assertEquals("{\"deployDirectly\":false,\"vespaVersion\":\"6.98.227\",\"ignoreValidationErrors\":false,\"deployCurrentVersion\":false}", string);
}
}