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

Migrate versioning to JSON format and update build scripts #529

Merged
merged 24 commits into from
Feb 19, 2025

Conversation

guidomodarelli
Copy link

@guidomodarelli guidomodarelli commented Feb 14, 2025

Description

As part of the standardization process, all XDR-SIEM repositories will use a consistent identification method. Each repository will include a standardized VERSION.json file containing necessary data to identify the origin branch and release stage. This file should be included in the installer's installation directory and indicate the short commit used to create it.

Requirements

GitHub
  1. Each repository must include a VERSION.json file in the root directory.
  2. The file must be named VERSION.json.
  3. It should follow the specified JSON format (with required keys).
  4. The version key value must follow the MAJOR.MINOR.PATCH format.
  5. The stage key value must indicate the release stage, using lowercase and no spaces.
  6. Numeric revisions (e.g., 41200) should be replaced by the stage value from the version file.
  7. References to the version and stage (revision) should be fetched from this JSON file.

[NOTE]
References such as Jenkinsfile shared libraries or uses: repo/workflow@main are exempted from this change (7).
However, procedures like package generation should be adapted accordingly.

Installers
  1. Installers should install the VERSION.json file in the installation directory:
    1. Wazuh manager and Wazuh agent: /var/ossec (or equivalent)
    2. Wazuh dashboard and Wazuh indexer: /usr/share/wazuh-{dashboard/indexer}
  2. The version and stage (revision) should be fetched from the VERSION.json file.
  3. The VERSION.json provided in the installer package should include the short commit used to create the it. If the repository requires a compound commit due to dependencies, use it instead of a short commit.
  4. Installer nomenclature and metadata must remain unchanged.
  5. File Permissions and Ownership for VERSION.json:
    1. Ownership: Subsystem user and group
    2. Permissions: 440
Documentation
  1. Documentation must be modified to reflect the changes.

Resources

VERSION.json file content and structure
  • GitHub repository
{
    "version": "4.12.0",
    "stage": "alpha0"
}
  • Installers
{
    "version": "4.12.0",
    "stage": "alpha0",
    "commit": "short_commit_value"
}

Issues Resolved

#526

Changelog

  • feat: migrate versioning to JSON format and update build scripts

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@guidomodarelli guidomodarelli changed the title feat: migrate versioning to JSON format and update build scripts Migrate versioning to JSON format and update build scripts Feb 17, 2025
@yenienserrano yenienserrano linked an issue Feb 17, 2025 that may be closed by this pull request
4 tasks
@guidomodarelli guidomodarelli force-pushed the enhancement/526-version-file-standardization branch from efbc2ba to ade9553 Compare February 18, 2025 15:14
@guidomodarelli guidomodarelli self-assigned this Feb 19, 2025
Copy link
Member

@Tostti Tostti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test

imagen

deb amd64

root@vagrant:/home/vagrant# cat /usr/share/wazuh-dashboard/VERSION.json 
{
  "version": "4.12.0",
  "stage": "alpha1",
  "commit": "49776f5-db2484a6d-ac5e4ed"
}

rpm x86_64

[root@vbox vagrant]# cat /usr/share/wazuh-dashboard/VERSION.json 
{
  "version": "4.12.0",
  "stage": "alpha1",
  "commit": "49776f5-db2484a6d-ac5e4ed"
}

CR 🟢

LGTM

Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test: 🟢

Centos:

image

Ubuntu

image

@Tostti Tostti merged commit 3600d69 into 4.12.0 Feb 19, 2025
95 of 96 checks passed
@Tostti Tostti deleted the enhancement/526-version-file-standardization branch February 19, 2025 16:20
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.

Version file standardization
3 participants