Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace JPEG by PDF for PlantUML, C4 PlantUML and Structurizr #1536

Merged
merged 4 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ci/tasks/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ try {
}
}

const d2GoModContent = await fs.readFile(ospath.join(rootDir, 'server', 'ops', 'docker', 'go.mod'), 'utf8')
for (const line of d2GoModContent.split('\n')) {
const d2VersionFound = line.match(/^require oss.terrastruct.com\/d2 v(?<version>.+)$/)
if (d2VersionFound) {
const { version } = d2VersionFound.groups
diagramLibraryVersions.d2 = version
}
}

const svgbobCargoContent = await fs.readFile(ospath.join(rootDir, 'server', 'ops', 'docker', 'Cargo.toml'), 'utf8')
for (const line of svgbobCargoContent.split('\n')) {
const svgbobVersionFound = line.match(/^svgbob_cli\s*=\s*"(?<version>.+)"$/)
Expand Down
7 changes: 4 additions & 3 deletions ci/tests/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const tests = [
{engine: 'seqdiag', file: 'sequence.diag', options: {}, outputFormat: ['svg', 'png']},
{engine: 'actdiag', file: 'actions.diag', options: {}, outputFormat: ['svg', 'png']},
{engine: 'nwdiag', file: 'network.diag', options: {}, outputFormat: ['svg', 'png']},
{engine: 'c4plantuml', file: 'banking-system.puml', options: {}, outputFormat: ['svg']},
{engine: 'c4plantuml', file: 'banking-system.puml', options: {}, outputFormat: ['svg', 'pdf', 'png', 'txt']},
{engine: 'dbml', file: 'dbml.dbml', options: {}, outputFormat: ['svg']},
{engine: 'ditaa', file: 'components.ditaa', options: {}, outputFormat: ['svg']},
{engine: 'erd', file: 'schema.erd', options: {}, outputFormat: ['svg']},
{engine: 'mermaid', file: 'contribute.mmd', options: {}, outputFormat: ['svg']},
{engine: 'bpmn', file: 'example.bpmn', options: {}, outputFormat: ['svg']},
{engine: 'plantuml', file: 'architecture.puml', options: {}, outputFormat: ['svg']},
{engine: 'plantuml', file: 'architecture.puml', options: {}, outputFormat: ['svg', 'pdf', 'png', 'txt']},
{engine: 'svgbob', file: 'cloud.bob', options: {}, outputFormat: ['svg']},
{engine: 'nomnoml', file: 'pirate.nomnoml', options: {}, outputFormat: ['svg']},
{engine: 'packetdiag', file: 'packet.diag', options: {}, outputFormat: ['svg', 'png']},
Expand Down Expand Up @@ -50,7 +50,8 @@ const mimeType = {
svg: 'image/svg+xml',
png: 'image/png',
pdf: 'application/pdf',
jpeg: 'image/jpeg'
jpeg: 'image/jpeg',
txt: 'text/plain'
}

const sendRequest = async (testCase, outputFormat) => {
Expand Down
1 change: 1 addition & 0 deletions server/ops/docker/jdk11-jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ ARG D2_VERSION="0.4.1"
ARG PLANTUML_VERSION="1.2023.6"
ARG UMLET_VERSION="2023-03-20_UMLet_v15.1"
ARG GRAPHVIZ_VERSION="8.0.4"
ARG GRAPHVIZ_VERSION="8.0.4"
ggrossetie marked this conversation as resolved.
Show resolved Hide resolved
ARG TARGETARCH

RUN addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/io/kroki/server/service/Plantuml.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class Plantuml implements DiagramService {
private static final Pattern START_BLOCK_RX = Pattern.compile("^(@start.*\\n)");

private static final Logger logger = LoggerFactory.getLogger(Plantuml.class);
private static final List<FileFormat> SUPPORTED_FORMATS = Arrays.asList(FileFormat.PNG, FileFormat.SVG, FileFormat.JPEG, FileFormat.BASE64, FileFormat.TXT, FileFormat.UTXT);
private static final List<FileFormat> SUPPORTED_FORMATS = Arrays.asList(FileFormat.PNG, FileFormat.SVG, FileFormat.PDF, FileFormat.BASE64, FileFormat.TXT, FileFormat.UTXT);
private static final Pattern STDLIB_PATH_RX = Pattern.compile("<([a-zA-Z0-9]+)/[^>]+>");

private final Vertx vertx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class Structurizr implements DiagramService {
private final PlantumlCommand plantumlCommand;

// same as PlantUML since we convert Structurizr DSL to PlantUML
private static final List<FileFormat> SUPPORTED_FORMATS = Arrays.asList(FileFormat.PNG, FileFormat.SVG, FileFormat.JPEG, FileFormat.BASE64, FileFormat.TXT, FileFormat.UTXT);
private static final List<FileFormat> SUPPORTED_FORMATS = Arrays.asList(FileFormat.PNG, FileFormat.SVG, FileFormat.PDF, FileFormat.BASE64, FileFormat.TXT, FileFormat.UTXT);

private static final String aws = read("structurizr/amazon-web-services.json");
private static final String gcp = read("structurizr/google-cloud-platform.json");
Expand Down