Skip to content

Commit

Permalink
Shown Wazuh API version is wrong or empty after upgrade (#7203)
Browse files Browse the repository at this point in the history
* fix(get-updates): improve error handling by renaming variable for clarity and adjusting error response structure

* fix(plugin-services): update WazuhCheckUpdatesServices type to include Logger for improved service management

* fix(get-updates): use IAPIHost type for host management to enhance type safety and code clarity in update services

* fix(get-updates): add logger for improved debugging of API status errors in update retrieval process

* fix(get-updates): refactor update retrieval to include version handling and optimize status checking logic for better clarity

* fix(get-updates): update test cases to handle version formatting and improve mocking for Wazuh core interactions

* fix(get-updates): enhance tests by mocking last_available_patch for clearer version handling and improved stability

* fix(get-updates): reorganize imports in test file for better readability and consistency with common constants and types

* fix(get-updates): refactor test setup to improve mocking of saved objects and requests for more accurate updates handling

* fix(get-updates): standardize api_id and version formatting in tests for consistent updates handling across all scenarios

* fix(get-updates): improve error handling and add tests for undefined api_version scenarios in update fetching logic

* fix(get-updates): enhance error response handling and add test for dual request failure in update fetching logic

* fix(get-updates): remove unnecessary mock data from tests for clearer error handling in dual request failure scenarios

* fix(get-updates): add test for handling API errors on secondary request in update retrieval logic

* fix(get-updates): add test for retrieving updates when initial API version is undefined and secondary request fails

* fix(get-updates): refactor test cases to use 'it' for better consistency in update retrieval tests

* fix(get-updates): simplify test descriptions to improve readability in update retrieval tests

* fix(get-updates): enhance test descriptions for clarity in update availability cases and error handling scenarios

* fix(changelog): update entries for issue #7177 and add fix for incorrect Wazuh API version display after upgrade

* fix(changelog): correct rendering entry for vulnerability reference and clarify Wazuh API version display issue after upgrade

---------

Co-authored-by: Federico Rodriguez <[email protected]>
  • Loading branch information
guidomodarelli and asteriscos authored Dec 17, 2024
1 parent 07151ec commit acb171a
Show file tree
Hide file tree
Showing 5 changed files with 367 additions and 138 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed filter by value in document details in safari [#7151](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7151)
- Fixed error message to prevent pass no strings to the wazuh logger [#7167](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7167)
- Fixed the rendering of the `data.vunerability.reference` in the table and flyout [#7177](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7177)
- Fixed incorrect or empty Wazuh API version displayed after upgrade [#440](https://github.com/wazuh/wazuh-dashboard/issues/440)

### Removed

Expand Down
3 changes: 2 additions & 1 deletion plugins/wazuh-check-updates/server/plugin-services.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
CoreStart,
ISavedObjectsRepository,
Logger,
} from 'opensearch-dashboards/server';
import { createGetterSetter } from '../../../src/plugins/opensearch_dashboards_utils/common';
import { WazuhCorePluginStart } from '../../wazuh-core/server';
Expand All @@ -11,4 +12,4 @@ export const [getCore, setCore] = createGetterSetter<CoreStart>('Core');
export const [getWazuhCore, setWazuhCore] =
createGetterSetter<WazuhCorePluginStart>('WazuhCore');
export const [getWazuhCheckUpdatesServices, setWazuhCheckUpdatesServices] =
createGetterSetter<any>('WazuhCheckUpdatesServices');
createGetterSetter<{ logger: Logger }>('WazuhCheckUpdatesServices');
Loading

0 comments on commit acb171a

Please sign in to comment.