Repository navigation
fix: Correct legacy etag handling logic - #3637
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
408a044 to
a65d759
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Critical validation and stale-state issues remain, alongside schema compatibility and regression-test concerns.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This pull request revises legacy ETag handling to prevent stale Terraform state after failed updates.
Changes:
- Makes resource ETags computed-only and suppresses their planned diffs.
- Clears cached ETags before updates.
- Reclassifies ETag documentation as read-only.
- Removes legacy ETag tests.
File summaries
| File | Description |
|---|---|
github/util_diff.go |
Adds shared ETag diff clearing; regression coverage is needed. |
github/resource_organization_block.go |
Updates ETag schema handling. |
github/resource_github_user_ssh_key.go |
Updates ETag schema handling. |
github/resource_github_user_gpg_key.go |
Updates ETag schema handling. |
github/resource_github_team.go |
Clears ETag during team updates. |
github/resource_github_team_sync_group_mapping.go |
Clears ETag during mapping updates. |
github/resource_github_team_repository.go |
Clears ETag during repository updates. |
github/resource_github_team_membership.go |
Clears ETag during membership updates. |
github/resource_github_repository.go |
Revises ETag behavior; update ordering and schema compatibility require changes. |
github/resource_github_repository_webhook.go |
Clears ETag during webhook updates. |
github/resource_github_repository_ruleset.go |
Revises ruleset ETag handling. |
github/resource_github_repository_project.go |
Updates ETag schema handling. |
github/resource_github_repository_deployment_branch_policy.go |
Clears ETag before updates. |
github/resource_github_repository_deploy_key.go |
Updates ETag schema handling. |
github/resource_github_repository_autolink_reference.go |
Updates ETag schema handling. |
github/resource_github_release.go |
Revises release ETag behavior. |
github/resource_github_project_column.go |
Updates ETag schema handling. |
github/resource_github_project_card.go |
Updates ETag schema handling. |
github/resource_github_organization_webhook.go |
Clears ETag during webhook updates. |
github/resource_github_organization_ruleset.go |
Revises ruleset ETag handling. |
github/resource_github_organization_project.go |
Updates ETag schema handling. |
github/resource_github_membership.go |
Clears ETag during membership updates. |
github/resource_github_issue.go |
Clears ETag during issue updates. |
github/resource_github_issue_label.go |
Clears ETag during label updates. |
github/resource_github_etag_unit_test.go |
Removes legacy ETag unit tests. |
github/resource_github_etag_acc_test.go |
Removes legacy ETag acceptance tests. |
github/resource_github_enterprise_actions_runner_group.go |
Clears ETag during updates. |
github/resource_github_emu_group_mapping.go |
Revises mapping ETag behavior. |
github/resource_github_branch.go |
Clears ETag during branch updates. |
github/resource_github_branch_protection_v3.go |
Clears ETag during updates. |
github/resource_github_branch_default.go |
Revises default-branch ETag handling. |
github/resource_github_actions_runner_group.go |
Clears ETag during updates. |
github/data_source_github_ref.go |
Adds unsupported data-source CustomizeDiff; removal is required. |
github/data_source_github_membership.go |
Adds unsupported data-source CustomizeDiff; removal is required. |
github/data_source_github_branch.go |
Adds unsupported data-source CustomizeDiff; removal is required. |
docs/resources/repository.md |
Marks ETag read-only. |
docs/resources/release.md |
Marks ETag read-only. |
docs/resources/branch_default.md |
Marks ETag read-only. |
Review details
- Files reviewed: 38/38 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a65d759 to
36da80b
Compare
robert-crandall
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks for fixing the failed-update drift issue and simplifying the ETag handling!
integrations#3637 replaced the Optional plus DiffSuppressFunc etag from integrations#3474 with a plain Computed attribute and CustomizeDiff: diffETag. Move the signing key resource over, reverting the block added in 0bf03e6, and regenerate the docs for both resources so etag is listed as read only.
integrations#3637 replaced the Optional plus DiffSuppressFunc etag from integrations#3474 with a plain Computed attribute and CustomizeDiff: diffETag. Move the signing key resource over, reverting the block added in 0bf03e6, and regenerate the docs for both resources so etag is listed as read only.
integrations#3637 replaced the Optional plus DiffSuppressFunc etag from integrations#3474 with a plain Computed attribute and CustomizeDiff: diffETag. Move the signing key resource over, reverting the block added in 0bf03e6, and regenerate the docs for both resources so etag is listed as read only.
Resolves #3519
This PR reverts the changes made in #3311 & #2840. While this change is technically a breaking change, anyone setting the
etagattribute on a resource will have broken the provider and as such this change shouldn't require a Semver major bump. Note that the removed tests weren't functional and that the new implementation relies on documented Terraform Plugin SDK v2 behaviour.Before the change?
etagattribute for resources had been made optional to support suppressing the diff which is fundamentally incorrectAfter the change?
etagattribute is suppressed in all diffsPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!