fix(code_repository): remove access block and ignore_changes from all providers#396
Merged
Merged
Conversation
… 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>
gdrojas
approved these changes
Jun 16, 2026
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
"access": var.gitlab_collaborators_configfrom thegitlab-configurationresource attributeslifecycle { ignore_changes = [attributes] }from all three provider resources (gitlab,github,azure)Root cause
The
access.collaboratorsfield sent in thegitlab-configurationattributes is silently discarded by the providers API (main-providers-api). The field is not part of the spec'smapping, soProviderAttributesService.transformForStorage()never persists it andfilterForResponse()never returns it on GET.This caused permanent drift on every
tofu planafter apply: Terraform detected a difference between the desired state (withaccess) and what the API returned (withoutaccess).The
lifecycle { ignore_changes = [attributes] }blocks were a workaround that masked this symptom but also prevented detecting real changes tosetupfields.Validation
Tested full apply → plan cycle for both providers with no drift:
gitlab-configurationgithub-configurationFollow-up
A separate issue should be opened on
main-providers-apito addaccess.collaboratorsto thegitlab-configurationspec mapping, which would allow managing GitLab collaborators via Terraform natively.🤖 Generated with Claude Code