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

Changing pages source has no effect #2737

Closed
2 tasks done
rsyring opened this issue Sep 5, 2023 · 2 comments · Fixed by #2750
Closed
2 tasks done

Changing pages source has no effect #2737

rsyring opened this issue Sep 5, 2023 · 2 comments · Fixed by #2750
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. service/pages Categorizes issue or PR as related to the Pages service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Milestone

Comments

@rsyring
Copy link

rsyring commented Sep 5, 2023

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.5.6
on linux_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v4.13.0

Affected resource(s)

cloudflare_pages_project

Terraform configuration files

# Direct upload Pages project
resource "cloudflare_pages_project" "this" {
  account_id        = local.acct_id
  name              = local.app_ident
  production_branch = local.prod_branch
  build_config {
    destination_dir = "html"
  }
  source {
    type = "github"
    config {
      owner             = "level12"
      repo_name         = "juke-demo-static"
      production_branch = local.prod_branch
      # "*" is the API default, but the CF provider doesn't set it,
      # `plan` constantly shows a change is needed if not explicit.
      preview_branch_includes = ["*"]
    }
  }

Link to debug output

https://gist.github.com/rsyring/074c880f915495c502a21a040957cac6

Panic output

No response

Expected output

When the plan shows that the github repo_name should be changed, and I run apply, I expect the repo_name to be updated in Cloudflare. Subsequently, if I run plan again, I expect to see no changes.

Actual output

When the plan shows that the github repo_name should be changed, and I run apply, the repo_name value in Cloudflare is not updated. A subsequent plan shows the same change needing to be applied again.

Steps to reproduce

  1. Use a TF config similar to what I provided above.
  2. apply changes
  3. Change the github repo_name
  4. apply changes
  5. Run plan

Additional factoids

The root problem IMO is that the API accepts these values and ignores them. A consequence of only PATCH being available for a pages project and not PUT?

Best bet would be to figure out what values the CF API will actually set on a project and, if anything else needs modification in the plan, indicate the resource will need to be destroyed and re-created.

References

No response

@rsyring rsyring added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Sep 5, 2023
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/pages Categorizes issue or PR as related to the Pages service. labels Sep 5, 2023
@github-actions github-actions bot added this to the v4.15.0 milestone Sep 11, 2023
@github-actions
Copy link
Contributor

This functionality has been released in v4.15.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. service/pages Categorizes issue or PR as related to the Pages service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
2 participants