Repository navigation
Make diagram IDs from the file path, not the folder - #10
Merged
Merged
Conversation
UIG-198 Fix incorrect artifact validation failure in `npx uigraph`
Running The error is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes UIG-198.
npx uigraphrefused a correct.uigraph.yamlwhen two diagram files were in the same folder.uigraph-cli syncaccepted the same file.Before and after
Before: The viewer made each diagram ID from the name of the folder that holds the diagram file. Two diagrams in one folder got the same ID, and the viewer stopped:
After: The viewer makes each diagram ID from the full file path in
.uigraph.yaml. Two diagrams in one folder get different IDs, and the viewer opens both.Disadvantages:
/diagram/<id>changes too. Old bookmarks to a diagram do not open.contextPath, its first save in the viewer writes<folder>/context.json. Thus a save of the second diagram writes over the layout of the first. When the user deletes one diagram, the viewer also deletes the images of the other diagrams in<folder>/images.Risk
The change touches the ID of all architecture diagrams in the viewer. No
.uigraph.yamlfile keeps a diagram ID, because links to a diagram use its name. Thus no saved data changes. A revert fully undoes the change.Evidence
A test repository has two diagrams,
diagram/order-flow.mmdanddiagram/order-containers.mmd:another diagram already uses the folder "diagram"diagramdiagram-order-flow-mmd,diagram-order-containers-mmduigraph-cli sync --dry-runsyncs the two diagrams.63 tests pass. Two tests in
src/bin.test.tsfail because they time out. These tests run the old build indist/bin.mjs, which does not contain this change. I did not build the package or open the diagrams in a browser.What changed
Bug fixes:
Breaking changes:
Checklist
src/bin.test.tson a new buildOther options