Use OpenTofu's summary line in the MR plan comment

The plan comment's headline is built from plan.json, which counts only create, update and delete actions. Plans that import or forget resources are therefore summarised wrongly, for example "0 additions, 0 changes and 0 deletions" for a plan that forgets 14 resources (Plan: 0 to add, 0 to change, 0 to destroy, 14 to forget.), or "0 additions, 4 changes" for one that also imports 14 (Plan: 14 to import, 0 to add, 4 to change, 0 to destroy.).

This uses the summary line OpenTofu prints for the saved plan instead. It covers imports, forgets and replacements and follows OpenTofu when new action types are added. The plan JSON report for the Terraform widget is unchanged.

Merge request reports

Loading
Loading