New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checks: Introduce check blocks into the terraform node and transform graph #32735
Conversation
be3b483
to
9abf674
Compare
6d9df0f
to
d2db348
Compare
d2db348
to
6d60490
Compare
9abf674
to
9a01329
Compare
6d60490
to
53523ec
Compare
9a01329
to
bbb7a97
Compare
53523ec
to
0cd462f
Compare
0cd462f
to
e962a66
Compare
e962a66
to
d5c7923
Compare
c3cc453
to
0ac0fee
Compare
bbb7a97
to
6db570c
Compare
0ac0fee
to
01dcda3
Compare
…form into liamcervante/checks/configs
…rraform into liamcervante/checks/graph
Do checks need to run during destroy? This isn't going to work currently, because modules are not expanded during destroy, so nested check blocks will panic with I think what we want here is just to skip the check blocks entirely for any full destroy operation. |
875ca62
to
ba67fa0
Compare
ba67fa0
to
9debe8c
Compare
Done! |
return &nodeCheckAssert{ | ||
addr: addr, | ||
config: cfg, | ||
executeChecks: t.ExecuteChecks(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because having nodes in the graph at all can change how the destroy graph is constructed (i.e. these are currently still going to run into problems when placed in an expanding module) , I think it's better to exclude the nodes entirely whenever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, done much more strongly now!
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR adds Transform and Node structures into the Terraform processing graph, ensuring that Check blocks are processed with the rest of the Terraform configuration.
It outputs the Check results into diagnostics and the plan file, using the same mechanism through which existing CheckRule blocks are exposed. CheckRules from within Check blocks do, however, only ever expose warning diagnostics instead of error diagnostics.
CheckRules within Check blocks are also not exported to the state files, as they execute on every execution of a plan or apply anyway.
This PR is part of chain of PRs introducing the new Checks feature into Terraform for v1.5. The chain of PRs is as follows:
I have created the chain to make reviewing the smaller contained part of the process easier. IF you want to view all the changes together in a single PR, navigate to the last PR in the chain and compare it to the main branch and you will see all changes from all prior PRs in a single place.