wazuh / wazuh-indexer

Wazuh indexer, the Wazuh search engine
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
11 stars 19 forks source link

Avoid duplicated package generation based on commit #486

Open AlexRuiz7 opened 4 days ago

AlexRuiz7 commented 4 days ago

Description

[!NOTE] As the issue modifies the packages generation process, prefix your branch with ci/ to invoke and test the builder.

We have identified a situation in which the one of the functional requirements of the package builder is not met. In particular, the package builder must build the packages if and only if there is no package for a given distribution, architecture and commit in Wazuh's S3 packages storage.

This is only not checked on our build.yml workflow, but also we need to ensure that changes on any of the plugins effectively allows the generation of a new package, even if the commit in the wazuh-indexer repository is the same. In order to do that, we will suffix the package after the combination of the commit SHA of the 3 repositories together (wazuh-indexer, wazuh-indexer-plugins and wazuh-indexer-reporting).

Use case scenario (current)

State A

Inputs: deb, x64

Repository Commit SHA
wazuh-indexer 62e4d4bf072
wazuh-indexer-plugins 4c105dd
wazuh-indexer-reporting 3b03eb3

Output: wazuh-indexer_5.0.0-1_amd64_62e4d4bf072.deb

State A+1

Inputs: deb, x64

Repository Commit SHA
wazuh-indexer 62e4d4bf072
wazuh-indexer-plugins a7cf4b6
wazuh-indexer-reporting 3b03eb3

Output: wazuh-indexer_5.0.0-1_amd64_62e4d4bf072.deb

Conclusions

Although the wazuh-indexer-plugins repo has new code, the package is not built as there is a package in the S3 bucket suffixed with the same commit SHA.

Use case scenario (expected)

State A

Inputs: deb, x64

Repository Commit SHA
wazuh-indexer 62e4d4bf072
wazuh-indexer-plugins 4c105dd
wazuh-indexer-reporting 3b03eb3

Output: wazuh-indexer_5.0.0-1_amd64_<combined-hash-A>.deb

State A+1

Inputs: deb, x64

Repository Commit SHA
wazuh-indexer 62e4d4bf072
wazuh-indexer-plugins a7cf4b6
wazuh-indexer-reporting 3b03eb3

Output: wazuh-indexer_5.0.0-1_amd64_<combined-hash-B>.deb

QU3B1M commented 2 days ago

This issue will remain on hold until we decide which method will be used