Add state mover for gitlab_project_integration_emails_on_push

This code change adds support for migrating from an old GitLab integration resource to a new one without losing configuration data.

The main addition is a "state mover" function that automatically transfers settings from the deprecated gitlab_integration_emails_on_push resource to the newer gitlab_project_integration_emails_on_push resource. This allows users to upgrade their Terraform configurations using a "moved" block without having to manually recreate their email notification settings.

The migration function includes safety checks to ensure it only processes the correct resource types and provider addresses. It maps all the configuration fields from the old format to the new format, preserving settings like email recipients, notification preferences, and other integration details.

A comprehensive test was also added to verify this migration works correctly. The test creates an integration using the old resource, then uses Terraform's "moved" block to transfer it to the new resource, and confirms all settings are preserved. This test requires Terraform version 1.8 or later since cross-resource migrations were introduced in that version.

This change makes it easier for users to adopt the new resource without disrupting their existing GitLab email notification configurations.

Part of #6717

Merge request reports

Loading