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

The Wazuh dashboard build_number is updated with the Wazuh app parameters to 4.4 #2054

Conversation

c-bordon
Copy link
Member

Related issue
closes #2012

Description

A modification is made in the construction of the base so that the Wazuh dashboard package has the corresponding build_number included in its packages.json according to the Wazuh plugin that is installed in the package itself

Logs example

[root@centos7-1 ~]# cat /usr/share/wazuh-dashboard/package.json 
{
  "name": "opensearch-dashboards",
  "description": "OpenSearch Dashboards is a browser based analytics and search dashboard for OpenSearch. OpenSearch Dashboards is a snap to setup and start using. OpenSearch Dashboards strives to be easy to get started with, while also being flexible and powerful, just like OpenSearch.",
  "keywords": [
    "opensearch-dashboards",
    "opensearch",
    "logstash",
    "analytics",
    "visualizations",
    "dashboards",
    "dashboarding"
  ],
  "version": "2.4.1",
  "branch": "2.4",
  "build": {
    "number": 44001,
    "sha": "ea36827cdedf1e726e7cb8315ffc49f73f9b4eb7",
    "distributable": true,
    "release": true
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/opensearch-project/opensearch-dashboards.git"
  },
  "engines": {
    "node": "14.20.0"
  }
}

4.3.0:
image

4.4.0:
image

Tests

Centos 7: https://devel.ci.wazuh.info/view/Tests/job/Test_stack/412/console
Ubuntu Focal: https://devel.ci.wazuh.info/view/Tests/job/Test_stack/413/console

  • Build the package in any supported platform
    • Linux
    • Windows
    • macOS
    • Solaris
    • AIX
    • HP-UX
  • Package installation
  • Package upgrade
  • Package downgrade
  • Package remove
  • Package install/remove/install
  • Change added to CHANGELOG.md
  • Tests for Linux RPM
    • Build the package for x86_64
    • Build the package for i386
    • Build the package for armhf
    • Build the package for aarch64
    • %files section is correctly updated if necessary
  • Tests for Linux deb
    • Build the package for x86_64
    • Build the package for i386
    • Build the package for armhf
    • Build the package for aarch64
    • Package install/remove/install
    • Package install/purge/install
    • Check file permissions after installing the package
  • Tests for macOS
    • Test the package from macOS Sierra to Mojave
  • Tests for Solaris
    • Test the package on Solaris 10
    • Test the package on Solaris 11
    • Check file permissions on Solaris 11 template
  • Tests for IBM AIX
    • %files section is correctly updated if necessary
    • Check the changes from IBM AIX 5 to 7

Copy link
Member

@rauldpm rauldpm left a comment

Choose a reason for hiding this comment

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

We should specify some type of control over the URL that is specified, it may be the case that a URL like the following is specified:

https://packages-dev-fail.wazuh.com/pre-release/ui/dashboard/wazuh-1-1.zip

This URL will be accepted and will be used to download and install the Wazuh app during the construction of the package, which would end up failing, which could be avoided by checking the code that returns a curl beforehand.

If the URL is not valid, it should show a message and end the execution with an error status instead of using a default Wazuh URL.

@c-bordon
Copy link
Member Author

c-bordon commented Jan 20, 2023

We should specify some type of control over the URL that is specified, it may be the case that a URL like the following is specified:

https://packages-dev-fail.wazuh.com/pre-release/ui/dashboard/wazuh-1-1.zip

This URL will be accepted and will be used to download and install the Wazuh app during the construction of the package, which would end up failing, which could be avoided by checking the code that returns a curl beforehand.

If the URL is not valid, it should show a message and end the execution with an error status instead of using a default Wazuh URL.

The functionality is added in this commit: 69b748b

It was used to add a new parameter in the deb and rpm build_package.sh scripts to decide if you want to build a new base or use an existing one, this is quite useful to save time when you are developing locally

Tests:

./build_package.sh -s /tmp -b no --app-url "https://packages-dev.wazuh.com/trash/ui/dashboard/wazuh-4.4.0-1.1.1.todelete.zip"

image

./build_package.sh -s /tmp -b no --app-url "https://packages-dev.wazuh.com/trash/ui/dashboard/wazuh-4.4.0-.todelete.zip"

image

Copy link
Member

@rauldpm rauldpm left a comment

Choose a reason for hiding this comment

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

LGTM

stack/dashboard/deb/builder.sh Outdated Show resolved Hide resolved
stack/dashboard/rpm/builder.sh Outdated Show resolved Hide resolved
@c-bordon c-bordon requested a review from verdx January 20, 2023 15:17
Copy link
Contributor

@verdx verdx left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@fcaffieri fcaffieri left a comment

Choose a reason for hiding this comment

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

LGTM

@alberpilot alberpilot merged commit a70c398 into 4.4 Jan 23, 2023
@alberpilot alberpilot deleted the 2012-change-the-build-number-of-the-wazuh-dashboard-packagesjson-inbase-to4.4 branch January 23, 2023 09:06
jnasselle pushed a commit that referenced this pull request Apr 11, 2023
…ters to 4.4 (#2054)

* Added feature to obtain build_number from Wazuh plugin zip

* Removed full path for packages.json tmp file

* Added quotes to var

* Added validation for plugin URL

* Added indentation

Signed-off-by: jnasselle <jnasselle@gmail.com>
jnasselle pushed a commit that referenced this pull request Apr 11, 2023
…ters to 4.4 (#2054)

* Added feature to obtain build_number from Wazuh plugin zip

* Removed full path for packages.json tmp file

* Added quotes to var

* Added validation for plugin URL

* Added indentation

Signed-off-by: jnasselle <jnasselle@gmail.com>
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.

Change the build number of the Wazuh dashboard packages.json with the same as the Wazuh plugin
5 participants