haidaraM / ansible-playbook-grapher

A command line tool to create a graph representing your Ansible playbook tasks and roles
GNU General Public License v3.0
638 stars 53 forks source link

Refactor: make the grapher usable as a library #45

Open haidaraM opened 4 years ago

haidaraM commented 4 years ago

I wrote most of the grapher almost 7 years ago in 2017 and lot of things happened since 😄

Currently, the Grapher is tightly coupled to the CLI. This makes it difficult to use it as a library inside another project. Also the Grapher is a little bit complicated: thinking of splitting it. I also want to make the graph customizable by not hardcoding the shapes, layout and make the post processor more extensible.

So this issue is here to track the related changes. The outcome of these changes will be the version ~v1.0.0~ ~v2.0.0~ v3.0.0 of the grapher?

haidaraM commented 3 years ago

The code is now cleaner. Will update the Readme with an example to integrate this in an existing project. Meanwhile, you can take how the CLI works as an example.

haidaraM commented 1 year ago

For those following this issue: while the code can be used in another project, keep in mind that the internal API is not stable yet. I will likely refactor the internal of the grapher in the following versions. The Parser should not change that much.

So expect some breaking changes in minor versions if you are using this project inside another. Make sure to pin the version.

ShanePresley commented 4 months ago

A renderer that dumps the output of the parser into json for consumption by third-party tools would be really useful.

haidaraM commented 4 months ago

@ShanePresley This should be doable. Let me track that as a separate feature request: https://github.com/haidaraM/ansible-playbook-grapher/issues/192

haidaraM commented 2 months ago

@ShanePresley This should be doable. Let me track that as a separate feature request: #192

Will be released in the following days.

haidaraM commented 2 days ago

The project has a JSON renderer since the version v2.3.0


Some updates:

As such, I will close this issue by the end of the year.