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

Define GitHub Actions and Workflows according to the convention #608

Open
4 tasks
vikman90 opened this issue Feb 14, 2025 · 3 comments · May be fixed by #621
Open
4 tasks

Define GitHub Actions and Workflows according to the convention #608

vikman90 opened this issue Feb 14, 2025 · 3 comments · May be fixed by #621
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@vikman90
Copy link
Member

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.

Convention

Actions

Naming convention

  • Major: Product major version.
  • Prefix: Prefixes depicted in the use cases section.
  • Target: The Action target. It can be a component, module, subsystem, programming language, code analysis tool, etc.

Actions use the following naming convention:

<major>_<prefix>_<target>

Use cases

Actions are meant to cover the following cases:

  • Code analysis. Every tool used to do code analysis (either static or dynamic).
    Action name prefix: codeanalysis
    Available targets: code analysis tool.
    Name example: 4_codeanalysis_coverity
  • Linter. Programming language linter or automatic documentation generation.
    Action name prefix: codelinter
    Available targets: linter.
    Name example: 5_codelinter_clangformat
  • Unit tests.
    Action name prefix: testunit
    Available targets: module
    Name example: 5_testunit_engine
  • Component tests.
    Action name prefix: testcomponent
    Available targets: component/module
    Name example: 5_testcomponent_indexerconnector
  • Integration tests.
    Action name prefix: testintegration
    Available targets: module
    Name example: 4_testintegration_cluster
  • Package builder. Subsystem package builder.
    Action name prefix: builderpackage
    Available targets: subsystem
    Name example: 4_builderpackage_server
  • Precompiled object builder. Any needed precompiled object.
    Action name prefix: builderprecompiled
    Available targets: subsystem
    Name example: 5_builderprecompiled_agent

Jobs

  • A job step must be solely comprised of Actions.
  • A job step cannot contain Actions with different prefixes.
  • A job step must use matrices whenever possible.

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:

  • Code quality. All available codeanalysis and linter type of Actions in that repository.
    Workflow name prefix: codequality
    Available targets: repository
    Name example: 4_codequality
    Trigger: Any change.
  • Unit tests.
    Workflow name prefix: testunit
    Available targets: component/module
    Name example: 5_testunit_engine
    Trigger: Any change within the target component/module.
  • Component tests.
    Workflow name prefix: testcomponent
    Available targets: component/module
    Name example: 5_testcomponent_comms-api
    Trigger: Any change within the target module.
  • Integration tests.
    Workflow name prefix: testintegration
    Available targets: module
    Name example: 5_testintegration_management-api
    Trigger: Any change within the target module.
  • Packages.
    Workflow name prefix: builderpackage
    Available targets: subsystem
    Name example: 5_builderpackage_agent
    Trigger: Any code change.

Manual (workflow dispatch)

  • Precompiled.
    Workflow name prefix: builderprecompiled
    Available targets: subsystem
    Name example: 5_builderprecompiled_dashboard
    Trigger: Any change requiring new precompilation (mostly related to dependencies changes).

Tasks

  • Define Actions according to the specification:
    • Ensure the naming convention is followed (<major>_<prefix>_<target>).
    • Categorize Actions into the appropriate use cases (code analysis, linters, tests, builders).
    • Ensure that job steps only contain Actions with the same prefix and use matrices whenever possible.
  • Define Workflows according to the specification:
    • Use the correct workflow naming prefix based on its purpose.
    • Define appropriate triggers for each workflow (PR workflows or manual dispatch).
    • Ensure PR workflows do not exceed the 30-minute execution limit.

Definion of Done

  • All required Actions are defined and adhere to the naming convention.
  • Workflows are implemented and correctly triggered based on repository changes.
  • Job steps within workflows are structured correctly, following the prefix restrictions and using matrices where applicable.
  • PR workflows are optimized to complete within the 30-minute limit.
@vikman90 vikman90 added level/task Task issue type/enhancement Enhancement issue labels Feb 14, 2025
@wazuhci wazuhci moved this to Backlog in XDR+SIEM/Release 5.0.0 Feb 14, 2025
@nbertoldo nbertoldo self-assigned this Feb 18, 2025
@wazuhci wazuhci moved this from Backlog to In progress in XDR+SIEM/Release 5.0.0 Feb 18, 2025
@nbertoldo
Copy link
Member

