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

Fix and improve bump proccedure in wazuh-packages repository #2243

Closed
DFolchA opened this issue Jun 26, 2023 · 7 comments · Fixed by #2270
Closed

Fix and improve bump proccedure in wazuh-packages repository #2243

DFolchA opened this issue Jun 26, 2023 · 7 comments · Fixed by #2270
Assignees
Labels

Comments

@DFolchA
Copy link
Contributor

DFolchA commented Jun 26, 2023

Wazuh version Install type Action performed Platform
X.Y.Z-rev Manager/API/Agent Install/Upgrade/Remove OS version

The current automatic bump procedure in Jenkins has some issues with the current structure of the SPECS directories and with the unattended installer, we need to fix it and improve it if possible.

Proposed solution

  1. Create a bash or python script that performs the bump to substitute the current proccedure
  2. Use GH actions or Jenkins to launch the script when necessary.
@DFolchA
Copy link
Contributor Author

DFolchA commented Jul 14, 2023

Update

Created script that modifies the necessary files in the repository to bump to a new version:
https://github.com/wazuh/wazuh-packages/blob/54368061338e4ce714827d6da74ce3cf9ce791f8/.github/workflows/bump-version.yml

dfolcha@pop-os:~/wazuh-packages$ python3 bump_version.py -h
usage: bump_version.py [-h] -v VERSION [-r REVISION] [-d DATE]

options:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION
                        Version to bump to
  -r REVISION, --revision REVISION
                        Revision to bump to. Default: 1
  -d DATE, --date DATE  Date to bump to. Format: m-d-Y. Default: today
dfolcha@pop-os:~/wazuh-packages$ python3 bump_version.py -v 4.30.0 -r 2 -d 08-15-2023
Bumping version in rpms/SPECS/wazuh-manager.spec
Bumping version in rpms/SPECS/wazuh-agent.spec
Bumping version in aix/SPECS/wazuh-agent-aix.spec
Bumping version in stack/dashboard/rpm/wazuh-dashboard.spec
Bumping version in stack/indexer/rpm/wazuh-indexer.spec
Bumping version in stack/dashboard/deb/debian/changelog
Bumping version in stack/indexer/deb/debian/changelog
Bumping version in debs/SPECS/wazuh-manager/debian/changelog
Bumping version in debs/SPECS/wazuh-agent/debian/changelog
Bumping version in stack/dashboard/deb/debian/copyright
Bumping version in stack/indexer/deb/debian/copyright
Bumping version in debs/SPECS/wazuh-manager/debian/copyright
Bumping version in debs/SPECS/wazuh-agent/debian/copyright
Bumping version in solaris/solaris10/pkginfo
Bumping version in macos/specs/wazuh-agent.pkgproj
Bumping version in tests/unattended/unit/suites/test-common.sh
Bumping version in tests/unattended/unit/suites/test-dashboard.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-filebeat.sh
Bumping version in tests/unattended/unit/suites/test-certFunctions.sh
Bumping version in tests/unattended/unit/suites/test-passwordsFunctions.sh
Bumping version in tests/unattended/unit/suites/test-indexer.sh
Bumping version in tests/unattended/unit/suites/test-checks.sh
Bumping version in unattended_installer/install_functions/installVariables.sh
Bumping version in CHANGELOG.md

Additionally, we have created a GitHub Action that can be used to automatically launch the script and open a PR with the changes.

https://github.com/wazuh/wazuh-packages/blob/54368061338e4ce714827d6da74ce3cf9ce791f8/.github/workflows/bump-version.yml

To execute the action go to the actions tab and look for the workflow named Bump version - wazuh-packages,
https://github.com/wazuh/wazuh-packages/actions/workflows/bump-version.yml

Then click on Run Workflow and introduce the desired parameters:
image

Here we can see a test execution of the workflow:
https://github.com/wazuh/wazuh-packages/actions/runs/5555556933/jobs/10146881908

And the resulting pull request:
#2278

To Do

Add keys to sign the commits done in the GH action

@DFolchA
Copy link
Contributor Author

DFolchA commented Jul 24, 2023

Update

Added GPG keys to sign commits with the GitHub action and added the necessary steps to the workflow.

We have encountered an issue where GnuPG returns the following error when signing the commit:

[GNUPG:] KEY_CONSIDERED 5B4D6AD25A24FE89F66A40D33785A9414A499558 2
[GNUPG:] BEGIN_SIGNING H10
[GNUPG:] PINENTRY_LAUNCHED 1843 curses 1.1.1 not a tty - - ? 1001/123 -
gpg: signing failed: No such file or directory
[GNUPG:] FAILURE sign 83918929
gpg: signing failed: No such file or directory

We are currently investigating the error.

@vikman90
Copy link
Member

Removing ETA as we're prioritizing other issues.

@vikman90 vikman90 added the type/bug Bug issue label Aug 4, 2023
@DFolchA
Copy link
Contributor Author

DFolchA commented Aug 8, 2023

Update

Located the cause of the signing problem, it seems that the GH actions machine does not have tty causing the signing process to fail.

@DFolchA
Copy link
Contributor Author

DFolchA commented Aug 8, 2023

Removing ETA as we're prioritizing other issues.

@DFolchA
Copy link
Contributor Author

DFolchA commented Aug 30, 2023

Update

After reviewing some related issue from different repositories:
goreleaser/goreleaser-action#201
robvanderleek/create-issue-branch#338
actions/runner#667
hashicorp/terraform-website#1549
actions/runner#241 (comment)

We have found that the cause of the error in signing the commits seems to be related to the GPG version used to generate the GPG key.

As a possible solution, different sources recommend generating a key without a password or generating a key using GPG1.

@havidarou
Copy link
Member

To be done as part of: wazuh/wazuh-qa#4820

@havidarou havidarou closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants