From 6aa568e663422e870c708fc0d3a57bdeb06fe89e Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Tue, 15 Aug 2023 17:06:54 +0200 Subject: [PATCH] resolves #1606 upgrade PlantUML to 1.2023.10 (#1615) --- docs/antora.yml | 4 +-- server/README.adoc | 6 ++-- server/ops/docker/jdk11-jammy/Dockerfile | 4 +-- .../io/kroki/server/service/Plantuml.java | 2 +- .../server/DownloadPlantumlNativeImage.java | 2 +- .../server/service/PlantumlServiceTest.java | 28 ++++++++++++++++--- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/docs/antora.yml b/docs/antora.yml index 23ade272e..122cd1f9b 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -7,7 +7,7 @@ asciidoc: blockdiag-version: 3.1.0 bpmn-version: 13.2.0 bytefield-version: 1.8.0 - c4plantuml-version: 1.2023.7 + c4plantuml-version: 1.2023.10 d2-version: 0.5.1 dbml-version: 1.0.26 diagramsnet-version: 16.2.4 @@ -20,7 +20,7 @@ asciidoc: nwdiag-version: 3.1.0 packetdiag-version: 3.1.0 pikchr-version: '7269f78c4a' - plantuml-version: 1.2023.7 + plantuml-version: 1.2023.10 rackdiag-version: 3.1.0 seqdiag-version: 3.1.0 structurizr-version: 1.32.0 diff --git a/server/README.adoc b/server/README.adoc index aa0814585..4983a66b1 100644 --- a/server/README.adoc +++ b/server/README.adoc @@ -18,12 +18,12 @@ When a new version is available, we need to : === PlantUML -We are producing native binaries with GraalVM: https://github.com/ggrossetie/plantuml/releases +We are producing native binaries with GraalVM: https://github.com/yuzutech/plantuml/releases When a new version is available, we need to: . update the fork -. run the following workflow: https://github.com/ggrossetie/plantuml/actions/workflows/native-image-on-demand.yml +. run the following workflow: https://github.com/yuzutech/plantuml/actions/workflows/native-image-on-demand.yml . update the argument variable `ARG PLANTUML_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile` === UMLet @@ -34,4 +34,4 @@ When a new version is available, we need to: . update the fork . run the following workflow: https://github.com/yuzutech/umlet/actions/workflows/release.yml -. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile` \ No newline at end of file +. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk11-jammy/Dockerfile` diff --git a/server/ops/docker/jdk11-jammy/Dockerfile b/server/ops/docker/jdk11-jammy/Dockerfile index 7f126b02e..30a7138b3 100644 --- a/server/ops/docker/jdk11-jammy/Dockerfile +++ b/server/ops/docker/jdk11-jammy/Dockerfile @@ -235,7 +235,7 @@ RUN SVGBOB_VERSION=`cat Cargo.toml | grep "svgbob_cli =" | sed -r 's/.*"([^"]+)" FROM eclipse-temurin:11.0.19_7-jre-jammy ARG D2_VERSION="0.5.1" -ARG PLANTUML_VERSION="1.2023.7" +ARG PLANTUML_VERSION="1.2023.10" ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" ARG GRAPHVIZ_VERSION="8.0.5" ARG DITAA_VERSION="1.0.3" @@ -289,7 +289,7 @@ RUN wget "https://github.com/terrastruct/d2/releases/download/v${D2_VERSION}/d2- mv usr/bin/d2-v${D2_VERSION}/bin/d2 /usr/bin/d2 && \ chmod +x /usr/bin/d2 -RUN wget "https://github.com/ggrossetie/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-linux-${TARGETARCH}-${PLANTUML_VERSION}" -O /usr/bin/plantuml && \ +RUN wget "https://github.com/yuzutech/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-linux-${TARGETARCH}-${PLANTUML_VERSION}" -O /usr/bin/plantuml && \ chmod +x /usr/bin/plantuml RUN wget "https://github.com/yuzutech/umlet/releases/download/${UMLET_VERSION}/umlet-linux-${TARGETARCH}" -O /usr/bin/umlet && \ diff --git a/server/src/main/java/io/kroki/server/service/Plantuml.java b/server/src/main/java/io/kroki/server/service/Plantuml.java index 68d742b11..92c46c25b 100644 --- a/server/src/main/java/io/kroki/server/service/Plantuml.java +++ b/server/src/main/java/io/kroki/server/service/Plantuml.java @@ -184,7 +184,7 @@ public SourceDecoder getSourceDecoder() { @Override public String getVersion() { - return "1.2023.7"; + return "1.2023.10"; } @Override diff --git a/server/src/test/java/io/kroki/server/DownloadPlantumlNativeImage.java b/server/src/test/java/io/kroki/server/DownloadPlantumlNativeImage.java index 3227ae129..b7c37f12b 100644 --- a/server/src/test/java/io/kroki/server/DownloadPlantumlNativeImage.java +++ b/server/src/test/java/io/kroki/server/DownloadPlantumlNativeImage.java @@ -10,7 +10,7 @@ public class DownloadPlantumlNativeImage { public static Future download(Vertx vertx) { String plantumlVersion = new Plantuml(vertx, new JsonObject()).getVersion(); - String downloadUrl = "https://github.com/ggrossetie/plantuml/releases/download/v" + plantumlVersion + "/plantuml-linux-amd64-" + plantumlVersion; + String downloadUrl = "https://github.com/yuzutech/plantuml/releases/download/v" + plantumlVersion + "/plantuml-linux-amd64-" + plantumlVersion; return DownloadNativeImage.download(vertx, downloadUrl, "PlantUML", "plantuml-linux-amd64-" + plantumlVersion).map(plantumlBinPath -> { JsonObject options = new JsonObject(); options.put("KROKI_PLANTUML_BIN_PATH", plantumlBinPath); diff --git a/server/src/test/java/io/kroki/server/service/PlantumlServiceTest.java b/server/src/test/java/io/kroki/server/service/PlantumlServiceTest.java index 34eb1cd6f..ee0be6f89 100644 --- a/server/src/test/java/io/kroki/server/service/PlantumlServiceTest.java +++ b/server/src/test/java/io/kroki/server/service/PlantumlServiceTest.java @@ -24,10 +24,7 @@ import java.io.InputStreamReader; import java.net.URISyntaxException; import java.nio.file.Paths; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -689,6 +686,29 @@ void should_use_specified_theme() throws IOException, InterruptedException { assertThat(stripComments(new String(convert))).isEqualTo(read(expectedFileName)); } + @Test + void should_include_awslib() throws IOException, InterruptedException { + String diagram = "!include \n" + + "!include \n" + + "\n" + + "AWSAccountGroup(externalAccount, \"AWS account external\") {\n" + + "\n" + + "}"; + byte[] convert = plantumlCommand.convert(diagram, FileFormat.SVG, new JsonObject()); + assertThat(new String(convert)).contains("xlink:href=\"data:image/png;base64,"); + } + + @Test + void should_include_openiconic() throws IOException, InterruptedException { + String diagram = "listopeniconic"; + byte[] convert = plantumlCommand.convert(diagram, FileFormat.SVG, new JsonObject()); + System.out.println(new String(convert)); + Pattern pattern = Pattern.compile("