driftive / driftive

Detect state drifts in your Terraform/Terragrunt/OpenTofu projects
Apache License 2.0
9 stars 0 forks source link

Allow creation of pull request in favour of issues #14

Open MattiasAng opened 2 months ago

MattiasAng commented 2 months ago

First of all, really like the idea and implementation of this tool. This feature request might go against the idea of the tool and in that case feel free to close the issue.

When using a pull request automation tool such as Atlantis it would be beneficial if driftive could create a new pull request with a placeholder file change in the plan directory in favour (or in addition but would prefer if this was configurable) of an issue as that would allow drift changes to be applied directly allowing a smoother remediation workflow.

This is similar to atlantis-drift-detection implementation but considering driftive doesn't require Atlantis API access (which in turn also means apply actions) I have a preference of using driftive as we can limit it to only read actions.

If you agree on the idea I can probably get it implemented in a pull request.

fernandonogueira commented 2 months ago

Hey, @MattiasAng!

I like the idea but not the approach. Would you happen to have any other ideas on how to implement this?

What would be the best workflow in this case, by chance?

If you don't have any other ideas on how to implement this, I'm okay with proceeding with the implementation, but it needs to be behind a feature flag or configuration in the repository (driftive.yml file).

MattiasAng commented 2 months ago

That workflow was what I had in mind. The last part of closing the pul request could be up to each implementor to decide if they want to merge the placeholder file to have a Git history of drift applies.

The alternative to this could also be to have a checkbox in the Github issue to create a pull request, similar to how Dependabot and Renovate works with dependencies. Either way, I agree that this should be hidden behind configuration as it would require additional permissions.

fernandonogueira commented 2 months ago

I'm ok with this change, then @MattiasAng. It would be awesome if you have some spare time to create a PR.

Thanks!