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 error when using invalid group configuration #5423

Merged
merged 2 commits into from
May 9, 2023

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented May 5, 2023

Description

This PR aims to fix the behaviour when an invalid configuration is set on a group's agent.conf

Issues Resolved

#5133

Evidence

Before changes

Before.mp4

After changes

After.mp4

Test

Having an environment with a Wazuh API, navigate to groups and edit the agent.conf file of any group.

  • If an invalid xml is set, it must not be possible to click on save.

  • If a valid xml is set but with an invalid configuration, an error toast must be shown after clicking on save.

  • If valid configuration and xml are set, it must be possible to save without errors.

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

@Tostti Tostti linked an issue May 5, 2023 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

Code coverage (Jest) % values
Statements 9.45% ( 3502 / 37034 )
Branches 5% ( 1436 / 28710 )
Functions 8.13% ( 747 / 9178 )
Lines 9.53% ( 3382 / 35468 )

@Tostti Tostti self-assigned this May 5, 2023
@Tostti Tostti marked this pull request as ready for review May 8, 2023 13:50
@Tostti Tostti requested a review from a team as a code owner May 8, 2023 13:50
@chantal-kelm chantal-kelm self-requested a review May 8, 2023 14:02
@Machi3mfl Machi3mfl self-requested a review May 8, 2023 15:26
Copy link
Member

@Machi3mfl Machi3mfl 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

image

Copy link
Member

@chantal-kelm chantal-kelm 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: ✅

Grabacion.de.pantalla.2023-05-08.a.la.s.15.06.50.mov

@AlexRuiz7 AlexRuiz7 merged commit 56e156f into 4.5 May 9, 2023
5 checks passed
@AlexRuiz7 AlexRuiz7 deleted the fix/error-when-invalid-group-configuration branch May 9, 2023 09:14
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

The backport to 4.5-7.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.5-7.10 4.5-7.10
# Navigate to the new working tree
cd .worktrees/backport-4.5-7.10
# Create a new branch
git switch --create backport-5423-to-4.5-7.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 56e156fffc21e16685fbe1425e29ac4bc86ee0c7
# Push it to GitHub
git push --set-upstream origin backport-5423-to-4.5-7.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.5-7.10

Then, create a pull request where the base branch is 4.5-7.10 and the compare/head branch is backport-5423-to-4.5-7.10.

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

The backport to 4.5-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.5-7.16 4.5-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.5-7.16
# Create a new branch
git switch --create backport-5423-to-4.5-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 56e156fffc21e16685fbe1425e29ac4bc86ee0c7
# Push it to GitHub
git push --set-upstream origin backport-5423-to-4.5-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.5-7.16

Then, create a pull request where the base branch is 4.5-7.16 and the compare/head branch is backport-5423-to-4.5-7.16.

Tostti added a commit that referenced this pull request May 10, 2023
* Fix error type

* Update changelog

(cherry picked from commit 56e156f)
Tostti added a commit that referenced this pull request May 10, 2023
* Fix error type

* Update changelog

(cherry picked from commit 56e156f)
asteriscos pushed a commit that referenced this pull request May 10, 2023
…5425)

* Fix error when using invalid group configuration (#5423)

* Fix error type

* Update changelog

(cherry picked from commit 56e156f)

* Update CHANGELOG.md

* Update CHANGELOG.md
asteriscos pushed a commit that referenced this pull request May 10, 2023
…5426)

Fix error when using invalid group configuration (#5423)

* Fix error type

* Update changelog

(cherry picked from commit 56e156f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using invalid configuration for agent.conf
4 participants