reviewdog / action-tflint

Run tflint with reviewdog on pull requests to enforce best practices
MIT License
107 stars 22 forks source link

Support for multiple plans per repository #25

Closed nikolay closed 3 years ago

nikolay commented 3 years ago

It's a common pattern to use multiple plans per repository, but acton-tflint does not support it. Any suggestion on how to work around the assumption?

Vlaaaaaaad commented 3 years ago

Hm... I think that running multiple invocations of this action is the only way. Maybe some matrix of folders in which to run it + setting the working_directory?

I don't see how we could add support for multiple plans. Do you have any ideas?

nikolay commented 3 years ago

@Vlaaaaaaad That means hardcoding it. For example, we have a repo with a growing number of plans in it - we can't keep hardcoding every single plan inside it. One PR may affect multiple plans, too. One way would be to have an option to run under each directory, which has a .tf file in it.

Vlaaaaaaad commented 3 years ago

Hey @nikolay. Apologies, I am rather busy with some personal projects and I don't have any bandwidth to allocate for this right now 😞

My initial thoughts on this were that a matrix on the folders and setting working_directory would be a good workaround. The alternative would be to change the action to dynamically discover folders, but that is... more complex and tricky to do well.

@haya14busa any ideas on this?

nikolay commented 3 years ago

@Vlaaaaaaad I think the lack of support of monorepos is more of a reviewdog oversight than specific action's.

Vlaaaaaaad commented 3 years ago

Closing this as it's indeed a reviewdog design issue. I'd definitely go for the matrix + per-directory strategy. Maybe with another GitHub action that updates the directory list for the matrix, so you don't have to manually handle that.

Feel free to re-open if you have any other ideas!

nikolay commented 3 years ago

@Vlaaaaaaad Thank you! I refactored my workflow to use a dynamic matrix.