Work Update

2025/02/18

  • Install GitHub CLI on my dev environment.
  • Analyze current workflows
  • Start defining the new workflows and their names
Name File Proposed name
Integration tests for AWS - Tier 0 and 1 integration_tests_aws_tier_0_1.yml 4_testintegration_aws
Integration tests for Execd on Linux - Tier 0 and 1 integration_tests_execd_tier_0_1_lin.yml 4_testintegration_execd
Integration tests for Execd on Windows - Tier 0 and 1 integration_tests_execd_tier_0_1_win.yml 4_testintegration_execd
Integration tests for FIM on Linux - Tier 0 and 1 integration_tests_fim_tier_0_1_lin.yml 4_testintegration_fim
Integration tests for FIM on MacOS - Tier 0 and 1 integration_tests_fim_tier_0_1_macos.yml 4_testintegration_fim
Integration tests for FIM on Windows - Tier 0 and 1 integration_tests_fim_tier_0_1_win.yml 4_testintegration_fim
Integration tests for FIM on Linux - Tier 2 integration_tests_fim_tier_2_lin.yml 4_testintegration_fim
Integration tests for FIM on Windows - Tier 2 integration_tests_fim_tier_2_win.yml 4_testintegration_fim
Integration tests for GitHub on Linux - Tier 0 and 1 integration_tests_github_tier_0_1_lin.yml 4_testintegration_github
Integration tests for GitHub on Windows - Tier 0 and 1 integration_tests_github_tier_0_1_win.yml 4_testintegration_github
Integration tests for logcollector on Linux - Tier 0 and 1 integration_tests_logcollector_tier_0_1_lin.yml 4_testintegration_logcollector - 5_testintegration_logcollector
Integration tests for logcollector on MacOS - Tier 0 and 1 integration_tests_logcollector_tier_0_1_macos.yml 4_testintegration_logcollector - 5_testintegration_logcollector
Integration tests for logcollector on Windows - Tier 0 and 1 integration_tests_logcollector_tier_0_1_win.yml 4_testintegration_logcollector - 5_testintegration_logcollector
Integration tests for MsGraph on Linux - Tier 0 and 1 integration_tests_msgraph_tier_0_1_lin.yml 4_testintegration_msgraph
Integration tests for Office365 on Linux - Tier 0 and 1 integration_tests_office365_tier_0_1_lin.yml 4_testintegration_office365
Integration tests for Office365 on Windows - Tier 0 and 1 integration_tests_office365_tier_0_1_win.yml 4_testintegration_office365
Integration tests for SCA on Linux - Tier 0 and 1 integration_tests_sca_tier_0_1_lin.yml 4_testintegration_sca
Integration tests for SCA on Windows - Tier 0 and 1 integration_tests_sca_tier_0_1_win.yml 4_testintegration_sca
Package - Retag Docker images packages_retag_images.yml
Package - Upload Docker package building images packages_upload_images.yml
Clang Format Check clang-format-check.yml 5_codelinter_clangformat
Compile and Run Tests compile_and_run_tests.yml
Coverage Check coverage_check.yml 5_codeanalysis_coverity
deploy-gh-pages deploy-docs.yml
Build and Test Components build_and_test_component.yml
Deployment variable tests deployment_vars.yml

@cborla
Copy link
Member

cborla commented Feb 19, 2025

We move this issue to on hold until the following PR is completed, #448 Which involves part of the normalization, adapting the actions and workflows. Once it is included in the main branch we will continue with this issue.

@wazuhci wazuhci moved this from In progress to On hold in XDR+SIEM/Release 5.0.0 Feb 19, 2025
@wazuhci wazuhci moved this from On hold to In progress in XDR+SIEM/Release 5.0.0 Feb 20, 2025
@xkazinx
Copy link
Member

xkazinx commented Feb 21, 2025

Tables with proposed names were commented in the pull request, which will be updated until final names are met.

@xkazinx xkazinx linked a pull request Feb 21, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement Enhancement issue
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

4 participants