Repository: favonia/cloudflare-ddns
Pull request #367 (2023-01-18 05:03:10)

build(deps): bump github.com/cloudflare/cloudflare-go from 0.58.0 to 0.59.0
Bumps [github.com/cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go) from 0.58.0 to 0.59.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/cloudflare/cloudflare-go/releases">github.com/cloudflare/cloudflare-go's releases</a>.</em></p>
<blockquote>
<h2>v0.59.0</h2>
<p>BREAKING CHANGES:</p>
<ul>
<li>dns: remove these read-only fields from <code>UpdateDNSRecordParams</code>: <code>CreatedOn</code>, <code>ModifiedOn</code>, <code>Meta</code>, <code>ZoneID</code>, <code>ZoneName</code>, <code>Proxiable</code>, and <code>Locked</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1170">#1170</a>)</li>
<li>dns: the fields <code>CreatedOn</code> and <code>ModifiedOn</code> are removed from <code>ListDNSRecordsParams</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
</ul>
<p>NOTES:</p>
<ul>
<li>dns: remove additional lookup from <code>Update</code> operations when <code>Name</code> or <code>Type</code> was omitted (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1170">#1170</a>)</li>
</ul>
<p>ENHANCEMENTS:</p>
<ul>
<li>access_organization: add user_seat_expiration_inactive_time field (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1159">#1159</a>)</li>
<li>dns: <code>GetDNSRecord</code>, <code>UpdateDNSRecord</code> and <code>DeleteDNSRecord</code> now return the new, dedicated error <code>ErrMissingDNSRecordID</code> when an empty DNS record ID is given. (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1174">#1174</a>)</li>
<li>dns: the URL parameter <code>tag-match</code> for listing DNS records is now supported as the field <code>TagMatch</code> in <code>ListDNSRecordsParams</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
<li>dns: update default <code>per_page</code> attribute to 100 records (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1171">#1171</a>)</li>
<li>teams_rules: adds support for Egress Policies (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1142">#1142</a>)</li>
<li>workers: Add support for compatibility_date and compatibility_flags when upoading a worker script (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1177">#1177</a>)</li>
<li>workers: script upload now supports Queues bindings (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1176">#1176</a>)</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>dns: don't send &quot;priority&quot; for list operations as it isn't supported and is only used for internal filtering (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1167">#1167</a>)</li>
<li>dns: the field <code>Tags</code> in <code>ListDNSRecordsParams</code> was not correctly serialized into URL queries (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
<li>managednetworks: Update should be PUT (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1172">#1172</a>)</li>
</ul>
<h2>v0.58.1</h2>
<p>ENHANCEMENTS:</p>
<ul>
<li>cloudflare: automatically redact sensitive values from HTTP interactions (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1164">#1164</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/cloudflare/cloudflare-go/blob/master/CHANGELOG.md">github.com/cloudflare/cloudflare-go's changelog</a>.</em></p>
<blockquote>
<h2>0.59.0 (January 18th, 2023)</h2>
<p>BREAKING CHANGES:</p>
<ul>
<li>dns: remove these read-only fields from <code>UpdateDNSRecordParams</code>: <code>CreatedOn</code>, <code>ModifiedOn</code>, <code>Meta</code>, <code>ZoneID</code>, <code>ZoneName</code>, <code>Proxiable</code>, and <code>Locked</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1170">#1170</a>)</li>
<li>dns: the fields <code>CreatedOn</code> and <code>ModifiedOn</code> are removed from <code>ListDNSRecordsParams</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
</ul>
<p>NOTES:</p>
<ul>
<li>dns: remove additional lookup from <code>Update</code> operations when <code>Name</code> or <code>Type</code> was omitted (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1170">#1170</a>)</li>
</ul>
<p>ENHANCEMENTS:</p>
<ul>
<li>access_organization: add user_seat_expiration_inactive_time field (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1159">#1159</a>)</li>
<li>dns: <code>GetDNSRecord</code>, <code>UpdateDNSRecord</code> and <code>DeleteDNSRecord</code> now return the new, dedicated error <code>ErrMissingDNSRecordID</code> when an empty DNS record ID is given. (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1174">#1174</a>)</li>
<li>dns: the URL parameter <code>tag-match</code> for listing DNS records is now supported as the field <code>TagMatch</code> in <code>ListDNSRecordsParams</code> (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
<li>dns: update default <code>per_page</code> attribute to 100 records (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1171">#1171</a>)</li>
<li>teams_rules: adds support for Egress Policies (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1142">#1142</a>)</li>
<li>workers: Add support for compatibility_date and compatibility_flags when upoading a worker script (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1177">#1177</a>)</li>
<li>workers: script upload now supports Queues bindings (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1176">#1176</a>)</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>dns: don't send &quot;priority&quot; for list operations as it isn't supported and is only used for internal filtering (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1167">#1167</a>)</li>
<li>dns: the field <code>Tags</code> in <code>ListDNSRecordsParams</code> was not correctly serialized into URL queries (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1173">#1173</a>)</li>
<li>managednetworks: Update should be PUT (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1172">#1172</a>)</li>
</ul>
<h2>0.58.1 (January 5th, 2023)</h2>
<p>ENHANCEMENTS:</p>
<ul>
<li>cloudflare: automatically redact sensitive values from HTTP interactions (<a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1164">#1164</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/2855fd429a31f71d1fe010f3403e52a297307961"><code>2855fd4</code></a> Update CHANGELOG.md</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/4fd6abdecbd4ea21ac2d049a5126b738efd584d3"><code>4fd6abd</code></a> Update CHANGELOG.md for <a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1176">#1176</a></li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/300bc0649eeb88488449902042ee616c996cee6f"><code>300bc06</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1176">#1176</a> from jbw1991/jwheeler/queue-binding</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/d95c40c52c0fdbfe5beb8070128d4a66bdb604a1"><code>d95c40c</code></a> Add changelog entry for queues bindings</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/f2c7757dc28bfde2e203fd991b3d58ae4d91d54d"><code>f2c7757</code></a> Add queue binding type</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/4ec00432f931717f0c166c1962a2913d6947b33e"><code>4ec0043</code></a> Update CHANGELOG.md for <a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1177">#1177</a></li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/547c05913acaf27042dafe3eaf7917cd3d8cd1dd"><code>547c059</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/cloudflare/cloudflare-go/issues/1177">#1177</a> from Shopify/add-support-for-compatibility-flags</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/09767265edf6a24848bf4890557caf64f08dee55"><code>0976726</code></a> lint</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/5161538b3b812854523902ad6545e2173178ee5b"><code>5161538</code></a> add changelog</li>
<li><a href="https://github.com/cloudflare/cloudflare-go/commit/468a02dae4c1b32fd05ddeca3ee18fa7d204cbda"><code>468a02d</code></a> Add support for compatibility date</li>
<li>Additional commits viewable in <a href="https://github.com/cloudflare/cloudflare-go/compare/v0.58.0...v0.59.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cloudflare/cloudflare-go&package-manager=go_modules&previous-version=0.58.0&new-version=0.59.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

codecov[bot]: # [Codecov](https://codecov.io/gh/favonia/cloudflare-ddns/pull/367?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) Report
> Merging [#367](https://codecov.io/gh/favonia/cloudflare-ddns/pull/367?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) (9472a8c) into [main](https://codecov.io/gh/favonia/cloudflare-ddns/commit/09bbaf4bcb8be0fd0865e7f5f998e53f6dcb0741?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) (09bbaf4) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##             main     #367   +/-   ##
=======================================
  Coverage   87.90%   87.90%           
=======================================
  Files          32       32           
  Lines        2051     2051           
=======================================
  Hits         1803     1803           
  Misses        236      236           
  Partials       12       12           
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `87.90% <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#carryforward-flags-in-the-pull-request-comment) to find out more.


:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia)


Patch:
diff --git a/go.mod b/go.mod
index 5552ff5..769a3a4 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/favonia/cloudflare-ddns
 go 1.19
 
 require (
-	github.com/cloudflare/cloudflare-go v0.58.0
+	github.com/cloudflare/cloudflare-go v0.59.0
 	github.com/golang/mock v1.6.0
 	github.com/hashicorp/go-retryablehttp v0.7.2
 	github.com/jellydator/ttlcache/v3 v3.0.1
diff --git a/go.sum b/go.sum
index abbb229..7415f9a 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/cloudflare/cloudflare-go v0.58.0 h1:m6b12UxePZDtZhcKXMGpzgvFzXLUqlI9u0/uiSP03as=
-github.com/cloudflare/cloudflare-go v0.58.0/go.mod h1:QaA8x4JI0/gA/tni1nTdyimFuyEGJi8cB7YSGoFhXFo=
+github.com/cloudflare/cloudflare-go v0.59.0 h1:1QFD8h1bIMMVRsCsfoWPwF4eEeXFv59rW5PCVjkCvuk=
+github.com/cloudflare/cloudflare-go v0.59.0/go.mod h1:QaA8x4JI0/gA/tni1nTdyimFuyEGJi8cB7YSGoFhXFo=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=


Test patch:
diff --git a/internal/api/cloudflare_test.go b/internal/api/cloudflare_test.go
index a91b8c2..4e6c412 100644
--- a/internal/api/cloudflare_test.go
+++ b/internal/api/cloudflare_test.go
@@ -167,10 +167,15 @@ func mockZone(name string, i int, status string) *cloudflare.Zone {
 	}
 }
 
+const (
+	zonePageSize      = 50
+	dnsRecordPageSize = 100
+)
+
 func mockZonesResponse(zoneName string, zoneStatuses []string) *cloudflare.ZonesResponse {
 	numZones := len(zoneStatuses)
 
-	if numZones > 50 {
+	if numZones > zonePageSize {
 		panic("mockZonesResponse got too many zone names")
 	}
 
@@ -183,8 +188,8 @@ func mockZonesResponse(zoneName string, zoneStatuses []string) *cloudflare.Zones
 		Result: zones,
 		ResultInfo: cloudflare.ResultInfo{
 			Page:       1,
-			PerPage:    50,
-			TotalPages: (numZones + 49) / 50,
+			PerPage:    zonePageSize,
+			TotalPages: (numZones + zonePageSize - 1) / zonePageSize,
 			Count:      numZones,
 			Total:      numZones,
 			Cursor:     "",
@@ -206,7 +211,7 @@ func handleZones(t *testing.T, zoneName string, zoneStatuses []string, w http.Re
 	require.Equal(t, url.Values{
 		"account.id": {mockAccount},
 		"name":       {zoneName},
-		"per_page":   {"50"},
+		"per_page":   {fmt.Sprintf("%d", zonePageSize)},
 	}, r.URL.Query())
 
 	w.Header().Set("content-type", "application/json")
@@ -566,7 +571,7 @@ func TestListRecords(t *testing.T) {
 			require.Equal(t, url.Values{
 				"name":     {"sub.test.org"},
 				"page":     {"1"},
-				"per_page": {"50"},
+				"per_page": {fmt.Sprintf("%d", dnsRecordPageSize)},
 				"type":     {ipNet.RecordType()},
 			}, r.URL.Query())
 
@@ -618,7 +623,7 @@ func TestListRecordsInvalidIPAddress(t *testing.T) {
 			require.Equal(t, url.Values{
 				"name":     {"sub.test.org"},
 				"page":     {"1"},
-				"per_page": {"50"},
+				"per_page": {fmt.Sprintf("%d", dnsRecordPageSize)},
 				"type":     {ipNet.RecordType()},
 			}, r.URL.Query())
 
@@ -684,7 +689,7 @@ func TestListRecordsWildcard(t *testing.T) {
 			require.Equal(t, url.Values{
 				"name":     {"*.test.org"},
 				"page":     {"1"},
-				"per_page": {"50"},
+				"per_page": {fmt.Sprintf("%d", dnsRecordPageSize)},
 				"type":     {ipNet.RecordType()},
 			}, r.URL.Query())