fix: prevent nil pointer panic in gitlab_system_hook Create when token is not set
What does this MR do and why?
Fixes a panic (invalid memory address or nil pointer dereference) that occurs when creating a gitlab_system_hook resource without setting the token attribute.
The GitLab API never returns the token value after creation, so systemHookToStateModel never sets it. When token is omitted from the config, data.Token remains null/unknown from the plan read, and the Terraform Plugin Framework panics trying to write that uninitialized value to state.
The fix explicitly sets data.Token = types.StringNull() in the Create function when the token was not provided by the user.
A new acceptance test TestAccGitlabSystemHook_withoutToken is added to cover this scenario.
Closes #6826 (closed)
MR checklist
- Resource attributes match 1:1 the names and structure of the API resource in the GitLab API documentation.
- New resources have at minimum a basic test with three steps (not applicable — bug fix with new test case added).
- No new
//lintignorecomments that came from copied code.
Changelog: BUG FIXES
Subsystem: resource/gitlab_system_hook