Skip to content

Start splitting qt#1132

Merged
HenriWahl merged 153 commits into
masterfrom
start_splitting_qt
Aug 21, 2025
Merged

Start splitting qt#1132
HenriWahl merged 153 commits into
masterfrom
start_splitting_qt

Conversation

@HenriWahl
Copy link
Copy Markdown
Owner

No description provided.

HenriWahl and others added 30 commits May 26, 2025 22:27
* Handle Zabbix API exceptions and improve error reporting.

Add explicit handling for ZabbixAPIException by re-raising it when necessary. Additionally, improve error handling throughout by capturing exceptions, processing them with the `error()` method, and returning a well-structured Result object to ensure robustness and better debugging.

* Add support for bearer token authentication in Zabbix server

This update introduces a check for the authentication type, adding support for bearer token authentication alongside basic authentication. An exception is raised for invalid authentication methods, ensuring better error handling and robustness.

* Ensure Zabbix API URL is correctly formatted.

Added a conditional check to append '/api_jsonrpc.php' to the server URL only if it's not already included. This ensures compatibility with servers using preformatted URLs and avoids redundant suffixes.

* Add bearer token authentication support to Zabbix API

Refactors `login`, `test_login`, and `logged_in` methods to handle bearer tokens as an alternative authentication method. This improves flexibility and extends the API to support token-based authentication in addition to traditional user/password schemes. Also includes minor fixes like correcting a typo in exceptions.

* Refactor Zabbix API request handling for better clarity

Enhanced error handling, modularized header preparation and URL opener creation, and improved method documentation. This ensures more robust and maintainable interactions with the Zabbix API.

* Add authentication property initialization in Zabbix server

This change introduces the initialization of the `authentication` property using the server configuration. It ensures the Zabbix server object has the necessary authentication data available for further operations.

* Add new event actions and error handling for Zabbix API

Expanded event actions to include suppression and rank changes. Introduced error handling for blocked or incorrect credentials in the `event.acknowledge` API call to improve robustness.

* Fix error handling in Zabbix server login and acknowledgment

Enhanced error handling during login by catching exceptions and logging errors. Prevent execution continuation if login fails and ensure proper response for authentication issues.

---------

Co-authored-by: Kimmig, Simon - D0242573 <simon.kimmig@dm.de>
* Handle Zabbix API exceptions and improve error reporting.

Add explicit handling for ZabbixAPIException by re-raising it when necessary. Additionally, improve error handling throughout by capturing exceptions, processing them with the `error()` method, and returning a well-structured Result object to ensure robustness and better debugging.

* Add support for bearer token authentication in Zabbix server

This update introduces a check for the authentication type, adding support for bearer token authentication alongside basic authentication. An exception is raised for invalid authentication methods, ensuring better error handling and robustness.

* Ensure Zabbix API URL is correctly formatted.

Added a conditional check to append '/api_jsonrpc.php' to the server URL only if it's not already included. This ensures compatibility with servers using preformatted URLs and avoids redundant suffixes.

* Add bearer token authentication support to Zabbix API

Refactors `login`, `test_login`, and `logged_in` methods to handle bearer tokens as an alternative authentication method. This improves flexibility and extends the API to support token-based authentication in addition to traditional user/password schemes. Also includes minor fixes like correcting a typo in exceptions.

* Refactor Zabbix API request handling for better clarity

Enhanced error handling, modularized header preparation and URL opener creation, and improved method documentation. This ensures more robust and maintainable interactions with the Zabbix API.

* Add authentication property initialization in Zabbix server

This change introduces the initialization of the `authentication` property using the server configuration. It ensures the Zabbix server object has the necessary authentication data available for further operations.

* Add new event actions and error handling for Zabbix API

Expanded event actions to include suppression and rank changes. Introduced error handling for blocked or incorrect credentials in the `event.acknowledge` API call to improve robustness.

* Fix error handling in Zabbix server login and acknowledgment

Enhanced error handling during login by catching exceptions and logging errors. Prevent execution continuation if login fails and ensure proper response for authentication issues.

* Add `auth` parameter to `user.checkAuthentication` requests

Ensure `auth` is explicitly set to `False` in `test_login` method to maintain consistent behavior and prevent unintended authentication attempts.

* Add `auth` parameter to `user.checkAuthentication` requests

Ensure `auth` is explicitly set to `False` in `test_login` method to maintain consistent behavior and prevent unintended authentication attempts.

* Update date format in `last_check` field in Zabbix server to ISO standard `%Y-%m-%d %H:%M:%S`
Fix for #1109

* Refactor status information creation in Zabbix server

Simplified the assembly of `status_information` using a list comprehension for improved readability and performance. Removed redundant code.

* Update `auth` parameter behavior for Zabbix API requests

Modify the inclusion of the `auth` parameter to ensure compatibility with Zabbix versions before 6.4, aligning the behavior with version-specific requirements.

---------

Co-authored-by: Kimmig, Simon - D0242573 <simon.kimmig@dm.de>
@HenriWahl HenriWahl requested a review from Copilot August 21, 2025 11:21
@HenriWahl HenriWahl self-assigned this Aug 21, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements "The Big Split" - a major refactoring effort to modularize the Nagstamon Qt UI code by splitting it into smaller, focused widgets. The change aims to improve code maintainability and organization.

Key changes include:

  • Refactored monolithic Qt UI modules into focused widget components (treeview, statusbar, toparea, etc.)
  • Updated import paths from uppercase module names to lowercase (e.g., Nagstamon.ConfigNagstamon.config)
  • Modernized Python class definitions by removing explicit object inheritance
  • Updated PyQt6 version requirements and dependency configurations

Reviewed Changes

Copilot reviewed 83 out of 85 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
setup.py Updated imports to lowercase modules, dynamic package discovery, modernized license format
nagstamon.py Updated imports and refactored to use new widget structure
build/requirements/*.txt Updated PyQt6 versions and dependency pins
build/redhat/nagstamon.spec Switched from PyQt6 to PyQt5 dependencies
build/docker/* Added new Dockerfile and updated existing ones with system fixes
build/debian/* Updated dependencies to support both Qt5/Qt6 with fallback options
build/build.py Updated imports to lowercase modules
TODO.md New file tracking refactoring progress
Nagstamon/thirdparty/*.py Modernized class definitions and removed legacy code
Nagstamon/qui/widgets/*.py New modular widget files implementing split UI components

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread TODO.md Outdated
@HenriWahl HenriWahl merged commit 4bdc666 into master Aug 21, 2025
17 checks passed
@HenriWahl HenriWahl deleted the start_splitting_qt branch August 21, 2025 11:31
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