From 17844d057e9367efd22abe560da9d6d59c379b54 Mon Sep 17 00:00:00 2001 From: Fede Galland Date: Thu, 30 Oct 2025 12:47:28 -0300 Subject: [PATCH] Restructuring of the repository tooling (#625) * Move scripts and test-tools to tools/ * Update CHANGELOG.md --- CHANGELOG.md | 1 + build.gradle | 2 +- docs/dev/run-tests.md | 2 +- {scripts => tools}/opensearch_version.sh | 0 {scripts => tools}/pre-commit | 0 {scripts => tools}/product_version.sh | 0 {test-tools => tools/test-cluster}/.gitignore | 0 {test-tools => tools/test-cluster}/README.md | 4 ++-- {test-tools => tools/test-cluster}/Vagrantfile | 0 {test-tools => tools/test-cluster}/config.yml | 0 {test-tools => tools/test-cluster}/pre-start.sh | 0 {test-tools => tools/test-cluster}/scripts/00_run.sh | 0 .../test-cluster}/scripts/01_download_and_install_package.sh | 0 .../test-cluster}/scripts/02_apply_certificates.sh | 0 .../test-cluster}/scripts/03_manage_indexer_service.sh | 0 .../test-cluster}/scripts/04_initialize_cluster.sh | 0 .../test-cluster}/scripts/05_validate_installed_plugins.sh | 0 .../test-cluster}/scripts/06_validate_setup.sh | 0 .../test-cluster}/scripts/07_validate_command_manager.sh | 0 .../test-cluster}/scripts/08_uninstall_indexer.sh | 0 {test-tools => tools/test-cluster}/scripts/README.md | 2 +- 21 files changed, 6 insertions(+), 5 deletions(-) rename {scripts => tools}/opensearch_version.sh (100%) rename {scripts => tools}/pre-commit (100%) rename {scripts => tools}/product_version.sh (100%) rename {test-tools => tools/test-cluster}/.gitignore (100%) rename {test-tools => tools/test-cluster}/README.md (94%) rename {test-tools => tools/test-cluster}/Vagrantfile (100%) rename {test-tools => tools/test-cluster}/config.yml (100%) rename {test-tools => tools/test-cluster}/pre-start.sh (100%) rename {test-tools => tools/test-cluster}/scripts/00_run.sh (100%) rename {test-tools => tools/test-cluster}/scripts/01_download_and_install_package.sh (100%) rename {test-tools => tools/test-cluster}/scripts/02_apply_certificates.sh (100%) rename {test-tools => tools/test-cluster}/scripts/03_manage_indexer_service.sh (100%) rename {test-tools => tools/test-cluster}/scripts/04_initialize_cluster.sh (100%) rename {test-tools => tools/test-cluster}/scripts/05_validate_installed_plugins.sh (100%) rename {test-tools => tools/test-cluster}/scripts/06_validate_setup.sh (100%) rename {test-tools => tools/test-cluster}/scripts/07_validate_command_manager.sh (100%) rename {test-tools => tools/test-cluster}/scripts/08_uninstall_indexer.sh (100%) rename {test-tools => tools/test-cluster}/scripts/README.md (94%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c99fee3b..bfdbbd45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Replace genai.* nested fields with keyword array [(#608)](https://github.com/wazuh/wazuh-indexer-plugins/pull/608) - Check GitHub actions with dependabot [(#601)](https://github.com/wazuh/wazuh-indexer-plugins/pull/601) - Automatically regenerate dependant stateless modules on base module change [(#618)](https://github.com/wazuh/wazuh-indexer-plugins/pull/618) +- Restructuring of the repository tooling [(#625)](https://github.com/wazuh/wazuh-indexer-plugins/pull/625) ### Deprecated - diff --git a/build.gradle b/build.gradle index f93bba15..949fda39 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'java' apply from: 'gradle/formatting.gradle' task installLocalGitHook(type: Copy){ - from new File(rootProject.rootDir, 'scripts/pre-commit') + from new File(rootProject.rootDir, 'tools/pre-commit') into { new File(rootProject.rootDir, '.git/hooks')} fileMode 0775 } diff --git a/docs/dev/run-tests.md b/docs/dev/run-tests.md index 4d88d694..06211aea 100644 --- a/docs/dev/run-tests.md +++ b/docs/dev/run-tests.md @@ -18,4 +18,4 @@ To run integration tests, use the `./gradlew integTest` and the `./gradlew yamlr For package testing, we conduct smoke tests on the packages using the [GitHub Actions Workflows](https://github.com/wazuh/wazuh-indexer/blob/main/.github/workflows/5_builderpackage_indexer.yml). These tests consist on installing the packages on a supported operating system. DEB packages are installed in the “Ubuntu 24.04” runner executing the workflow, while RPM packages are installed in a Red Hat 9 Docker container, as there is no RPM compatible runner available in GitHub Actions. -As a last note, there is also a **Vagrantfile** and **testing scripts** in the [repository](https://github.com/wazuh/wazuh-indexer-plugins/tree/main/test-tools) to perform some tests on a real wazuh-indexer service running on a virtual machine. Refer to its README.md for more information about how to run these tests. +As a last note, there is also a **Vagrantfile** and **testing scripts** in the [repository](https://github.com/wazuh/wazuh-indexer-plugins/tree/main/tools/test-cluster) to perform some tests on a real wazuh-indexer service running on a virtual machine. Refer to its README.md for more information about how to run these tests. diff --git a/scripts/opensearch_version.sh b/tools/opensearch_version.sh similarity index 100% rename from scripts/opensearch_version.sh rename to tools/opensearch_version.sh diff --git a/scripts/pre-commit b/tools/pre-commit similarity index 100% rename from scripts/pre-commit rename to tools/pre-commit diff --git a/scripts/product_version.sh b/tools/product_version.sh similarity index 100% rename from scripts/product_version.sh rename to tools/product_version.sh diff --git a/test-tools/.gitignore b/tools/test-cluster/.gitignore similarity index 100% rename from test-tools/.gitignore rename to tools/test-cluster/.gitignore diff --git a/test-tools/README.md b/tools/test-cluster/README.md similarity index 94% rename from test-tools/README.md rename to tools/test-cluster/README.md index cb9af1e4..89ecbf8e 100644 --- a/test-tools/README.md +++ b/tools/test-cluster/README.md @@ -4,7 +4,7 @@ This is an environment definition with the required configuration to be prepared cluster with two nodes using Vagrant and Libvirt to provision the Virtual Machines. It also generates the node's required certificates using the `wazuh-certs-tool` and copy them to each node's `/home` -directory, leaving a copy in `test-tools/`. +directory, leaving a copy in `test-cluster/`. ### Prerequisites @@ -16,7 +16,7 @@ directory, leaving a copy in `test-tools/`. 1. Navigate to the environment's root directory ```bash - cd test-tools + cd tools/test-cluster ``` 2. Initialize the environment ```bash diff --git a/test-tools/Vagrantfile b/tools/test-cluster/Vagrantfile similarity index 100% rename from test-tools/Vagrantfile rename to tools/test-cluster/Vagrantfile diff --git a/test-tools/config.yml b/tools/test-cluster/config.yml similarity index 100% rename from test-tools/config.yml rename to tools/test-cluster/config.yml diff --git a/test-tools/pre-start.sh b/tools/test-cluster/pre-start.sh similarity index 100% rename from test-tools/pre-start.sh rename to tools/test-cluster/pre-start.sh diff --git a/test-tools/scripts/00_run.sh b/tools/test-cluster/scripts/00_run.sh similarity index 100% rename from test-tools/scripts/00_run.sh rename to tools/test-cluster/scripts/00_run.sh diff --git a/test-tools/scripts/01_download_and_install_package.sh b/tools/test-cluster/scripts/01_download_and_install_package.sh similarity index 100% rename from test-tools/scripts/01_download_and_install_package.sh rename to tools/test-cluster/scripts/01_download_and_install_package.sh diff --git a/test-tools/scripts/02_apply_certificates.sh b/tools/test-cluster/scripts/02_apply_certificates.sh similarity index 100% rename from test-tools/scripts/02_apply_certificates.sh rename to tools/test-cluster/scripts/02_apply_certificates.sh diff --git a/test-tools/scripts/03_manage_indexer_service.sh b/tools/test-cluster/scripts/03_manage_indexer_service.sh similarity index 100% rename from test-tools/scripts/03_manage_indexer_service.sh rename to tools/test-cluster/scripts/03_manage_indexer_service.sh diff --git a/test-tools/scripts/04_initialize_cluster.sh b/tools/test-cluster/scripts/04_initialize_cluster.sh similarity index 100% rename from test-tools/scripts/04_initialize_cluster.sh rename to tools/test-cluster/scripts/04_initialize_cluster.sh diff --git a/test-tools/scripts/05_validate_installed_plugins.sh b/tools/test-cluster/scripts/05_validate_installed_plugins.sh similarity index 100% rename from test-tools/scripts/05_validate_installed_plugins.sh rename to tools/test-cluster/scripts/05_validate_installed_plugins.sh diff --git a/test-tools/scripts/06_validate_setup.sh b/tools/test-cluster/scripts/06_validate_setup.sh similarity index 100% rename from test-tools/scripts/06_validate_setup.sh rename to tools/test-cluster/scripts/06_validate_setup.sh diff --git a/test-tools/scripts/07_validate_command_manager.sh b/tools/test-cluster/scripts/07_validate_command_manager.sh similarity index 100% rename from test-tools/scripts/07_validate_command_manager.sh rename to tools/test-cluster/scripts/07_validate_command_manager.sh diff --git a/test-tools/scripts/08_uninstall_indexer.sh b/tools/test-cluster/scripts/08_uninstall_indexer.sh similarity index 100% rename from test-tools/scripts/08_uninstall_indexer.sh rename to tools/test-cluster/scripts/08_uninstall_indexer.sh diff --git a/test-tools/scripts/README.md b/tools/test-cluster/scripts/README.md similarity index 94% rename from test-tools/scripts/README.md rename to tools/test-cluster/scripts/README.md index 06d84a44..d9279eb2 100644 --- a/test-tools/scripts/README.md +++ b/tools/test-cluster/scripts/README.md @@ -3,7 +3,7 @@ This is a collection of scripts aimed to facilitate the validation of the wazuh-indexer packages generated on the GitHub Action Workflow. Even if these scripts can be executed in almost any Linux environment, we expect it to be used alongside the -Vagrant environment defined in the `test-tools`, using the scripts inside the VMs to facilitate the validation steps. +Vagrant environment defined in the `tools/test-cluster`, using the scripts inside the VMs to facilitate the validation steps. ### GitHub token requirements