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

Adds support for Tiered Caching #1149

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

iveelsm
Copy link
Contributor

@iveelsm iveelsm commented Dec 21, 2022

Adds support for utilizing previously undocumented APIs for Tiered Caching endpoints. It allows for setting zones to utilize either generic, smart or off.

Implementation:

  • Adds three new api methods for manipulating tiered cache settings
    • GetTieredCache which returns the current setting
    • SetTieredCache which allows for manipulation of existing settings
    • DeleteTieredCache which allows for unsetting tiered cache

Description

Tiered Caching is a common use case for many developers. This adds support for utilizing the library to set tiered cache topologies and manipulate them.

Has your change been tested?

Yes.

Screenshots (if appropriate):

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 (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

@iveelsm
Copy link
Contributor Author

iveelsm commented Dec 21, 2022

This is still pending documentation updates which are in progress.

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2022

Codecov Report

Merging #1149 (6e8972f) into master (4ddb00c) will decrease coverage by 0.65%.
The diff coverage is 52.85%.

❗ Current head 6e8972f differs from pull request most recent head 84d4c7e. Consider uploading reports for the commit 84d4c7e to get more accurate results

@@            Coverage Diff             @@
##           master    #1149      +/-   ##
==========================================
- Coverage   50.11%   49.45%   -0.66%     
==========================================
  Files         121      127       +6     
  Lines       11722    12278     +556     
==========================================
+ Hits         5874     6072     +198     
- Misses       4565     4828     +263     
- Partials     1283     1378      +95     
Impacted Files Coverage Δ
device_posture_rule.go 61.80% <ø> (ø)
errors.go 42.10% <ø> (+1.31%) ⬆️
pages_deployment.go 34.24% <ø> (-0.24%) ⬇️
pages_domain.go 71.27% <ø> (ø)
pages_project.go 50.81% <ø> (ø)
rulesets.go 35.09% <ø> (ø)
workers_account_settings.go 29.41% <0.00%> (-6.31%) ⬇️
workers_tail.go 52.00% <ø> (ø)
workers_secrets.go 29.41% <28.00%> (-16.05%) ⬇️
workers_cron_triggers.go 29.41% <29.41%> (-16.05%) ⬇️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 21, 2022

changelog detected ✅

@jacobbednarz
Copy link
Member

how does this interact with the existing methods in argo.go?

@iveelsm
Copy link
Contributor Author

iveelsm commented Dec 21, 2022

how does this interact with the existing methods in argo.go?

It doesn't interact at all, rather intentionally. /argo/tiered_caching and /cache/tiered_cache_smart_topology_enable are tightly coupled endpoints that require interactions with both in order to properly manipulate tiered cache settings. I did not want to make a direct reflection of the API as there will be some refactors and deprecations to the underlying endpoints that will eventual wrangle tiered cache under one banner.

While I could likely remove some of the generic tiered caching work and interact with the existing argo.go, I felt it better to contain the interactions in a single file and not to develop dependencies between the two given the upcoming refactor work.

@iveelsm
Copy link
Contributor Author

iveelsm commented Dec 22, 2022

Leaving placeholders for the API changes as those are pending release right now. This should be ready to go @jacobbednarz

Adds support for utilizing previously undocumented APIs for Tiered Caching endpoints. It allows for setting zones to utilize either generic, smart or off.

Implementation:

* Adds three new api methods for manipulating tiered cache settings
  * GetTieredCache which returns the current setting
  * SetTieredCache which allows for manipulation of existing settings
  * DeleteTieredCache which allows for unsetting tiered cache
tiered_cache_test.go Outdated Show resolved Hide resolved
@jacobbednarz jacobbednarz merged commit 9c930e4 into cloudflare:master Dec 22, 2022
@github-actions github-actions bot added this to the v0.58.0 milestone Dec 22, 2022
github-actions bot pushed a commit that referenced this pull request Dec 22, 2022
@jacobbednarz jacobbednarz modified the milestones: v0.58.0, v0.57.1 Dec 23, 2022
@github-actions
Copy link
Contributor

This functionality has been released in v0.57.1.

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

ivan-section-io pushed a commit to section/cloudflare-go that referenced this pull request Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants