Loading
Read project_id back for project runners in gitlab_user_runner
What does this MR do and why?
Importing a gitlab_user_runner with runner_type = "project_type" left project_id unset in state, because modelToStateModel only mapped the group ID back from the API response. project_id has RequiresReplace, so the next terraform plan proposed destroying and recreating the runner — the same defect #6745 (closed) fixed for group_id.
This MR maps the first entry of the runner's projects from the API response into project_id, mirroring the group handling, and warns when the response has none. The project runner acceptance test now verifies project_id on import instead of ignoring it.
Related issues
Resolves #6865 (closed)
How to test
- Create a project runner with the resource, then
terraform state rmit andterraform import gitlab_user_runner.this <runner id>. terraform plan— onmainit proposes replacement (project_id: null -> <id>); with this MR the plan is empty.TF_ACC=1 go test ./internal/provider -run TestAcc_GitlabUserRunner_basicProjectRunner.
Edited by Jeston Singh