Skip to content

Conversation

@cha0tic87
Copy link

Removal of zone_name from Cloudflare record response following API deprecation

Description

Cloudflare deprecated zone_name from individual DNS records on 2024-11-30, as outlined at https://developers.cloudflare.com/fundamentals/api/reference/deprecations/:


Zone information in individual DNS records
Deprecation date: November 30, 2024

Currently, each individual DNS record returned by the API contains information about the zone it is on, specifically the zone ID and name.

{
"result": [
{
// ...
"zone_id": "ab922473c42f4e50819d7c1c9b81b16b",
"zone_name": "example.com"
}
],
// ...
}
This information is redundant because both affected API routes are already within the zone scope. In particular, the zone ID will already be known to any user of these routes because it appears in the URL. The zone name can be retrieved by making a GET request to /zones/:zone_id if it is necessary.

After November 30th, 2024, Cloudflare will stop including the zone_id and zone_name fields on individual DNS records in API responses. These fields are currently ignored when sent to the API as part of a request body, so no changes to request bodies are required.


This is a breaking change in libcloud when fetching records inside zones managed by Cloudflare. This PR removes the check for zone_name attributes in DNS records returned by the Cloudflare API.

Status

Ready for review

Checklist (tick everything that applies)

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.35%. Comparing base (2b978cd) to head (c30edf1).

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #2068      +/-   ##
==========================================
- Coverage   83.35%   83.35%   -0.00%     
==========================================
  Files         353      353              
  Lines       81850    81848       -2     
  Branches     8998     8998              
==========================================
- Hits        68226    68224       -2     
  Misses      10797    10797              
  Partials     2827     2827              
Files with missing lines Coverage Δ
libcloud/dns/drivers/cloudflare.py 91.07% <ø> (-0.08%) ⬇️
libcloud/test/dns/test_cloudflare.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@micafer micafer left a comment

Choose a reason for hiding this comment

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

LGTM

@micafer micafer merged commit 6a7f04a into apache:trunk Feb 11, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants