Guard against errors in branch rule resources

What does this MR do?

gitlab_project_target_branch_rule ignored GraphQL request-level errors (e.g. insufficient token scope) on the projectTargetBranchRuleCreate/Destroy mutations. These surface in a top-level errors array alongside a null payload, separate from the mutation's own errors field, which was the only one checked. As a result, the provider reported success and wrote a malformed resource (empty target branch rule ID, e.g. id = "876:") to state instead of failing the apply.

Changes

  • Capture the top-level GraphQL errors array in Create/Delete and surface it as a diagnostic.
  • Guard against an empty target branch rule ID in Create so no malformed state is ever written.

Changelog: Bug

Closes #6835 (closed)

Merge request reports

Loading