Structurizr CLI fails to properly push a workspace
aizzi opened this issue · 6 comments
HOW TO REPRODUCE
- Pull the latest CLI container
REPOSITORY TAG IMAGE ID CREATED SIZE
structurizr/cli latest f5607bde3feb 5 weeks ago 823MB
- Create the following structure
.
├── architecture
│ ├── decisions
│ │ ├── 0001-record-architecture-decisions.md
│ │ └── 0002-second-decision.md
│ ├── documentation
│ │ ├── general
│ │ │ └── 01-introduction.md
│ │ └── system01
│ │ └── 01-introduction.md
│ ├── workspace.dsl
│ └── workspace.json
- Create a simple workspace (note the multiple
!docs
statement)
workspace "Push Test" "A dummy workspace to test the push feature" {
!docs documentation/general
!adrs decisions
model {
ss_system01 = softwareSystem "System 01" {
!docs documentation/system01
description "A dummy system to test the documentation"
}
}
views {
theme default
systemLandscape "dgm01" "This is the landscape diagram" {
title "DGM01: Landscape"
include *
autolayout "lr"
}
}
}
- Create the documentation file
documentation/general/01-introduction.md
## General Documentation
This is an example of general documentation
- Create the documentation file
documentation/system01/01-introduction.md
## Introduction
This is the documentation for the System01
-
Create two decisions using the
adr
tool -
Start
Structurizr Lite
. The workspace, the documentation and the decisions are rendered properly locally -
Now create a new workspace in the
Structurizr Cloud
and push theworkspace.json
to it (the command is executed from the root of the filesystem):
~/SourceCode/structurizr-test$ docker run -it --rm -v $PWD:/usr/local/structurizr structurizr/cli push -workspace architecture/workspace.json -id ##### -key ########-####-#########-############ -secret ########-####-####-####-############
Pushing workspace 73119 to https://api.structurizr.com
- creating new workspace
- parsing model and views from /usr/local/structurizr/architecture/workspace.json
- merge layout from remote: true
- storing previous version of workspace in architecture
- pushing workspace
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Mar 29, 2022 3:15:38 PM com.structurizr.api.StructurizrClient getWorkspace
INFO: Getting workspace with ID 73119
Mar 29, 2022 3:15:38 PM com.structurizr.api.StructurizrClient putWorkspace
INFO: Putting workspace with ID 73119
Mar 29, 2022 3:15:39 PM com.structurizr.api.StructurizrClient putWorkspace
INFO: {"success":true,"message":"OK","revision":2}
- finished
- The workspace in the Cloud is not properly rendered. Specifically:
- Only the first level of documentation is rendered (
general/01-introduction.md
). The second level (system01/01-introduction.md
) is not there - The "Decisions" have problems too. The first decision is not rendered at all. The second decision is listed, but not rendered. An error message is displayed ("There is a problem loading your workspace - please contact support or revert to the previous version").
- Now configure the workspace for auto-sync, by adding the
structurizr.properties
:
.
├── architecture
│ ├── decisions
│ │ ├── 0001-record-architecture-decisions.md
│ │ └── 0002-second-decision.md
│ ├── documentation
│ │ ├── general
│ │ │ └── 01-introduction.md
│ │ └── system01
│ │ └── 01-introduction.md
│ ├── structurizr.properties <=======
│ ├── workspace.dsl
│ └── workspace.json
- Stop the "Structurizr Lite" container to trigger the autosync.
~/SourceCode/structurizr-test$ docker stop structurizr-test
structurizr-test
- This time the workspace on Cloud is properly rendered:
- Both "General" and "System01" documentation are there
- Both "Decisions" are there
I've just tried to reproduce the issue with this workspace and everything seems okay to me. In step 7, have you tried pushing the workspace.dsl
file rather than the workspace.json
file? And are you running the latest version of Structurizr Lite?
- Pushing the
workspace.dsl
works just fine. - I'm using the latest version of Structurizr Lite (structurizr/lite latest f10b1bb5ecdb 3 days ago 822MB)
- I'm using the Docker version of the CLI (structurizr/cli latest f5607bde3feb 5 weeks ago 823MB)
In that case, are you sure that the workspace.json
file corresponded to the content defined by the workspace.dsl
file at the time it was pushed with the CLI? There are some times when opening a workspace in Lite doesn't necessarily create a workspace.json
file.
For what I can say, yes. This is it:
{
"id" : 1,
"name" : "Push Test",
"description" : "A dummy workspace to test the push feature",
"lastModifiedDate" : "2022-03-30T08:47:01Z",
"properties" : {
"structurizr.dsl" : "d29ya3NwYWNlICJQdXNoIFRlc3QiICJBIGR1bW15IHdvcmtzcGFjZSB0byB0ZXN0IHRoZSBwdXNoIGZlYXR1cmUiIHsKCiAgICAhZG9jcyBkb2N1bWVudGF0aW9uL2dlbmVyYWwKICAgICFhZHJzIGRlY2lzaW9ucwoKICAgIG1vZGVsIHsKICAgICAgICBzc19zeXN0ZW0wMSA9IHNvZnR3YXJlU3lzdGVtICJTeXN0ZW0gMDEiIHsKICAgICAgICAgICAgIWRvY3MgZG9jdW1lbnRhdGlvbi9zeXN0ZW0wMQogICAgICAgICAgICBkZXNjcmlwdGlvbiAiQSBkdW1teSBzeXN0ZW0gdG8gdGVzdCB0aGUgZG9jdW1lbnRhdGlvbiIKICAgICAgICB9CiAgICB9CgogICAgdmlld3MgewogICAgICAgIHRoZW1lIGRlZmF1bHQKCiAgICAgICAgc3lzdGVtTGFuZHNjYXBlICJkZ20wMSIgIlRoaXMgaXMgdGhlIGxhbmRzY2FwZSBkaWFncmFtIiB7CiAgICAgICAgICAgIHRpdGxlICJER00wMTogTGFuZHNjYXBlIgogICAgICAgICAgICBpbmNsdWRlICoKICAgICAgICAgICAgYXV0b2xheW91dCAibHIiCiAgICAgICAgfQogICAgfQp9Cg=="
},
"configuration" : { },
"model" : {
"softwareSystems" : [ {
"id" : "1",
"tags" : "Element,Software System",
"name" : "System 01",
"description" : "A dummy system to test the documentation",
"location" : "Unspecified",
"documentation" : {
"sections" : [ {
"title" : "Introduction",
"content" : "## Introduction\n\nThis is the documentation for the System01\n",
"format" : "Markdown",
"order" : 1
} ]
}
} ]
},
"documentation" : {
"sections" : [ {
"title" : "General Documentation",
"content" : "## General Documentation\n\nThis is an example of general documentation\n",
"format" : "Markdown",
"order" : 1
} ],
"decisions" : [ {
"title" : "Record architecture decisions",
"content" : "# 1. Record architecture decisions\n\nDate: 2022-03-29\n\n## Status\n\nAccepted\n\n## Context\n\nWe need to record the architectural decisions made on this project.\n\n## Decision\n\nWe will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).\n\n## Consequences\n\nSee Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools).\n",
"format" : "Markdown",
"id" : "1",
"date" : "2022-03-29T00:00:00Z",
"status" : "Accepted"
}, {
"title" : "second decision",
"content" : "# 2. second decision\n\nDate: 2022-03-30\n\n## Status\n\nProposed\n\n## Context\n\nThe issue motivating this decision, and any context that influences or constrains the decision.\n\n## Decision\n\nThe change that we're proposing or have agreed to implement.\n\n## Consequences\n\nWhat becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.\n",
"format" : "Markdown",
"id" : "2",
"date" : "2022-03-30T00:00:00Z",
"status" : "Proposed"
} ]
},
"views" : {
"systemLandscapeViews" : [ {
"description" : "This is the landscape diagram",
"key" : "dgm01",
"order" : 1,
"automaticLayout" : {
"implementation" : "Graphviz",
"rankDirection" : "LeftRight",
"rankSeparation" : 300,
"nodeSeparation" : 300,
"edgeSeparation" : 0,
"vertices" : false
},
"title" : "DGM01: Landscape",
"enterpriseBoundaryVisible" : true,
"elements" : [ {
"id" : "1",
"x" : 0,
"y" : 0
} ]
} ],
"configuration" : {
"branding" : { },
"styles" : { },
"themes" : [ "https://static.structurizr.com/themes/default/theme.json" ],
"terminology" : { },
"lastSavedView" : "dgm01"
}
}
}
When I push this JSON, I get only the "general documentation:. I miss the one inside the software system "Sytem 01".
If I open the same workspace in Lite, everything is fine. And the autosync from Lite works perfectly.
Lite has been running a new version of the Structurizr for Java library for a couple of weeks, but the CLI hasn't been updated until today. Updating the CLI docker image should resolve this for you.
Confirmed. Latest CLI version solved the problem. Thank you.
structurizr/cli latest 972646a853cf 5 hours ago 635MB