structurizr / lite

Structurizr Lite
https://docs.structurizr.com/lite
MIT License
226 stars 26 forks source link

Problem with import adrs starting with number as 001- #103

Closed abtris closed 9 months ago

abtris commented 9 months ago

Description

I'm playing with example where is import adrs.

After run I get this error:

2023-11-21T18:20:40.285Z ERROR 1 --- [nio-8080-exec-6] com.structurizr.lite.web.ApiController   : com.structurizr.lite.web.ApiException: workspace.dsl: Error importing ADRs from /usr/local/structurizr/adrs: java.lang.NumberFormatException: For input string: "001-" at line 9 of /usr/local/structurizr/workspace.dsl: !adrs adrs

Steps to reproduce

  1. Checkout example from https://github.com/structurizr/examples/blob/main/dsl/financial-risk-system/
  2. Run docker run -it --rm -p 8080:8080 -v .:/usr/local/structurizr structurizr/lite

Screenshot

No response

Code sample

No response

Configuration

Lite : Structurizr Lite

Severity

Minor

Priority

I have no budget and there's no rush, please fix this for free

More information

No response

simonbrowndotje commented 9 months ago

The example works fine for me. If you change the filename though, yes, the ADR importer will fail because it's assuming the filename has 4 digits -> https://github.com/structurizr/import/blob/main/src/main/java/com/structurizr/importer/documentation/AdrToolsDecisionImporter.java#L148

It's designed to work with the ADRs created by adr-tools. If you're using a different format, you'll need to fork the importer. See https://docs.structurizr.com/dsl/adrs for more.