Skip to content

Conversation

Donien
Copy link
Member

@Donien Donien commented Jun 30, 2023

Fix #192.

This PR introduces a reusable workflow. This general workflow handles the job necessary to run both ansible-lint and yamllint on either all roles or one specific role.

All roles are linted when:

  • linting rules are changed
  • the linting workflow is changed

Specific roles are linted when:

  • a role specific workflow is triggered (linting as first job)
  • the full_stack workflow is triggered (linting as first job)

The workflow for the specific role now uses a call to the general linting workflow, while providing it with its own role name.

This approach does not completely remove linting from single workflows, but it makes those linting jobs much more readable and reduces redundant code, while also allowing for a bit more flexibility.

@Donien Donien requested review from afeefghannam89 and lcndsmr June 30, 2023 10:01
@widhalmt
Copy link
Member

widhalmt commented Jul 3, 2023

Nice! That seems like it could really help a lot with development.

@Donien Donien marked this pull request as ready for review July 6, 2023 11:55
@widhalmt
Copy link
Member

widhalmt commented Aug 9, 2023

We now have merged some major changes to the testing configuration. Could you please resolve the conflicts and have another look?

@Donien
Copy link
Member Author

Donien commented Aug 11, 2023

I've looked through the workflows again and made some changes.
This still needs a review. But as of today it should be compatible with the current main branch.

@widhalmt widhalmt enabled auto-merge August 22, 2023 15:13
Copy link
Member

@widhalmt widhalmt left a comment

Choose a reason for hiding this comment

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

Thanks again. This really will help with easier maintenance.

@widhalmt widhalmt added this pull request to the merge queue Aug 22, 2023
Merged via the queue into main with commit e1dbc4a Aug 22, 2023
@widhalmt widhalmt deleted the fix/lint-workflow-192 branch August 22, 2023 15:15
ivareri pushed a commit to ivareri/ansible-collection-elasticstack that referenced this pull request Jun 17, 2025
Fix NETWAYS#192.

This PR introduces a reusable workflow. This general workflow handles
the job necessary to run both `ansible-lint` and `yamllint` on
**either** all roles or one specific role.

All roles are linted when:
- linting rules are changed
- the linting workflow is changed

Specific roles are linted when:
- a role specific workflow is triggered (linting as first job)
- the `full_stack` workflow is triggered (linting as first job)

The workflow for the specific role now uses a call to the general
linting workflow, while providing it with its own role name.

This approach does not completely remove linting from single workflows,
but it makes those linting jobs much more readable and reduces redundant
code, while also allowing for a bit more flexibility.

---------

Co-authored-by: Thomas Widhalm <[email protected]>
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.

Take out lint jobs from all workflows to a separated one
2 participants