Repository navigation
fix: Update GitLab provider to 19.5.0 - #14
Merged
Merged
Conversation
Pin gitlabhq/gitlab to 19.5.0. Provider 19.4.1 accepts only a full ref for gitlab_pipeline_schedule. Change a short schedule ref to refs/heads/<ref>. Keep the for_each key as written. Add unit tests and document the push_rules deprecation.
wiseelf
requested review from
babychm,
chas0amx,
kushlychok,
perun-ai and
sirantd
October 22, 2026 23:40
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 23, 2026
## [2.2.1](v2.2.0...v2.2.1) (2026-10-23) ### Bug Fixes * Update GitLab provider to 19.5.0 ([#14](#14)) ([41001fe](41001fe))
|
This PR is included in version 2.2.1 🎉 |
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.
Why
The module pins
gitlabhq/gitlabto19.1.0. With GitLab server 19.2 and later, provider 18.0–19.1 has errors or a constant diff ongitlab_group_labelandgitlab_project_label. Provider 19.2.0 fixes this.What
Provider (
versions.tf): the pin changes from= 19.1.0to= 19.5.0. The changelog from 19.2.0 to 19.5.0 has no breaking changes section, and the provider has no upgrade guide for this range.Pipeline schedules (
main.tf): provider 19.4.1 adds a plan-time check ongitlab_pipeline_schedule.ref:^refs/.+$. A short ref such asmainnow fails the plan withInvalid Attribute Value Match. The module now changes a short ref torefs/heads/<ref>and keeps a full ref as written. Thefor_eachkeys ofgitlab_pipeline_scheduleandgitlab_pipeline_schedule_variablekeep the ref as written, so the addresses do not change.The rejected alternative: make consumers write full refs. The
for_eachkey contains the ref, so a change in the YAML destroys each schedule and its variables, and then creates them again.Each schedule with a short ref shows one in-place update of
ref(main->refs/heads/main). The provider updatesrefin place and does not replace the schedule.Docs (
Readme.md): the requirements give the exact provider pin and theterraform init -upgradestep. A new Notes section describes the ref rule and thepush_rulesdeprecation.Tests (
tests/pipeline_schedules.tftest.hcl): 2terraform testruns with a mock provider. They check a short branch ref and a full tag ref.Checks
terraform init -upgrade -backend=false: installedgitlabhq/gitlab v19.5.0.terraform validate: Success.terraform test: 7 passed, 0 failed.terraform test -filter=tests/pipeline_schedules.tftest.hclwith the oldmain.tf: fails withInvalid Attribute Value Matchonref. This is the same error that consumers with short refs get on 19.5.0.push_rulesshowsWarning: Argument is deprecated ... Use gitlab_project_push_rules instead.pre-commit run -a: Passed.Notes for reviewers
gitlabhq/gitlabto another version failsterraform init. Each consumer must runterraform init -upgrade.push_rulesblock ofgitlab_project(main.tf:680) in 19.4.1, and it removes the block in 20.0. A migration togitlab_project_push_rulesneeds import ormovedwork, so it is not in this PR.pipeline_schedules[*].refbecomesrefs/heads/<tag>. For a tag, consumers must writerefs/tags/<tag>.gitlab_branch_protectionerrors with API-injected defaults for emptyallowed_to_*lists. 19.4.0 movesgitlab_project_approval_ruleto the plugin framework. Examine consumer plans for diffs on these resources.