Import of gitlab_project_job_token_scopes causes replacement, imposible when enforced for the instance
## Bug Report If terraform detects changes outside of its state on a gitlab_project_job_token_scopes, it wants to replace the whole resource. It fails when "Job token scope cannot be disabled for this project because it is enforced for the instance" ## Relevant Log Output Plan: ``` # module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"] must be replaced -/+ resource "gitlab_project_job_token_scopes" "main" { ~ enabled = true -> (known after apply) ~ id = "24200270" -> (known after apply) ~ project_id = 24200270 -> (known after apply) # forces replacement ~ target_project_ids = [ - 60301139, - 64715484, ] # (2 unchanged attributes hidden) } ``` Apply: ``` module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"]: Destroying... [id=24200270] module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"]: Destruction complete after 3s module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"]: Creating... ╷ │ Error: GitLab API error occured when setting the jobtoken allowlist enabled flag in project 24200270 │ │ with module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"], │ on modules/job_token_scopes/main.tf line 11, in resource "gitlab_project_job_token_scopes" "main": │ 11: resource "gitlab_project_job_token_scopes" "main" { │ │ PATCH https://gitlab.com/api/v4/projects/24200270/job_token_scope: 400 │ {message: 400 Bad request - Job token scope cannot be disabled for this │ project because it is enforced for the instance. Contact your administrator │ to modify this setting.} ╵ ``` After first failure, the next plan looks like this: ``` # module.job_token_scopes.gitlab_project_job_token_scopes.main["24200270"] is tainted, so must be replaced -/+ resource "gitlab_project_job_token_scopes" "main" { ~ enabled = true -> (known after apply) ~ id = "24200270" -> (known after apply) ~ project_id = 24200270 -> (known after apply) # (3 unchanged attributes hidden) } ``` And produces the same apply log ## Additional Details - GitLab Terraform Provider Version: \`v18.9.0\` - GitLab Instance Version: \`18.10.0-pre\` - Terraform Version: \`1.14.6-1\` - License Tier: `Premium`
issue