Skip to content

fix: Update GitLab provider to 19.5.0 - #14

Merged
wiseelf merged 1 commit into
mainfrom
chore/gitlab-provider-19.5.0
Oct 23, 2026
Merged

wiseelf merged 1 commit into
mainfrom
chore/gitlab-provider-19.5.0

Conversation

@wiseelf

@wiseelf wiseelf commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Why

The module pins gitlabhq/gitlab to 19.1.0. With GitLab server 19.2 and later, provider 18.0–19.1 has errors or a constant diff on gitlab_group_label and gitlab_project_label. Provider 19.2.0 fixes this.

What

Provider (versions.tf): the pin changes from = 19.1.0 to = 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 on gitlab_pipeline_schedule.ref: ^refs/.+$. A short ref such as main now fails the plan with Invalid Attribute Value Match. The module now changes a short ref to refs/heads/<ref> and keeps a full ref as written. The for_each keys of gitlab_pipeline_schedule and gitlab_pipeline_schedule_variable keep the ref as written, so the addresses do not change.

The rejected alternative: make consumers write full refs. The for_each key 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 updates ref in place and does not replace the schedule.

Docs (Readme.md): the requirements give the exact provider pin and the terraform init -upgrade step. A new Notes section describes the ref rule and the push_rules deprecation.

Tests (tests/pipeline_schedules.tftest.hcl): 2 terraform test runs with a mock provider. They check a short branch ref and a full tag ref.

Checks

  • terraform init -upgrade -backend=false: installed gitlabhq/gitlab v19.5.0.
  • terraform validate: Success.
  • terraform test: 7 passed, 0 failed.
  • terraform test -filter=tests/pipeline_schedules.tftest.hcl with the old main.tf: fails with Invalid Attribute Value Match on ref. This is the same error that consumers with short refs get on 19.5.0.
  • A mock plan with project push_rules shows Warning: Argument is deprecated ... Use gitlab_project_push_rules instead.
  • pre-commit run -a: Passed.

Notes for reviewers

  • The pin is exact. A consumer root module that pins gitlabhq/gitlab to another version fails terraform init. Each consumer must run terraform init -upgrade.
  • The provider deprecated the push_rules block of gitlab_project (main.tf:680) in 19.4.1, and it removes the block in 20.0. A migration to gitlab_project_push_rules needs import or moved work, so it is not in this PR.
  • A short tag name in pipeline_schedules[*].ref becomes refs/heads/<tag>. For a tag, consumers must write refs/tags/<tag>.
  • 19.2.x fixes gitlab_branch_protection errors with API-injected defaults for empty allowed_to_* lists. 19.4.0 moves gitlab_project_approval_rule to the plugin framework. Examine consumer plans for diffs on these resources.
  • A consumer plan was not run yet.

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.

@sirantd sirantd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wiseelf
wiseelf merged commit 41001fe into main Oct 23, 2026
2 checks passed
@wiseelf
wiseelf deleted the chore/gitlab-provider-19.5.0 branch October 23, 2026 03: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))
@github-actions

Copy link
Copy Markdown

This PR is included in version 2.2.1 🎉

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.

2 participants