Remove Linode APIv3 support#2132
Conversation
|
|
||
| def __repr__(self): | ||
| return "<LinodeException '%s'>" % self.message | ||
| return "<LinodeExceptionV4 '%s'>" % self.message |
There was a problem hiding this comment.
Pull request overview
Removes the retired Linode API v3 implementation and associated test coverage, leaving only Linode API v4 support.
Changes:
- Removed Linode API v3 DNS/Compute driver implementations and common API v3 helpers/constants.
- Deleted API v3 unit tests and JSON fixtures.
- Added regression tests asserting
api_version="3.0"now raisesNotImplementedError.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libcloud/test/dns/test_linode_v4.py | Adds coverage to ensure API v3 selection is rejected. |
| libcloud/test/dns/test_linode.py | Removes API v3 DNS driver tests. |
| libcloud/test/dns/fixtures/linode/update_resource.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/update_domain.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/resource_list_does_not_exist.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/resource_list.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/get_zone_does_not_exist.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/get_zone.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/get_record_does_not_exist.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/get_record.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/domain_list.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/delete_resource_does_not_exist.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/delete_resource.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/delete_domain_does_not_exist.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/delete_domain.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/create_resource.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/create_domain_validation_error.json | Removes API v3 DNS fixture. |
| libcloud/test/dns/fixtures/linode/create_domain.json | Removes API v3 DNS fixture. |
| libcloud/test/compute/test_linode_v4.py | Adds coverage to ensure API v3 selection is rejected. |
| libcloud/test/compute/test_linode.py | Removes API v3 compute driver tests. |
| libcloud/test/compute/fixtures/linode/_linode_list.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_linode_ip_list.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_linode_disk_list.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_batch.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_avail_linodeplans.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_avail_kernels.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_avail_distributions.json | Removes API v3 compute fixture. |
| libcloud/test/compute/fixtures/linode/_avail_datacenters.json | Removes API v3 compute fixture. |
| libcloud/dns/drivers/linode.py | Removes API v3 DNS driver/connection/response implementation and selection logic. |
| libcloud/compute/drivers/linode.py | Removes API v3 compute driver implementation and selection logic. |
| libcloud/common/linode.py | Removes API v3 common connection/response/exception/constants; keeps only v4. |
Comments suppressed due to low confidence (2)
libcloud/compute/drivers/linode.py:82
- This change removes support for Linode API v3 (api_version="3.0" now raises NotImplementedError), which is a backward-incompatible behavior change for users who were still instantiating the v3 driver. Please add an entry to the user-facing changelog / upgrade notes (e.g., CHANGES.rst and/or docs/upgrade_notes.rst) calling out the removal and the required migration to API v4 so upgrades don’t fail unexpectedly at runtime.
def __new__(
cls,
key,
secret=None,
secure=True,
host=None,
port=None,
api_version=DEFAULT_API_VERSION,
region=None,
**kwargs,
):
if cls is LinodeNodeDriver:
if api_version == "4.0":
cls = LinodeNodeDriverV4
else:
raise NotImplementedError(
"No Linode driver found for API version: %s" % (api_version)
)
libcloud/common/linode.py:29
- This module previously exposed API v3 helpers (e.g., API_ROOT / LinodeConnection / LinodeResponse / LinodeException) which have now been removed. Since these were importable public symbols, please add a note in the changelog / upgrade notes about the removal so downstream users who imported them directly know what changed and how to migrate.
__all__ = [
"API_HOST",
"DEFAULT_API_VERSION",
"LinodeResponseV4",
"LinodeConnectionV4",
"LinodeExceptionV4",
"LinodeDisk",
"LinodeIPAddress",
]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
47cefca to
e9aba33
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2132 +/- ##
==========================================
- Coverage 83.36% 83.36% -0.00%
==========================================
Files 353 351 -2
Lines 81906 81196 -710
Branches 9007 8936 -71
==========================================
- Hits 68278 67686 -592
+ Misses 10799 10721 -78
+ Partials 2829 2789 -40
🚀 New features to boost your workflow:
|
PsiACE
left a comment
There was a problem hiding this comment.
Thank you for hard work. I think we can move forward with the merge.
|
After this PR is merged, we may need a new PR to provide an alias from |
Thank you @PsiACE! |
Remove Linode APIv3 support
Description
Linode API v3 has been fully retired, so relevant modules can be cleaned up.
Status
done, ready for review
Checklist (tick everything that applies)