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

Switch to official Zabbix Python API #131674

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

kruton
Copy link

@kruton kruton commented Nov 26, 2024

Breaking change

This change drops support for Zabbix 4 and before. Only Zabbix 5+ versions are supported.

Proposed change

Currently the Zabbix component is broken with Zabbix 5.4 or newer, because the API changed to require "username" instead of "user" to login at that point.

The Zabbix project released an official Python API library called "zabbix_utils" which can replace the current library that this component is using.

This just does a conversion to the existing synchronous API. The new Python library also supports an asynchronous API which could be used to further migrate this plugin.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @kruton

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft November 26, 2024 23:27
@kruton kruton marked this pull request as ready for review November 27, 2024 00:05
@kruton kruton force-pushed the zabbix-component branch 2 times, most recently from aba11eb to b2dbac8 Compare November 27, 2024 00:16
@dotvav
Copy link
Contributor

dotvav commented Nov 27, 2024

Starightforward 1-to-1 migration. LGTM 👍

homeassistant/components/zabbix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/zabbix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/zabbix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/zabbix/manifest.json Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft December 2, 2024 10:28
@kruton kruton marked this pull request as ready for review December 2, 2024 18:32
@home-assistant home-assistant bot requested a review from edenhaus December 2, 2024 18:32
@edenhaus
Copy link
Contributor

Sanity check of zabbix-utils==2.0.1 ✔️

Does the current integration support Zabbix < 5? If yes, we need to add a breaking change section to this PR

@edenhaus edenhaus self-assigned this Dec 12, 2024
@kruton
Copy link
Author

kruton commented Dec 12, 2024

Sanity check of zabbix-utils==2.0.1 ✔️

Does the current integration support Zabbix < 5? If yes, we need to add a breaking change section to this PR

Good call. According to an archived copy of their release policy, Zabbix 4.x stopped receiving full support in Oct. 2021 and limited support in Oct. 2023. I imagine that means the impact for this breaking change will be almost zero.

Is there any special format needed to indicate a breaking change in the description that gets rolled into release notes?

Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Please fix the CI

@home-assistant home-assistant bot marked this pull request as draft December 16, 2024 10:04
@edenhaus
Copy link
Contributor

Is there any special format needed to indicate a breaking change in the description that gets rolled into release notes?

Tagging it with breaking-change

@kruton
Copy link
Author

kruton commented Dec 16, 2024

Please fix the CI

Done.

@kruton kruton marked this pull request as ready for review December 16, 2024 21:35
@home-assistant home-assistant bot requested a review from edenhaus December 16, 2024 21:35
The Zabbix project released an official Python API library called
"zabbix_utils" which can replace the current library that this component
is using.

This just does a conversion to the existing synchronous API. The new
Python library also supports an asynchronous API which could be used to
further migrate this plugin.
@kruton
Copy link
Author

kruton commented Dec 19, 2024

Looks like there was an existing mypy error on another module. Merged in latest 'dev' to hopefully avoid that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants