feat!: Upgrade gitlab provider to 19.x - #10
Merged
Conversation
BREAKING CHANGE: renames gitlab_project_mirror, gitlab_integration_* resources, splits gitlab_deploy_token into project/group and gitlab_branch_protection into CE/EE variants, and removes deprecated gitlab_project boolean/mirror attributes per the provider's 19.0 upgrade guide. See docs/UPGRADE-2.0.md.
Terraform rejects two moved blocks sharing the same 'from' address with 'Ambiguous move statements', so the gitlab_deploy_token and gitlab_branch_protection splits can't be automated via moved.tf. Keep the 7 safe 1:1 resource renames there, and document the required manual terraform state mv commands for the two splits in docs/UPGRADE-2.0.md.
… lists allowed_to_push/allowed_to_merge/allowed_to_unprotect entries only computed user_id/group_id/deploy_key_id, silently dropping access_level. Since EE no longer honors push_access_level/merge_access_level at all, callers now rely on an access_level entry inside allowed_to_push/allowed_to_merge, which the module previously discarded, producing all-null entries and provider errors.
require_password_to_approve on gitlab_project_level_mr_approvals is deprecated in provider 19.x and removed in 20.0; use require_reauthentication_to_approve instead.
data "gitlab_users" "this" {} and data "gitlab_groups" "this" {} paged the
whole instance (720+ users here) and were non-deterministic between two reads
a minute apart, flipping which user/group resolved for allowed_to_push,
allowed_to_merge, membership, approval_rule, and protected_environment
entries and tripping the provider's ExactlyOneOf validator.
Replace both with data.gitlab_user/data.gitlab_group for_each, scoped to only
the emails and group full_paths actually referenced across
var.gitlab_projects. Groups already managed by this module invocation are
merged in directly from gitlab_group.parent_groups/subgroups rather than
looked up externally, since a brand-new group doesn't exist yet at plan time
and would otherwise 404 the data source read. exists_users/exists_groups
keep their existing shape so no other call site changes.
wiseelf
requested review from
babychm,
chas0amx,
kushlychok,
perun-ai and
sirantd
July 7, 2026 04:15
kushlychok
approved these changes
Jul 7, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 7, 2026
## [2.0.0](v1.4.0...v2.0.0) (2026-07-07) ### ⚠ BREAKING CHANGES * renames gitlab_project_mirror, gitlab_integration_* resources, splits gitlab_deploy_token into project/group and gitlab_branch_protection into CE/EE variants, and removes deprecated gitlab_project boolean/mirror attributes per the provider's 19.0 upgrade guide. See docs/UPGRADE-2.0.md. * fix: Bump terragrunt_version_constraint to 0.99.5 in terragrunt example * fix: Drop ambiguous moved blocks for split resources Terraform rejects two moved blocks sharing the same 'from' address with 'Ambiguous move statements', so the gitlab_deploy_token and gitlab_branch_protection splits can't be automated via moved.tf. Keep the 7 safe 1:1 resource renames there, and document the required manual terraform state mv commands for the two splits in docs/UPGRADE-2.0.md. * fix: Forward access_level in gitlab_branch_protection ee allowed_to_* lists allowed_to_push/allowed_to_merge/allowed_to_unprotect entries only computed user_id/group_id/deploy_key_id, silently dropping access_level. Since EE no longer honors push_access_level/merge_access_level at all, callers now rely on an access_level entry inside allowed_to_push/allowed_to_merge, which the module previously discarded, producing all-null entries and provider errors. * fix: Replace deprecated require_password_to_approve attribute require_password_to_approve on gitlab_project_level_mr_approvals is deprecated in provider 19.x and removed in 20.0; use require_reauthentication_to_approve instead. * fix: Replace bulk gitlab_users/gitlab_groups lookups with scoped fetches data "gitlab_users" "this" {} and data "gitlab_groups" "this" {} paged the whole instance (720+ users here) and were non-deterministic between two reads a minute apart, flipping which user/group resolved for allowed_to_push, allowed_to_merge, membership, approval_rule, and protected_environment entries and tripping the provider's ExactlyOneOf validator. Replace both with data.gitlab_user/data.gitlab_group for_each, scoped to only the emails and group full_paths actually referenced across var.gitlab_projects. Groups already managed by this module invocation are merged in directly from gitlab_group.parent_groups/subgroups rather than looked up externally, since a brand-new group doesn't exist yet at plan time and would otherwise 404 the data source read. exists_users/exists_groups keep their existing shape so no other call site changes. ### Features * Upgrade gitlab provider to 19.x ([#10](#10)) ([38b5a40](38b5a40))
|
This PR is included in version 2.0.0 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gitlabhq/gitlabprovider from18.4.1to19.1.0per the v19.0 upgrade guide; seedocs/UPGRADE-2.0.mdfor the full breaking-changes list and requiredterraform state mvcommandsmoved.tf(gitlab_project_mirror, 6×gitlab_integration_*)gitlab_branch_protectioninto CE/EE variants (gated byvar.tier) andgitlab_deploy_tokeninto project/group variants — both require a manualterraform state mv(Terraform rejects twomovedblocks sharing the same source address)gitlab_projectboolean/mirror attributes (issues_enabled,merge_requests_enabled,wiki_enabled,snippets_enabled,restrict_user_defined_variables,tags,import_url/mirror*), replaced by their*_access_levelequivalents,ci_pipeline_variables_minimum_override_role,topics, and a newgitlab_project_pull_mirrorresourcegitlab_project_protected_environmenttodeploy_access_levels_attribute, replaces the deprecatedrequire_password_to_approvewithrequire_reauthentication_to_approvedata "gitlab_users"/data "gitlab_groups"lookups (non-deterministic on large instances — the root cause of theExactlyOneOffailures) withfor_eachlookups scoped to only the emails/groups actually referenced invar.gitlab_projectsrequired_versionto>= 1.8.0everywhere (needed for cross-typemovedblocks), including the terragrunt exampleBreaking changes
This is a major version bump for module consumers — see
docs/UPGRADE-2.0.mdfor the full list of resource renames/splits and input variable changes, plus manual state migration commands for the two resource splits.Test plan
terraform validatepasses on the root module andexamples/terraformagainst the real 19.1.0 provider schematerraform consolesmoke test confirms the new email/group reference extraction covers all extraction sites (approval rules, memberships, protected environments, share_groups, branch protection)terragrunt plan/applyagainst a real GitLab instance (services-gateway project) to confirm theExactlyOneOferrors are resolved