aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-10-25 13:33:34 +0200
committerJon Marius Venstad <venstad@gmail.com>2019-11-05 09:57:57 +0100
commitefd8e1b51587ed04f8beeef7ccb60ff273c15b7a (patch)
tree472cd263113a4587c4c0ebfbe5bf082312003f1e
parent9c3b672a9dc9c7562d44709fba6a5950a2ff9f4c (diff)
Remove legacy notifications()
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java3
-rw-r--r--config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecDeprecatedAPITest.java30
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java2
3 files changed, 1 insertions, 34 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java
index 53f21354c3c..f4877fe3494 100644
--- a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java
+++ b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java
@@ -212,9 +212,6 @@ public class DeploymentSpec {
public Optional<AthenzService> athenzService() { return this.athenzService; }
// TODO: Remove after November 2019
- public Notifications notifications() { return singleInstance().notifications(); }
-
- // TODO: Remove after November 2019
public List<Endpoint> endpoints() { return singleInstance().endpoints(); }
/** Returns the XML form of this spec, or null if it was not created by fromXml, nor is empty */
diff --git a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecDeprecatedAPITest.java b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecDeprecatedAPITest.java
index 729fc4dc5af..738e4759b0a 100644
--- a/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecDeprecatedAPITest.java
+++ b/config-model-api/src/test/java/com/yahoo/config/application/api/DeploymentSpecDeprecatedAPITest.java
@@ -340,36 +340,6 @@ public class DeploymentSpecDeprecatedAPITest {
}
@Test
- public void noNotifications() {
- assertEquals(Notifications.none(),
- DeploymentSpec.fromXml("<deployment />").notifications());
- }
-
- @Test
- public void emptyNotifications() {
- DeploymentSpec spec = DeploymentSpec.fromXml("<deployment>\n" +
- " <notifications />" +
- "</deployment>");
- assertEquals(Notifications.none(),
- spec.notifications());
- }
-
- @Test
- public void someNotifications() {
- DeploymentSpec spec = DeploymentSpec.fromXml("<deployment>\n" +
- " <notifications when=\"failing\">\n" +
- " <email role=\"author\"/>\n" +
- " <email address=\"john@dev\" when=\"failing-commit\"/>\n" +
- " <email address=\"jane@dev\"/>\n" +
- " </notifications>\n" +
- "</deployment>");
- assertEquals(ImmutableSet.of(author), spec.notifications().emailRolesFor(failing));
- assertEquals(ImmutableSet.of(author), spec.notifications().emailRolesFor(failingCommit));
- assertEquals(ImmutableSet.of("john@dev", "jane@dev"), spec.notifications().emailAddressesFor(failingCommit));
- assertEquals(ImmutableSet.of("jane@dev"), spec.notifications().emailAddressesFor(failing));
- }
-
- @Test
public void customTesterFlavor() {
DeploymentSpec spec = DeploymentSpec.fromXml("<deployment>\n" +
" <test tester-flavor=\"d-1-4-20\" />\n" +
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
index ce5a2a8dd21..d0fbbe5c61f 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
@@ -580,7 +580,7 @@ public class InternalStepRunner implements StepRunner {
/** Sends a mail with a notification of a failed run, if one should be sent. */
private void sendNotification(Run run, DualLogger logger) {
Application application = controller.applications().requireApplication(TenantAndApplicationId.from(run.id().application()));
- Notifications notifications = application.deploymentSpec().notifications();
+ Notifications notifications = application.deploymentSpec().requireInstance(run.id().application().instance()).notifications();
boolean newCommit = application.change().application()
.map(run.versions().targetApplication()::equals)
.orElse(false);