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

dep: update cloudflare-go to 0.102.0 #3713

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

BSFishy
Copy link
Contributor

@BSFishy BSFishy commented Aug 21, 2024

cloudflare-go v0.102.0 introduced breaking changes around Access application schemas. Update to the latest version and fix those breakages.

Tested using make test, which seems to pass, although I didn't run the acceptance tests.

Copy link
Contributor

This project handles dependency version bumps (including upstream changes from cloudflare-go) independently of the standard PR process using automation. This allows the dependency upgrades to land without causing merge conflicts in multiple branches and handled in a consistent way. The exception to this is security related dependency upgrades but they should be co-ordinated with the maintainer team privately.

Please remove the changes to the go.mod or go.sum files from this PR in order to proceed with review and merging.

Copy link
Contributor

github-actions bot commented Aug 21, 2024

changelog detected ✅

@BSFishy BSFishy changed the title feat: update cloudflare-go to 0.102.0 dep: update cloudflare-go to 0.102.0 Aug 21, 2024
@BSFishy BSFishy marked this pull request as ready for review August 21, 2024 16:22
@BSFishy BSFishy requested a review from jacobbednarz as a code owner August 21, 2024 16:22
@BSFishy
Copy link
Contributor Author

BSFishy commented Aug 21, 2024

Please remove the changes to the go.mod or go.sum files from this PR in order to proceed with review and merging.

Do I need to make this change without updating the dependency?

@jacobbednarz
Copy link
Member

i think that's fine here. it's largely to prevent random fly by PRs updating it and instead relying on dependabot.

i was only seeing the issue when running the acceptance test suite since it is hitting a nil deference.

@jacobbednarz
Copy link
Member

@BSFishy are you able to get this over the line? this is blocking some other PRs from landing as the access changes were part of the dependency needed.

@BSFishy
Copy link
Contributor Author

BSFishy commented Aug 27, 2024

Of course! I don't know which tests are failing, so not sure where to go from here, though

@jacobbednarz
Copy link
Member

