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

Changes in ConfigurationParser module to parse yaml instead of toml #266

Merged

Conversation

Nicogp
Copy link
Member

@Nicogp Nicogp commented Nov 2, 2024

Related issue
#103

Description

This PR adds changes to the ConfigurationParser module so that it now parses yaml files instead of toml files.

  • Includes the renaming of the configuration file to wazuh-agent.yml
  • Includes test fixes for modules that use the configurationParser module.

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

@Nicogp Nicogp linked an issue Nov 2, 2024 that may be closed by this pull request
4 tasks
@Nicogp Nicogp force-pushed the enhancement/103-change-configurationparser-to-parse-yaml branch 5 times, most recently from 02b4e8a to add52fc Compare November 3, 2024 00:00
@Nicogp Nicogp marked this pull request as ready for review November 3, 2024 14:50
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -37,13 +37,13 @@ void Logcollector::SetupFileReader(const configuration::ConfigurationParser& con
long reloadInterval = config::DEFAULT_RELOAD_INTERVAL;

try {
fileWait = m_enabled = configurationParser.GetConfig<long>("logcollector", "file_wait");
fileWait = configurationParser.GetConfig<long>("logcollector", "file_wait");
Copy link
Member

@jr0me jr0me Nov 4, 2024

Choose a reason for hiding this comment

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

Nice catch @Nicogp

I'm negatively surprised that this wasn't catch by any warning or static analysis. I played around in godbolt ( https://godbolt.org/z/jb8564oz5 ) and found that there's one warning we should have seen:

[warning: Although the value stored to 'enabled' is used in the enclosing expression, the value is never actually read from 'enabled' [clang-analyzer-deadcode.DeadStores]](javascript:;)

Something to look into later on...

@Nicogp Nicogp force-pushed the enhancement/103-change-configurationparser-to-parse-yaml branch 2 times, most recently from 5e8089b to c5dc02a Compare November 4, 2024 17:28
@Nicogp Nicogp force-pushed the enhancement/103-change-configurationparser-to-parse-yaml branch from c5dc02a to 104e0b4 Compare November 4, 2024 19:17
@TomasTurina TomasTurina merged commit 2d9ef2d into master Nov 4, 2024
5 checks passed
@TomasTurina TomasTurina deleted the enhancement/103-change-configurationparser-to-parse-yaml branch November 4, 2024 19:33
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.

Change ConfigurationParser to parse YAML instead of TOML
4 participants