Skip to content

fix(code_repository): remove access block and ignore_changes from all providers#396

Merged
sebastiancorrea81 merged 3 commits into
mainfrom
fix/code-repository-remove-access-drift
Jun 16, 2026
Merged

fix(code_repository): remove access block and ignore_changes from all providers#396
sebastiancorrea81 merged 3 commits into
mainfrom
fix/code-repository-remove-access-drift

Conversation

@sebastiancorrea81

Copy link
Copy Markdown
Collaborator

Summary

  • Removes "access": var.gitlab_collaborators_config from the gitlab-configuration resource attributes
  • Removes lifecycle { ignore_changes = [attributes] } from all three provider resources (gitlab, github, azure)

Root cause

The access.collaborators field sent in the gitlab-configuration attributes is silently discarded by the providers API (main-providers-api). The field is not part of the spec's mapping, so ProviderAttributesService.transformForStorage() never persists it and filterForResponse() never returns it on GET.

This caused permanent drift on every tofu plan after apply: Terraform detected a difference between the desired state (with access) and what the API returned (without access).

The lifecycle { ignore_changes = [attributes] } blocks were a workaround that masked this symptom but also prevented detecting real changes to setup fields.

Validation

Tested full apply → plan cycle for both providers with no drift:

Provider Apply Drift post-apply Update in-place
gitlab-configuration ✅ No changes
github-configuration ✅ No changes

Follow-up

A separate issue should be opened on main-providers-api to add access.collaborators to the gitlab-configuration spec mapping, which would allow managing GitLab collaborators via Terraform natively.

🤖 Generated with Claude Code

sebas_correa and others added 2 commits June 16, 2026 12:24
… providers

The `access.collaborators` field in the gitlab-configuration attributes is
silently discarded by the providers API — not part of the spec mapping, so
never stored nor returned on GET. This caused permanent drift on every plan.

Removes `lifecycle { ignore_changes = [attributes] }` from all three provider
resources (gitlab, github, azure). Verified that none of them generate drift
without it — the API persists attributes correctly for all providers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Variable is no longer used after removing the access block from gitlab
attributes. Its required validation would break existing users not passing it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sebastiancorrea81 sebastiancorrea81 merged commit 4295a7f into main Jun 16, 2026
44 checks passed
@sebastiancorrea81 sebastiancorrea81 deleted the fix/code-repository-remove-access-drift branch June 16, 2026 16:13
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