feat: add gitlab_project_integration_packagist resource

Description

Adds the new resource gitlab_project_integration_packagist, which manages the Packagist project integration (PUT/GET/DELETE /projects/:id/integrations/packagist).

Supported attributes: project, username, token (sensitive, write-only), server (optional), push_events, merge_requests_events, tag_push_events, plus the computed title, slug, active, created_at, updated_at. Import works with the project ID or path.

Implementation notes

  • client-go does not support the Packagist integration yet. Support is added in gitlab-org/api/client-go!3195 (merged); once it is released, this resource will be switched from client.NewRequest/client.Do to client-go.
  • After DELETE, GitLab answers GET with 200 and active: false instead of 404, so Read removes an inactive integration from state.
  • server is Optional + Computed and only sent when set. Removing it from the config stops managing it, in line with the other optional attributes in this provider.

Testing

Acceptance tests against GitLab CE 19.5.3 (make testacc RUN=TestAcc_GitlabProjectIntegrationPackagist):

  • TestAcc_GitlabProjectIntegrationPackagist_basic: create with only the required attributes, update all attributes, remove server from the config (value is kept), import after each step
  • TestAcc_GitlabProjectIntegrationPackagist_invalidServer: URL validation of server

make reviewable passes.

Edited by uluzox

Merge request reports

Loading
Loading