https://github.com/icyflame/launchdarkly-prereq-graph-gen
Generates a DOT file with the directed graph depicting the pre-requisite relationship in your LD setup
https://github.com/icyflame/launchdarkly-prereq-graph-gen
graphviz-dot launchdarkly
Last synced: 11 months ago
JSON representation
Generates a DOT file with the directed graph depicting the pre-requisite relationship in your LD setup
- Host: GitHub
- URL: https://github.com/icyflame/launchdarkly-prereq-graph-gen
- Owner: icyflame
- Created: 2019-06-01T08:02:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T07:38:21.000Z (over 3 years ago)
- Last Synced: 2025-04-06T01:26:40.809Z (about 1 year ago)
- Topics: graphviz-dot, launchdarkly
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LaunchDarkly Pre-requisites Graph Generator
> Generates a [DOT][1] file which can be built to an image depicting the
> pre-requisite relationship in your LaunchDarkly setup
### Commands
**Note:** There might be some flags that start with a digit `[0-9]`. DOT doesn't
compile if there are nodes with identifiers starting with a digit. The script
will prefix `flag_` to make sure that they are valid identifiers.
```sh
LD_API_KEY=$LD_API_KEY node index.js;
# For incomplete flag configurations
sed -ie "/-> \[/d" test.dot;
dot -Tsvg -O test.dot;
```
### Example
[Dot file][2]
![Compiled image][3]
- 6 flags in LaunchDarkly
- A has a pre-requisite of `B.variation-0`
- C has a pre-requisite of `D.variation-2`
- A has a pre-requisite of `E.variation-1`
- F has a pre-requisite of `B.variation-0`
From the graph, it becomes clear that as the targetting for D is off (indicated
by the red color box), the flag C is not really targetting any users.
[1]: https://www.graphviz.org/doc/info/lang.html
[2]: ./example.dot
[3]: ./example.dot.svg