Andy Hay 3dd839a33e
chore(cloudflare): migrate customhostname to v5 (#5891)
* chore(cloudflare): migrate customhostname to v5

* style: use range instead of loop

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: remove extra space

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: spelling

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* test(cloudflare): restore missing tests dropped during merge

* style: use t.Context() and t.Parallel() in restored tests

* refactor(cloudflare): split submitCustomHostnameChanges to reduce complexity

* style: apply gofmt to restored tests

* test: restore valid tests from master and append custom ones

* fix(cloudflare): migrate tests to v5 SDK error types and fix PerPage handling

- Replace all cloudflarev0.Error usages with cloudflare.Error in tests
- Remove unused cloudflarev0 import
- Fix getDNSRecordsMap to use PerPage configuration
- Add early return in convertCloudflareError for structured v5 errors
- Update TestConvertCloudflareError to handle v5 error types safely
- Remove ErrorCodes field from error structs (not in v5 SDK)

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>

* style(cloudflare): apply gofmt formatting

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>

* Update provider/cloudflare/cloudflare_test.go

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* test: add to test

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* fix: change context

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* style: use short variable declaration operator instead of var

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* refactor(cloudflare): address PR review feedback

- Remove SDK migration status section from cloudflare.md (per vflaux and ivankatliarchuk)
- Add newCloudflareError() helper for proper v5 SDK error testing
- Move ExampleDomain, TestGroupByNameAndTypeWithCustomHostnames_MX, and
  TestProviderPropertiesIdempotency back to original locations to minimize diff

* test: add customhostname test

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* refactor: make CustomHostname types package-internal

* style: fix gofmt formatting

* Update .gitignore

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

---------

Signed-off-by: Andrew Hay <andrew.hay@benchmarkanalytics.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-15 01:59:37 +05:30
..