Start splitting qt#1132
Merged
Merged
Conversation
* 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>
There was a problem hiding this comment.
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.Config→Nagstamon.config) - Modernized Python class definitions by removing explicit
objectinheritance - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.