This message was deleted.
# contributors
b
This message was deleted.
w
good idea! in case it’s useful, it is possible to have GH Actions run a task then commit a file to the branch too (@polite-vr-31842 used that to auto-generate and save some docs before). We can still keep this test to verify Infracost can invoke Terraform ok (not sure what other tests we should do to verify the Infracost <> Terraform flow works ok).
p
That seems a good idea to me, however I think we should re-check it somehow to prevent human error. We have few options: 1. Have more customized dev pipeline like when want to commit .tf golden file and its .json is not changed the git raise some errors. 2. Have some once-per-hour/day pipeline that does some heavy checks like comparing the result of .tf to their current .json and fail if there are some mismatch. 3. Just like 1 but instead of raising error, generate .json and update it. I think a combination of 2 & 3 is a inevitable cause: 1. We need to have some heavy checks from time to time or selective (like when committing to master) 2. We can leverage Golang features and create our own format checker so we can introduce more advanced conventions (like resources function name patterns)
c
I was thinking we could just annotate (somehow) the plan.json with the sha of the .tf that generated it. Then each test run would use that to make sure the .tf and plan.json are in sync. Out of sync would result in an error unless the
-update
flag was passed, same as for .golden files.
p
Interesting! I've never thought about it from this point of view. It's developer friendly and fast. 👍🏻