Ignore deprecation warnings in plan comparison?
Suggestion
Hi Dan - thanks for the TF action, since working together I've brought it along with me to new gigs :D
The feature to compare PR plans when applying provides a lot of value.
Recently though I have had some terraform-apply failures due to changed from the plan on the PR
The plan is the same, apart from a snippet after the summary that says "Warning: Argument is deprecated"
For the same HCL and the same terraform state, the warning from the PR plan has chosen a resource with uks in the name whereas the apply on merge has chosen a resource with eus in the name for its example.
Unfortunately warnings are not deterministic in their choice of example resource: https://github.com/hashicorp/terraform/issues/30934
Suggestion:
Could the warnings section be ignored when comparing plans?
The content after the summany Plan: 26 to import, 0 to add, 1 to change, 0 to destroy. doesn't relate to actions that will be taken during an apply of the plan, so I think should be safe to omit from comparisons
There also potentially something going on with the (5 unchanged attributes hidden) line
The comment posted to the PR has the # as the first character of the line
Perhaps it is being omitted / seen as a comment when doing the comparison?
Doing a side-by-side of the output in the GHA logs, the # character is in the same place for both the PR plan and the apply
PR plan output
Apply output
Using version 1.49.0 of terraform-plan and terraform-apply
Hi Ben 👋 I'm glad you're finding these actions useful ❤️
The warnings should be being stripped out, but that doesn't seem to be working. Everything after the Plan: line should be ignored, but 26 to import is preventing it from being recognised.
The unchanged attributes also should be being stripped out, but the changing # position is preventing that.
I think I can fix this soon
Ahh ok makes sense it is the edge case combination of deprecation warnings and doing imports together - thanks for the lightning fast reply
This should be resolved in v2.2.2
There was a small issue with # in the changes summary when the plan has actually changed, but that was resolved last week in v2.2.1
Thanks @dflook!