wazuh / wazuh-qa

Wazuh - Quality Assurance
GNU General Public License v2.0
64 stars 30 forks source link

Operational tasks automation #5638

Open juliamagan opened 1 month ago

juliamagan commented 1 month ago

Description

As part of https://github.com/wazuh/wazuh-qa/issues/4820, all operational tasks need to be automated using JobFlow within a Jenkins pipeline. The pipeline should handle various automated tasks, including supporting new stages and branches, managing the release protocol, etc. These pipelines will automatically create issue structures and update projects to carry on those tasks.

Plan

juliamagan commented 1 month ago

All scripts currently used in release and branch maintenance can be found in their latest version at https://github.com/wazuh/wazuh-tools/tree/github-syncup-release-and-branches. A refactor of these scripts will be made as part of the migration to the new repository.

rafabailon commented 3 weeks ago

Update

The scripts to be refactored and automated are located at utils/github-project-sync.

Changes need to be pushed to wazuh-qa-automation A branch needs to be created for this issue (depending on main). For each script (or group of scripts) a new branch needs to be created that depends on the previously created branch. This way it is possible to work in parallel.

There are several Python scripts (also Dockerfile, Templates, etc.). These scripts seem like they could be grouped together.

.
└── utils/github-project-sync/
    ├── ETA_reader.py
    ├── add_issues.py
    ├── branch_maintenance.py
    ├── create_branch.py
    ├── delete_branch.py
    ├── field_copy.py
    ├── global_integrity.py
    ├── objective_changer.py
    ├── project_filters.py
    ├── release_changer.py
    ├── release_protocol.py
    ├── release_testing.py
    ├── stage_archiver.py
    ├── stage_changer.py
    ├── support_stage.py
    ├── support_version.py
    ├── sync_project.py
    ├── sync_project_copy.py
    ├── team.py
    └── test.py

When refactoring code, you should include an option to run the code without making changes so that you can test the script.

For the organization of the scripts, after reviewing them a little, I think that some of them could be grouped (or, at least, worked with at the same time). As you can see below, I have grouped several scripts according to their use.

ETA_reader.py
add_issues.py
branch_maintenance.py
manage_branch
├── create_branch.py
└── delete_branch.py
field_copy.py
global_integrity.py
objective_changer.py
project_filters.py
manage_release
├── release_changer.py
├── release_protocol.py
└── release_testing.py
manage_stage
├── stage_archiver.py
└── stage_changer.py
support
├── support_stage.py
└── support_version.py
sync_project.py
sync_project_copy.py
team.py
test.py
rafabailon commented 3 weeks ago

Update

I have created the branch enhancement/5638-operational-tasks-automation at wazuh-qa-automation This will be the main branch. The work branches that are created to refactor the scripts will depend on that branch.

After reviewing the scripts and libraries, I think it is best to start by cleaning up the libraries and merging them into the main branch. This way, it will be possible to test the scripts.