-
Notifications
You must be signed in to change notification settings - Fork 69
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
Actions and workflows according to convention #545
base: main
Are you sure you want to change the base?
Actions and workflows according to convention #545
Conversation
This reverts commit 7555b88.
Changes workflow references to use specific manual build configurations for main plugins, security plugin, and reporting plugin. Ensures consistency in build processes across different plugins.
Adds comments to explain various steps in the Wazuh dashboard build workflow. Includes details on customization options, setup, validation, and build processes. Improves maintainability and clarity of the workflow configuration.
Eliminates the 30-minute timeout settings from various GitHub workflow jobs to allow for longer execution times and prevent premature job termination.
Enhances documentation for build automation workflows: - Adds detailed description for the Wazuh dashboard build process - Refines formatting and readability of dashboard with plugins workflow
Improves documentation within the CodeQL workflow configuration file to provide clearer instructions and highlight important notes for customization and language detection.
Analysis of each workflow if it's convenient to use matrices
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: For the wazuh
repository, they do not use wazuh
in the workflow filename: https://github.com/wazuh/wazuh/pull/28233/files, so we could only keep the stack component instead (dashboard
).
suggestion: We could reference to dashboard_core
in this workflow.
@@ -1,6 +1,14 @@ | |||
# This is a basic workflow that is manually triggered | |||
# | |||
# This workflow automates the build of Wazuh Dashboard for different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# This workflow automates the build of Wazuh Dashboard for different | |
# This workflow automates the build of Wazuh dashboard core for different |
# - Clones, configures, builds and packages the Wazuh Dashboard. | ||
# - Is customizable in architecture and reference (`branch/tag/commit`). | ||
# - Uploads the final package with a structured name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# - Clones, configures, builds and packages the Wazuh Dashboard. | |
# - Is customizable in architecture and reference (`branch/tag/commit`). | |
# - Uploads the final package with a structured name. | |
# - Clone, configure, build and package the Wazuh dashboard core. | |
# - Customizable in architecture and reference (`branch/tag/commit`). | |
# - Upload the final package with a structured name. |
# - Downloads, builds, packages, tests, and uploads the Wazuh Dashboard along | ||
# with its plugins. | ||
# - Is customizable through inputs to adapt to different environments | ||
# (production, staging, various architectures). | ||
# - Ensures that each component is built with the exact reference provided and | ||
# validated before the final packaging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# - Downloads, builds, packages, tests, and uploads the Wazuh Dashboard along | |
# with its plugins. | |
# - Is customizable through inputs to adapt to different environments | |
# (production, staging, various architectures). | |
# - Ensures that each component is built with the exact reference provided and | |
# validated before the final packaging. | |
# - Download, build, package, test, and upload the Wazuh dashboard along | |
# with its plugins. | |
# - Customizable through inputs to adapt to different environments | |
# (production, staging, various architectures). | |
# - Ensure that each component is built with the exact reference provided and | |
# validated before the final packaging. |
with: | ||
reference: ${{ inputs.reference_wazuh_plugins }} | ||
|
||
build-security-plugin: | ||
needs: [validate-job] | ||
name: Build security plugin | ||
uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/manual-build.yml@main | ||
uses: wazuh/wazuh-security-dashboards-plugin/.github/workflows/5_builderpackage_manual-build.yml@main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: rename the "target" (manual-build) in the workflow naming convention to something like plugins
instead.
with: | ||
reference: ${{ inputs.reference_security_plugins }} | ||
|
||
build-report-plugin: | ||
needs: [validate-job] | ||
name: Build reporting plugin | ||
uses: wazuh/wazuh-dashboards-reporting/.github/workflows/manual-build.yml@main | ||
uses: wazuh/wazuh-dashboards-reporting/.github/workflows/5_builderpackage_manual-build.yml@main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: rename the "target" (manual-build) in the workflow naming convention to something like plugins
instead.
# 1. Downloads previously built artifacts. | ||
# 2. Packages the plugins and dashboard into `.zip` files. | ||
# 3. Executes the build script to generate the final package (`.deb` or `.rpm`). | ||
# 4. Performs tests on the generated package. | ||
# 5. Renames the package with the appropriate final name. | ||
# 6. If requested, generates the `.sha512` checksum file. | ||
# 7. Finally, uploads the resulting package as an artifact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 1. Downloads previously built artifacts. | |
# 2. Packages the plugins and dashboard into `.zip` files. | |
# 3. Executes the build script to generate the final package (`.deb` or `.rpm`). | |
# 4. Performs tests on the generated package. | |
# 5. Renames the package with the appropriate final name. | |
# 6. If requested, generates the `.sha512` checksum file. | |
# 7. Finally, uploads the resulting package as an artifact. | |
# 1. Download previously built artifacts. | |
# 2. Package the plugins and dashboard into `.zip` files. | |
# 3. Execute the build script to generate the final package (`.deb` or `.rpm`). | |
# 4. Perform tests on the generated package. | |
# 5. Rename the package with the appropriate final name. | |
# 6. If requested, generate the `.sha512` checksum file. | |
# 7. Finally, upload the resulting package as an artifact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: For the wazuh repository, they do not use wazuh in the workflow filename: https://github.com/wazuh/wazuh/pull/28233/files, so we could only keep the stack component instead (dashboard). If you rename the 5_builderpackage_wazuh_dashboard.yml
to 5_builderpackage_wazuh_dashboard_core.yml
, maybe you could rename this to 5_builderpackage_wazuh_dashboard.yml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: codequality
in the filename is not listed in the examples. I am not sure if we should use another that could be similar instead.
Description
We need to define and implement GitHub Actions and Workflows following the established naming and usage conventions. This includes setting up Actions for various use cases and designing corresponding Workflows to ensure consistency and efficiency in our CI/CD processes.
Issues Resolved
MVP catch up - testing · Issue #7292 · wazuh/wazuh-dashboard-plugins
Changelog
Convention
Actions
Naming convention
Actions use the following naming convention:
Use cases
Actions are meant to cover the following cases:
Action name prefix:
codeanalysis
Available targets: code analysis tool.
Name example:
4_codeanalysis_coverity
Action name prefix:
codelinter
Available targets: linter.
Name example:
5_codelinter_clangformat
Action name prefix:
testunit
Available targets: module
Name example:
5_testunit_engine
Action name prefix:
testcomponent
Available targets: component/module
Name example:
5_testcomponent_indexerconnector
Action name prefix:
testintegration
Available targets: module
Name example:
4_testintegration_cluster
Action name prefix:
builderpackage
Available targets: subsystem
Name example:
4_builderpackage_server
Action name prefix:
builderprecompiled
Available targets: subsystem
Name example:
5_builderprecompiled_agent
Jobs
Workflows
Pull Request
PR workflows are run against protected branches. They should not last longer than 30m.
PR workflows are meant to cover the following use cases:
Workflow name prefix: codequality
Available targets: repository
Name example: 4_codequality
Trigger: Any change.
Workflow name prefix: testunit
Available targets: component/module
Name example: 5_testunit_engine
Trigger: Any change within the target component/module.
Workflow name prefix: testcomponent
Available targets: component/module
Name example: 5_testcomponent_comms-api
Trigger: Any change within the target module.
Workflow name prefix: testintegration
Available targets: module
Name example: 5_testintegration_management-api
Trigger: Any change within the target module.
Workflow name prefix: builderpackage
Available targets: subsystem
Name example: 5_builderpackage_agent
Trigger: Any code change.
Manual (workflow dispatch)
Workflow name prefix: builderprecompiled
Available targets: subsystem
Name example: 5_builderprecompiled_dashboard
Trigger: Any change requiring new precompilation (mostly related to dependencies changes).
Evidence
For each Wazuh Dashboard repository:
Analysis of each workflow if it's convenient to use matrices
Test
<major>_<prefix>_<target>
).Check List
yarn test:jest
yarn test:jest_integration