diff options
Diffstat (limited to 'controller-server')
5 files changed, 28 insertions, 19 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java index 53c78d7c8ec..8dbec87828a 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java @@ -5,9 +5,9 @@ import com.google.common.hash.Funnel; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; import com.yahoo.component.Version; -import com.yahoo.compress.ArchiveStreamReader; -import com.yahoo.compress.ArchiveStreamReader.ArchiveFile; -import com.yahoo.compress.ArchiveStreamReader.Options; +import com.yahoo.vespa.archive.ArchiveStreamReader; +import com.yahoo.vespa.archive.ArchiveStreamReader.ArchiveFile; +import com.yahoo.vespa.archive.ArchiveStreamReader.Options; import com.yahoo.config.application.FileSystemWrapper; import com.yahoo.config.application.FileSystemWrapper.FileWrapper; import com.yahoo.config.application.XmlPreProcessor; @@ -27,7 +27,6 @@ import com.yahoo.vespa.hosted.controller.deployment.ZipBuilder; import com.yahoo.yolean.Exceptions; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.file.NoSuchFileException; @@ -38,7 +37,6 @@ import java.time.Duration; import java.time.Instant; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ZipEntries.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ZipEntries.java index 185c97f866e..d22a41f74a4 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ZipEntries.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ZipEntries.java @@ -1,27 +1,18 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.application.pkg; -import com.yahoo.compress.ArchiveStreamReader; -import com.yahoo.compress.ArchiveStreamReader.ArchiveFile; -import com.yahoo.compress.ArchiveStreamReader.Options; +import com.yahoo.vespa.archive.ArchiveStreamReader; +import com.yahoo.vespa.archive.ArchiveStreamReader.ArchiveFile; +import com.yahoo.vespa.archive.ArchiveStreamReader.Options; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UncheckedIOException; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Objects; import java.util.Optional; import java.util.function.Predicate; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; /** * A list of entries read from a ZIP archive, and their contents. diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notifier.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notifier.java index 526bf0c53b3..64dd51ce304 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notifier.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/notification/Notifier.java @@ -138,6 +138,7 @@ public class Notifier { .map(Notifier::linkify) .map(m -> "<li>" + m + "</li>") .collect(Collectors.joining())) + .replace("[[LINK_TO_NOTIFICATION]]", notificationLink(notification.source())) .replace("[[LINK_TO_ACCOUNT_NOTIFICATIONS]]", accountNotificationsUri(content.notification().source().tenant())) .replace("[[LINK_TO_PRIVACY_POLICY]]", "https://legal.yahoo.com/xw/en/yahoo/privacy/topic/b2bprivacypolicy/index.html") .replace("[[LINK_TO_TERMS_OF_SERVICE]]", consoleUri("terms-of-service-trial.html")) @@ -170,4 +171,23 @@ public class Notifier { return new UriBuilder(dashboardUri).append(path).toString(); } + private String notificationLink(NotificationSource source) { + var uri = new UriBuilder(dashboardUri); + uri = uri.append("tenant").append(source.tenant().value()); + if (source.application().isPresent()) + uri = uri.append("application").append(source.application().get().value()); + if (source.isProduction()) { + uri = uri.append("prod/instance"); + if (source.jobType().isPresent()) { + uri = uri.append(source.instance().get().value()); + } + } + else { + uri = uri.append("dev/instance/").append(source.instance().get().value()); + } + if (source.jobType().isPresent()) { + uri = uri.append("job").append(source.jobType().get().jobName()).append("run").append(String.valueOf(source.runNumber().getAsLong())); + } + return uri.toString(); + } } diff --git a/controller-server/src/main/resources/mail/mail-notification.tmpl b/controller-server/src/main/resources/mail/mail-notification.tmpl index 868a3a76bab..8c02c05723f 100644 --- a/controller-server/src/main/resources/mail/mail-notification.tmpl +++ b/controller-server/src/main/resources/mail/mail-notification.tmpl @@ -486,7 +486,7 @@ valign="middle" > <a - href="#" + href="[[LINK_TO_NOTIFICATION]]" style=" display: inline-block; background: #005a8e; diff --git a/controller-server/src/test/resources/mail/notification.txt b/controller-server/src/test/resources/mail/notification.txt index 5ca26cb4753..9f1583d7674 100644 --- a/controller-server/src/test/resources/mail/notification.txt +++ b/controller-server/src/test/resources/mail/notification.txt @@ -486,7 +486,7 @@ valign="middle" > <a - href="#" + href="https://dashboard.tld/tenant/tenant1/application/default/prod/instance" style=" display: inline-block; background: #005a8e; |