diggerhq / digger

Digger is an open source IaC orchestration tool. Digger allows you to run IaC in your existing CI pipeline ⚡️
https://digger.dev
Apache License 2.0
3.64k stars 178 forks source link

Digger plan to be run only on for project that has changes in code in the commit #1141

Open chvima opened 8 months ago

chvima commented 8 months ago

Currently, as I understand the flow from the testing:

Could this behaviour be changed to:

Manual digger plan behaviour can be kept as it is.

motatoes commented 8 months ago

Hey @chvima can you outline more the motivation for this behvaiour? Current behaviour of orchestrator is when PR event is triggered is to check the files changed for the entire PR (not just the latest commit) and trigger jobs based on that. Would like to understand why you prefer to have it only checking the files changed in that commit instead

chvima commented 8 months ago

Let's say I have a PR opened with changes in 10 TF modules. Digger runs plan for all of them and creates a comment with plan summary. I will get it reviewed and get a request to change 1 of the modules.

I commit a change in one module and Digger now runs Plan for all 10 modules again, even when none of them was changed in the commit - there is no need for that, the last comment that Digger has created about Plan summary is still valid for 9 of the modules, it only needs to be updated for one of them.

Motivation is to save resources needed for running the github workflows.

motatoes commented 8 months ago

@chvima that makes sense indeed you are right. I think we should consider implementing this change. Not sure if GH payloads includes the files changed per commit. we might have to resort to git based diff otherwise. But I think it is a nice feature to be considered surely

ZIJ commented 5 months ago

Similar concern (more like, confusion) came up in a prospective customer conversation (P.K.) - they had a long-lived PR and assumed that only the projects affected by the latest commit would run; not all projects.

TBD whether or not the default behaviour should be changed; if we do, the challenge is that the latest plans for all projects would no longer be at the bottom. So this probably requires switching to single-comment update-only UX (so that there is only one Digger comment with all plans and it's updated continuously). More thinking required.