Graphql: project_target_branch_rule drops sub-path from endpoint URL, sending request to bare FQDN
Description:
When the GitLab instance is installed at a sub-path (e.g. https://vlab.redacted.gov/gitlab-licensed/), the gitlab_project_target_branch_rule resource sends its GraphQL mutation to the bare FQDN (https://vlab.redacted.gov/api/graphql) rather than the correct sub-path URL (https://vlab.redacted.gov/gitlab-licensed/api/graphql). REST API calls from the same provider correctly include the sub-path. This results in a failed or misdirected request and no branch rule being created.
Steps to reproduce:
Configure the GitLab provider with a base URL that includes a sub-path (e.g. https://vlab.redacted.gov/gitlab-licensed/).
Define a gitlab_project_target_branch_rule resource in Terraform and run terraform apply.
Inspect outbound requests via an egress proxy or network capture.
Expected behavior:
The GraphQL API request should be sent to <base_url>/api/graphql, preserving the configured sub-path — consistent with how REST API calls are constructed by the same provider.
Actual behavior:
The GraphQL request is sent to https://<fqdn>/api/graphql, dropping the sub-path. REST API calls from the same provider are unaffected and correctly include the sub-path.
Workaround:
None identified. The GraphQL mutation can be run successfully directly against the correct sub-path endpoint using the same token and query, confirming this is a provider-side URL construction issue.
**Gitlab version:** 18.10.6 **GitLab edition:** GitLab Licensed (self-managed) GET Docker Image
~"bug::functional"
~"group::source code"
~"bug::functional"
issue