Usage of use_mr_plan with job-templates component
Proposal
It would be an amazing help if the "use_mr_plan" variable was available in the job-templates component.
We've been trying to implement the component into our tf workflow. The workflow looks like this: Developers create forks and change the terraform files. On every commit, validate is triggered. On creation of a merge request, a plan is created and added to the merge request. On the merge request is merged, deploy is supposed to run automatically IF the merge request was approved (which only my team can do).
Unfortunately, we can't easily rely on the opinionated components cause we use vault and custom terraform-modules which need to be checked out from gitlab heavily, so we need to embed several additional job templates - that requires us to use the job-template component file if I understand correctly.
With the old Gitlab Terraform template, we make this workflow work by booting up an environment in the plan step with an on_stop reference to the deploy step, and added a validation script check for approval in the deploy before the actual tf apply was done. Since the new OpenTofu component uses environments itself, this no longer works it seems, or at the very least, a custom on-stop action doesn't seem to fire anymore.
To work around this, we could just change the deploy step to run on commit to the protected branch, but without use_mr_plan, that new pipeline won't have access to the previously generated plan artifact.