Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to default branch in v3.1.0 breaks refresh of existing resources #564

Closed
onematchfox opened this issue Oct 13, 2020 · 5 comments
Closed
Labels
r/repository_file Status: Stale Used by stalebot to clean house Type: Bug Something isn't working as documented

Comments

@onematchfox
Copy link

onematchfox commented Oct 13, 2020

v3.1.0 included https://github.com/terraform-providers/terraform-provider-github/pull/562 which adjusted the default branch on resources from master to main. This breaks the refresh of existing state on resources like github_repository_file where the branch was not explicitly set as these are now being refreshed against the incorrect branch. May be more resources affected?

Expected Behavior

Breaking changes should not be introduced by minor version increments. Existing resources should not be replaced.

Actual Behavior

Files provisioned by the github_repository_file resources are being destroyed and then fail to be recreated as the new "default" branch does not exist.

# github_repository_file.file must be replaced
-/+ resource "github_repository_file" "file" {
      ~ branch              = "master" -> "main" # forces replacement
      .....
    }

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Provision a file using the github_repository_file with branch not set explicitly using v3.0.0
  2. Upgrade to v3.1.0 and run `terraform plan again

References

@onematchfox onematchfox changed the title Breaking change included in v3.1.0 Change to default branch in v3.1.0 breaks refresh of existing resources Oct 13, 2020
@jcudit jcudit added Type: Bug Something isn't working as documented r/repository_file labels Nov 25, 2020
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Dec 7, 2022
@doug-skinner
Copy link

@jcudit has there been any progress on this issue? It's currently affecting our usage of this resource at my company.

@kfcampbell
Copy link
Member

Jeremy does not work at GitHub anymore unfortunately! I miss having him around. To the best of my knowledge, there's been no progress on this issue, though ideas and PRs are welcome!

@github-actions github-actions bot removed the Status: Stale Used by stalebot to clean house label Dec 8, 2022
@sbkg0002
Copy link

This also seems to happen when you rename the repository name.

@github-actions
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Oct 11, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r/repository_file Status: Stale Used by stalebot to clean house Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

5 participants