Skip to content

feat: add support for gitlab_project_hook and gitlab_group_hook#27

Merged
xMoelletschi merged 1 commit intomasterfrom
11-hooks
Mar 14, 2026
Merged

feat: add support for gitlab_project_hook and gitlab_group_hook#27
xMoelletschi merged 1 commit intomasterfrom
11-hooks

Conversation

@xMoelletschi
Copy link
Copy Markdown
Owner

@xMoelletschi xMoelletschi commented Mar 14, 2026

Summary

Closes #11

  • Add gitlab_project_hook and gitlab_group_hook drift detection, generating individual resource blocks in hooks.tf
  • Group hooks handle 403 gracefully (Premium/Ultimate required — logs warning and skips)
  • Uses hclwrite for proper HCL formatting consistent with the rest of the codebase
  • Adds ":" to normalizeName so webhook URLs normalize cleanly

Changes

  • internal/gitlab/hooks.goListProjectHooks / ListGroupHooks with pagination
  • internal/gitlab/client.goProjectHooks / GroupHooks in Resources, fetched in FetchAll
  • internal/terraform/hooks.go — HCL generation via hclwrite for both hook types
  • internal/terraform/writer.gohooks.tf output block
  • internal/terraform/import.go — import command generation (project_id:hook_id / group_id:hook_id)
  • internal/terraform/pipeline_schedules.go — added : to normalizeName
  • README.md — documented new resources

Test plan

  • go build ./...
  • go test -race -count=1 ./...
  • Manual test against live GitLab instance

Add webhook drift detection for project and group hooks, generating
individual resource blocks in hooks.tf. Group hooks handle 403
gracefully (Premium/Ultimate required). Uses hclwrite for proper
HCL formatting consistent with the rest of the codebase.
@xMoelletschi xMoelletschi merged commit 396bf66 into master Mar 14, 2026
3 checks passed
@xMoelletschi xMoelletschi deleted the 11-hooks branch March 14, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for gitlab_project_hook and gitlab_group_hook

1 participant