Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for ignoring standalone tasks and role tasks in the graph view #218

Merged
merged 12 commits into from
Dec 10, 2024

Conversation

Eltryo
Copy link
Contributor

@Eltryo Eltryo commented Dec 9, 2024

Premise

When running the ansible-playbook-grapher on a huge project folder the resulting svg or mermaid graph happens to be quiet confusing with all the task nodes being rendered. So far there was no option to view all roles (also nested roles) without viewing the corresponding tasks, so I implemented a feature to do exactly that.

Changes

  • Add entry for the new option --only-roles in README.md
  • Add the option in cli.py and adjust grapher.py and parser.py accordingly
  • Update docstrings accordingly
  • Add logic to prevent tasks from being added
  • Lint project with the corresponding make target
  • Add cli and parser tests

Screenshots

without --only-roles
group-roles-by-name
with --only-roles
group-roles-by-name-only-roles

@Eltryo Eltryo changed the title Support for ignoring standalone tasks and role tasks in the graph view feat: Add support for ignoring standalone tasks and role tasks in the graph view Dec 9, 2024
@haidaraM
Copy link
Owner

haidaraM commented Dec 9, 2024

Hi, thanks for your contribution. I just approved the workflows, and I'm rebasing your branch to see if the checks pass.

@haidaraM haidaraM force-pushed the feature-ignore-tasks branch from 6264046 to 771b5d2 Compare December 9, 2024 10:16
@haidaraM
Copy link
Owner

haidaraM commented Dec 9, 2024

Hmm, I have to make a few changes to the workflows so that they work with forks. Will keep you in touch.

@Eltryo
Copy link
Contributor Author

Eltryo commented Dec 9, 2024

Hmm, I have to make a few changes to the workflows so that they work with forks. Will keep you in touch.

Ah alright, thank you!

@haidaraM haidaraM force-pushed the feature-ignore-tasks branch from 771b5d2 to d29dde0 Compare December 9, 2024 22:35
@coveralls
Copy link

coveralls commented Dec 9, 2024

Coverage Status

coverage: 94.298% (+0.02%) from 94.274%
when pulling 5db9d9d on Eltryo:feature-ignore-tasks
into 0e7485c on haidaraM:main.

Copy link
Owner

@haidaraM haidaraM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes to make.

Other than that, this seems to be a reasonable feature to add

tests/test_parser.py Outdated Show resolved Hide resolved
ansibleplaybookgrapher/cli.py Outdated Show resolved Hide resolved
Eltryo and others added 2 commits December 10, 2024 09:11
Co-authored-by: Mohamed El Mouctar Haidara <elmhaidara@gmail.com>
@haidaraM haidaraM merged commit 38bfcc7 into haidaraM:main Dec 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants