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

Add stage parameter in bump_version script #3121

Merged

Conversation

Enaraque
Copy link
Member

Related issue
#3120

Description

Due to the new change made in #3098, it was necessary to modify the bump_version.py script. A new stage parameter (-s) has been added, where, when used, the given stage will be appended to both source_branch variables in the unattended_installer/install_functions/installVariables.sh and unattended_installer/builder.sh files.

The purpose of this is that every time a support new stage is created and a tag is generated, these variables will retain the version value along with the stage (e.g., source_branch=v4.9.1-rc1).

Once the tag with the correct value is created, these variables should retain the value without the stage in the branch, only with the version (e.g., source_branch=v4.9.1).

Note

If the -s option is not used, no stage will be added, and if there was one previously, it will be removed.

To achieve this, the script will need to be run twice: once with the -s option to add the stage, and then again without the -s option to remove the stage after the tag is created.

Each time the file was executed, both the CHANGELOG and aix/SPECS/wazuh-agent-aix.spec files would add an entry mentioning the current version. To fix this and allow the script to be called multiple times without creating duplicate entries, two functions have been created to validate that an entry with the current version doesn't already exist.

Tests

Below is the process for adding a stage to the source_branch variables, as well as its removal, which simply involves running the script again without the -s option.

$ cat unattended_installer/builder.sh | grep source_branch=\"v4
source_branch="v4.9.1"

$ cat unattended_installer/install_functions/installVariables.sh | grep source_branch=
readonly source_branch="v${wazuh_version}"

$ python3 bump_version.py -v 4.10.0 -s rc3
Bumping version in aix/SPECS/wazuh-agent-aix.spec
Bumping version in solaris/solaris10/pkginfo
Bumping version in tests/unattended/unit/suites/test-certFunctions.sh
Bumping version in tests/unattended/unit/suites/test-indexer.sh
Bumping version in tests/unattended/unit/suites/test-passwordsFunctions.sh
Bumping version in tests/unattended/unit/suites/test-installCommon.sh
Bumping version in tests/unattended/unit/suites/test-manager.sh
Bumping version in tests/unattended/unit/suites/test-checks.sh
Bumping version in tests/unattended/unit/suites/test-dashboard.sh
Bumping version in tests/unattended/unit/suites/test-common.sh
Bumping version in tests/unattended/unit/suites/test-filebeat.sh
Bumping version in unattended_installer/install_functions/installVariables.sh
Bumping version in unattended_installer/builder.sh
Bumping version in CHANGELOG.md
Bumping version in VERSION

$ cat unattended_installer/builder.sh | grep source_branch=\"v4
source_branch="v4.10.0-rc3"

$ cat unattended_installer/install_functions/installVariables.sh | grep source_branch=
readonly source_branch="v${wazuh_version}-rc3"

$ python3 bump_version.py -v 4.10.0

Bumping version in aix/SPECS/wazuh-agent-aix.spec
Bumping version in solaris/solaris10/pkginfo
Bumping version in tests/unattended/unit/suites/test-certFunctions.sh
Bumping version in tests/unattended/unit/suites/test-indexer.sh
Bumping version in tests/unattended/unit/suites/test-passwordsFunctions.sh
Bumping version in tests/unattended/unit/suites/test-installCommon.sh
Bumping version in tests/unattended/unit/suites/test-manager.sh
Bumping version in tests/unattended/unit/suites/test-checks.sh
Bumping version in tests/unattended/unit/suites/test-dashboard.sh
Bumping version in tests/unattended/unit/suites/test-common.sh
Bumping version in tests/unattended/unit/suites/test-filebeat.sh
Bumping version in unattended_installer/install_functions/installVariables.sh
Bumping version in unattended_installer/builder.sh
Bumping version in CHANGELOG.md
Bumping version in VERSION

$ cat unattended_installer/builder.sh | grep source_branch=\"v4
source_branch="v4.10.0"

$ cat unattended_installer/install_functions/installVariables.sh | grep source_branch=
readonly source_branch="v${wazuh_version}"

@Enaraque Enaraque requested review from MarcelKemp and a team September 19, 2024 17:03
@Enaraque Enaraque self-assigned this Sep 19, 2024
@Enaraque Enaraque linked an issue Sep 19, 2024 that may be closed by this pull request
@MarcelKemp MarcelKemp merged commit 8206087 into 4.9.1 Sep 20, 2024
4 checks passed
@MarcelKemp MarcelKemp deleted the change/3120-add-the-installation-assistant-version-bump branch September 20, 2024 09:10
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.

Add the Installation assistant version bump
3 participants