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

Fix last_check_date mapping when check updates service is disabled #6171

Conversation

lucianogorza
Copy link
Contributor

@lucianogorza lucianogorza commented Nov 28, 2023

Description

This PR solves the error that produces the API endpoint manager/version/check response when the check updates service is disabled and the field last_check_date is an empty string.

Issues Resolved

#6168

Evidence

Service disabled

image

Up to date

image

Availabel updates

image

Test

  1. Go to the file docker/imposter/wazuh-config.yml
  2. Replace line 3 with: specFile: https://raw.githubusercontent.com/wazuh/wazuh/dev-14153-vulndet-refactor/api/api/spec/spec.yaml
  3. Go to the file docker/imposter/manager/version/check.json and replace content with:
{
  "data": {
    "last_check_date": "",
    "current_version": "4.8.0",
    "update_check": false,
    "last_available_major": {},
    "last_available_minor": {},
    "last_available_patch": {}
  },
  "error": 0
}
  1. Restart imposter

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.68% ( 171 / 223 )
Branches 57.57% ( 57 / 99 )
Functions 61.7% ( 29 / 47 )
Lines 76.68% ( 171 / 223 )

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 21.38% ( 185 / 865 )
Branches 18.07% ( 79 / 437 )
Functions 14.22% ( 36 / 253 )
Lines 21.61% ( 182 / 842 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.01% ( 4137 / 34438 )
Branches 8.16% ( 1890 / 23158 )
Functions 11.39% ( 934 / 8197 )
Lines 12.18% ( 4026 / 33032 )

@lucianogorza lucianogorza marked this pull request as ready for review November 28, 2023 18:24
@lucianogorza lucianogorza requested a review from a team as a code owner November 28, 2023 18:24
Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

image

Copy link
Member

@jbiset jbiset left a comment

Choose a reason for hiding this comment

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

CR: 🟢

Test 🟢

Evidence

image

@Machi3mfl Machi3mfl merged commit e21fb9c into 4.8.0 Nov 28, 2023
4 checks passed
@Machi3mfl Machi3mfl deleted the fix/6168/fix-last-check-date-mapping-when-check-updates-service-is-disabled branch November 28, 2023 20:04
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.

Fix last_check_date mapping when check updates service is disabled
4 participants