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

Add Regional Tiered Cache API support #1336

Merged
merged 4 commits into from Jul 18, 2023
Merged

Add Regional Tiered Cache API support #1336

merged 4 commits into from Jul 18, 2023

Conversation

joshuamsager
Copy link
Contributor

@joshuamsager joshuamsager commented Jul 17, 2023

Description

Closes #1334

Has your change been tested?

Tests added in: regional_tiered_cache_test.go

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

Note: contrary to the docs on: https://developers.cloudflare.com/api/operations/zone-cache-settings-change-regional-tiered-cache-setting, this API does in-fact return result.value:

❯ curl https://api.cloudflare.com/client/v4/zones/<REDACTED>/cache/regional_tiered_cache | jq
{
  "result": {
    "editable": true,
    "id": "tc_regional",
    "value": "off"
  },
  "success": true,
  "errors": [],
  "messages": []
}

@github-actions
Copy link
Contributor

github-actions bot commented Jul 17, 2023

changelog detected ✅

Comment on lines +26 to +29
type zoneRegionalTieredCacheSingleResponse struct {
Response
Result RegionalTieredCache `json:"result"`
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if this separate struct is preferred (since the contents are the same)... saw this pattern introduced here: f047e55#diff-46ac00cf63f77e30464ff4ec022cc846b403a56c9e91b9b84f1de982aae6419cR30-R33

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this seems 👌

@jacobbednarz
Copy link
Member

Note: contrary to the docs on: https://developers.cloudflare.com/api/operations/zone-cache-settings-change-regional-tiered-cache-setting, this API does in-fact return result.value:

thanks - i've confirmed internally this is just a byproduct of the rendering of the example.

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2023

Codecov Report

Merging #1336 (b29950d) into master (b9ac804) will increase coverage by 0.08%.
The diff coverage is 59.10%.

@@            Coverage Diff             @@
##           master    #1336      +/-   ##
==========================================
+ Coverage   48.33%   48.42%   +0.08%     
==========================================
  Files         133      134       +1     
  Lines       13023    13104      +81     
==========================================
+ Hits         6295     6345      +50     
- Misses       5201     5220      +19     
- Partials     1527     1539      +12     
Impacted Files Coverage Δ
regional_tiered_cache.go 43.75% <43.75%> (ø)
logpush.go 51.81% <46.15%> (-0.30%) ⬇️
rulesets.go 30.03% <52.17%> (-4.61%) ⬇️
pages_deployment.go 38.88% <61.76%> (+4.64%) ⬆️
pages_project.go 58.22% <90.00%> (+7.40%) ⬆️
access_policy.go 70.27% <100.00%> (ø)
pagination.go 100.00% <100.00%> (+28.57%) ⬆️

... and 1 file with indirect coverage changes

@jacobbednarz jacobbednarz merged commit 544edf5 into cloudflare:master Jul 18, 2023
11 checks passed
@github-actions github-actions bot added this to the v0.73.0 milestone Jul 18, 2023
@jacobbednarz
Copy link
Member

much appreciated @joshuamsager 👏

github-actions bot pushed a commit that referenced this pull request Jul 18, 2023
@joshuamsager joshuamsager deleted the joshuamsager/add-regional-tiered-cache-configuration branch July 18, 2023 12:27
@github-actions
Copy link
Contributor

This functionality has been released in v0.73.0.

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 Jul 19, 2023
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.

support regional tiered cache setting
3 participants