TF_ACC=1 go test ./internal/sdkv2provider -v -run "^TestAccCloudflareAccessApplication_" -count 1 -timeout 120m -parallel 1
=== RUN   TestAccCloudflareAccessApplication_BasicZone
--- PASS: TestAccCloudflareAccessApplication_BasicZone (3.50s)
=== RUN   TestAccCloudflareAccessApplication_BasicAccount
--- PASS: TestAccCloudflareAccessApplication_BasicAccount (12.94s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigHttpBasic
    resource_cloudflare_access_application_test.go:144: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating Access Application for accounts "f037e56e89293a057740de681ac9abbe": error from makeRequest: access.api.error.invalid_request: configuring scim_config on apps is not enabled on your account (12130)
        
          with cloudflare_zero_trust_access_application.fdzfdvnhrv,
          on terraform_plugin_test.tf line 30, in resource "cloudflare_zero_trust_access_application" "fdzfdvnhrv":
          30: resource "cloudflare_zero_trust_access_application" "fdzfdvnhrv" {
        
--- FAIL: TestAccCloudflareAccessApplication_WithSCIMConfigHttpBasic (3.15s)
=== RUN   TestAccCloudflareAccessApplication_UpdateSCIMConfig
    resource_cloudflare_access_application_test.go:185: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating Access Application for accounts "f037e56e89293a057740de681ac9abbe": error from makeRequest: access.api.error.invalid_request: configuring scim_config on apps is not enabled on your account (12130)
        
          with cloudflare_zero_trust_access_application.pmjamtvdgv,
          on terraform_plugin_test.tf line 30, in resource "cloudflare_zero_trust_access_application" "pmjamtvdgv":
          30: resource "cloudflare_zero_trust_access_application" "pmjamtvdgv" {
        
--- FAIL: TestAccCloudflareAccessApplication_UpdateSCIMConfig (4.67s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigInvalidMappingSchema
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigInvalidMappingSchema (2.23s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigHttpBasicMissingRequired
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigHttpBasicMissingRequired (1.83s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigOAuthBearerToken
    resource_cloudflare_access_application_test.go:280: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating Access Application for accounts "f037e56e89293a057740de681ac9abbe": error from makeRequest: access.api.error.invalid_request: configuring scim_config on apps is not enabled on your account (12130)
        
          with cloudflare_zero_trust_access_application.slhvmhkskq,
          on terraform_plugin_test.tf line 30, in resource "cloudflare_zero_trust_access_application" "slhvmhkskq":
          30: resource "cloudflare_zero_trust_access_application" "slhvmhkskq" {
        
--- FAIL: TestAccCloudflareAccessApplication_WithSCIMConfigOAuthBearerToken (2.22s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2
    resource_cloudflare_access_application_test.go:320: Step 1/1 error: Error running apply: exit status 1
        
        Error: error creating Access Application for accounts "f037e56e89293a057740de681ac9abbe": error from makeRequest: access.api.error.invalid_request: configuring scim_config on apps is not enabled on your account (12130)
        
          with cloudflare_zero_trust_access_application.jdnmjbeica,
          on terraform_plugin_test.tf line 30, in resource "cloudflare_zero_trust_access_application" "jdnmjbeica":
          30: resource "cloudflare_zero_trust_access_application" "jdnmjbeica" {
        
--- FAIL: TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2 (2.46s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2MissingRequired
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2MissingRequired (1.72s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigAuthenticationInvalid
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigAuthenticationInvalid (1.53s)
=== RUN   TestAccCloudflareAccessApplication_WithCORS
--- PASS: TestAccCloudflareAccessApplication_WithCORS (3.03s)
=== RUN   TestAccCloudflareAccessApplication_WithSAMLSaas
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1011c7670]

goroutine 3134 [running]:
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.convertSaasSchemaToStruct(0x14000aa8800)
	/Users/jacob/src/github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/schema_cloudflare_access_application.go:919 +0x4c0
github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider.resourceCloudflareAccessApplicationCreate({0x101af6ed0, 0x1400084c4d0}, 0x14000aa8800, {0x101ad67a0, 0x140008949a0})
	/Users/jacob/src/github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_access_application.go:103 +0x678
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x14000cd42a0, {0x101af6e28, 0x140009d4c30}, 0x14000aa8800, {0x101ad67a0, 0x140008949a0})
	/Users/jacob/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:806 +0xe4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14000cd42a0, {0x101af6e28, 0x140009d4c30}, 0x14000789450, 0x14000aa8680, {0x101ad67a0, 0x140008949a0})
	/Users/jacob/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:937 +0x884
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x14000f95398, {0x101af6e28?, 0x140009d4ba0?}, 0x14000b102d0)
	/Users/jacob/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1153 +0xaa4
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x14000a1ad20, {0x101af6e28?, 0x140009d4390?}, 0x14000780000)
	/Users/jacob/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:865 +0x2b4
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x101a9b0c0, 0x14000a1ad20}, {0x101af6e28, 0x140009d4390}, 0x14000aa8000, 0x0)
	/Users/jacob/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000b4dc00, {0x101af6e28, 0x140009d4300}, {0x101afcd60, 0x140001b4600}, 0x1400016e000, 0x14000fc80f0, 0x10265f618, 0x0)
	/Users/jacob/go/pkg/mod/google.golang.org/[email protected]/server.go:1369 +0xb58
google.golang.org/grpc.(*Server).handleStream(0x14000b4dc00, {0x101afcd60, 0x140001b4600}, 0x1400016e000)
	/Users/jacob/go/pkg/mod/google.golang.org/[email protected]/server.go:1780 +0xb20
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/Users/jacob/go/pkg/mod/google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 3158
	/Users/jacob/go/pkg/mod/google.golang.org/[email protected]/server.go:1030 +0x13c
FAIL	github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider	40.775s
FAIL
make: *** [testacc] Error 1

@jacobbednarz
Copy link
Member

looking good now thanks!

=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2MissingRequired
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigOAuth2MissingRequired (1.31s)
=== RUN   TestAccCloudflareAccessApplication_WithSCIMConfigAuthenticationInvalid
--- PASS: TestAccCloudflareAccessApplication_WithSCIMConfigAuthenticationInvalid (1.46s)
=== RUN   TestAccCloudflareAccessApplication_WithCORS
--- PASS: TestAccCloudflareAccessApplication_WithCORS (2.59s)
=== RUN   TestAccCloudflareAccessApplication_WithSAMLSaas
--- PASS: TestAccCloudflareAccessApplication_WithSAMLSaas (6.79s)
=== RUN   TestAccCloudflareAccessApplication_WithSAMLSaas_Import
=== PAUSE TestAccCloudflareAccessApplication_WithSAMLSaas_Import
=== RUN   TestAccCloudflareAccessApplication_WithOIDCSaas
--- PASS: TestAccCloudflareAccessApplication_WithOIDCSaas (2.85s)
=== RUN   TestAccCloudflareAccessApplication_WithOIDCSaas_Import
=== PAUSE TestAccCloudflareAccessApplication_WithOIDCSaas_Import
=== RUN   TestAccCloudflareAccessApplication_WithAutoRedirectToIdentity
--- PASS: TestAccCloudflareAccessApplication_WithAutoRedirectToIdentity (8.98s)
=== RUN   TestAccCloudflareAccessApplication_WithEnableBindingCookie
--- PASS: TestAccCloudflareAccessApplication_WithEnableBindingCookie (3.17s)
=== RUN   TestAccCloudflareAccessApplication_WithCustomDenyFields
--- PASS: TestAccCloudflareAccessApplication_WithCustomDenyFields (2.85s)
=== RUN   TestAccCloudflareAccessApplication_WithADefinedIdps
--- PASS: TestAccCloudflareAccessApplication_WithADefinedIdps (4.51s)
=== RUN   TestAccCloudflareAccessApplication_WithMultipleIdpsReordered
--- PASS: TestAccCloudflareAccessApplication_WithMultipleIdpsReordered (13.69s)
=== RUN   TestAccCloudflareAccessApplication_WithHttpOnlyCookieAttribute
--- PASS: TestAccCloudflareAccessApplication_WithHttpOnlyCookieAttribute (2.68s)
=== RUN   TestAccCloudflareAccessApplication_WithHTTPOnlyCookieAttributeSetToFalse
--- PASS: TestAccCloudflareAccessApplication_WithHTTPOnlyCookieAttributeSetToFalse (2.71s)
=== RUN   TestAccCloudflareAccessApplication_WithSameSiteCookieAttribute
--- PASS: TestAccCloudflareAccessApplication_WithSameSiteCookieAttribute (2.59s)
=== RUN   TestAccCloudflareAccessApplication_WithLogoURL
--- PASS: TestAccCloudflareAccessApplication_WithLogoURL (2.60s)
=== RUN   TestAccCloudflareAccessApplication_WithSkipInterstitial
--- PASS: TestAccCloudflareAccessApplication_WithSkipInterstitial (2.60s)
=== RUN   TestAccCloudflareAccessApplication_WithAppLauncherVisible
--- PASS: TestAccCloudflareAccessApplication_WithAppLauncherVisible (2.91s)
=== RUN   TestAccCloudflareAccessApplication_WithSelfHostedDomains
--- PASS: TestAccCloudflareAccessApplication_WithSelfHostedDomains (9.61s)
=== RUN   TestAccCloudflareAccessApplication_WithDefinedTags
--- PASS: TestAccCloudflareAccessApplication_WithDefinedTags (9.33s)
=== RUN   TestAccCloudflareAccessApplication_WithReusablePolicies
--- PASS: TestAccCloudflareAccessApplication_WithReusablePolicies (9.84s)
=== RUN   TestAccCloudflareAccessApplication_WithAppLauncherCustomization
--- PASS: TestAccCloudflareAccessApplication_WithAppLauncherCustomization (2.74s)
=== RUN   TestAccCloudflareAccessApplication_AuthTypeForcesNewResource
--- PASS: TestAccCloudflareAccessApplication_AuthTypeForcesNewResource (8.69s)
=== CONT  TestAccCloudflareAccessApplication_WithSAMLSaas_Import
--- PASS: TestAccCloudflareAccessApplication_WithSAMLSaas_Import (6.73s)
=== CONT  TestAccCloudflareAccessApplication_WithOIDCSaas_Import
--- PASS: TestAccCloudflareAccessApplication_WithOIDCSaas_Import (3.79s)

@jacobbednarz jacobbednarz merged commit dbac330 into cloudflare:master Aug 29, 2024
9 checks passed
@github-actions github-actions bot added this to the v4.41.0 milestone Aug 29, 2024
@BSFishy BSFishy deleted the update_cfgo branch August 29, 2024 14:02
Copy link
Contributor

github-actions bot commented Sep 4, 2024

This functionality has been released in v4.41.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 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants