Implement Update, align hook schemas

Addresses #6826 (closed) but while working on noticing some other room for improvement to implement Update and align hook schemas

  • Fix nil pointer dereference when creating gitlab_system_hook without a token. The Create handler dereferenced options.Token unconditionally after the API call, panicking whenever the attribute wasn't set in config.
  • Implement Update via SystemHooks.EditHook so changes happen in place. Drops all RequiresReplace planmodifiers from system_hook attributes.
  • Switch bool event attrs to Optional + Computed + Default, matching project_hook and group_hook. Defaults verified against GitLab 19.0.1: push_events=false, tag_push_events=false, merge_requests_events=false, repository_update_events=true, enable_ssl_verification=true.
  • Add TestAccGitlabSystemHook_noToken (regression for the panic plus default-value assertions) and TestAccGitlabSystemHook_tokenPreservedOnUpdate (proves UseStateForUnknown on token survives a drop-from-config update).
Edited by Jimmy Spagnola

Merge request reports

Loading