Skip to content

ci(v2): update Ubuntu coverage, Lua selection and GitHub Actions - #3729

Open
Easton97-Jens wants to merge 4 commits into
owasp-modsecurity:v2/masterfrom
Easton97-Jens:codex/v2-ci-ubuntu-matrix
Open

Easton97-Jens wants to merge 4 commits into
owasp-modsecurity:v2/masterfrom
Easton97-Jens:codex/v2-ci-ubuntu-matrix

Conversation

@Easton97-Jens

Copy link
Copy Markdown
Contributor

what

The v2 Linux workflow currently lists architecture and compiler matrix axes without applying them to the build. As a result, jobs labelled x32 or Clang can run the same default 64-bit GCC build. This PR makes those axes effective and updates the supported Ubuntu combinations.

Ubuntu build and unit-test coverage

Runner Target architectures Compilers Configurations per compiler and architecture
Ubuntu 22.04 i386 (32-bit) and amd64 GCC and Clang 10
Ubuntu 24.04 amd64 GCC and Clang 10
Ubuntu 26.04 amd64 GCC and Clang 6

The existing x32 job label denotes 32-bit i386, not the x86-64 x32 ABI.

  • Set CC and CXX from the compiler matrix.
  • Apply -m32 to compilation and linking for i386.
  • Enable the i386 package architecture and install matching Apache binaries, Apache development files and library dependencies. A 32-bit module needs a 32-bit Apache process for integration testing.
  • Clear PKG_CONFIG_PATH and restrict PKG_CONFIG_LIBDIR to the target architecture and architecture-independent metadata.
  • Check the ELF architecture of both Apache and the built mod_security2.so, so an incorrectly labelled architecture job fails explicitly.
  • Preserve the existing PCRE/PCRE2, study/JIT and Lua configurations. Exclude all four PCRE1 configurations on Ubuntu 26.04 and skip installation of its unavailable PCRE1 development package.

Lua selection

Use the v3 approach to discover the newest available libluaX.Y-dev package with apt-cache, version-sort the candidates, and install the selected package.

This replaces the fixed Lua 5.1 package in the Ubuntu jobs and the fixed Lua 5.3 package in the Debian cppcheck job. The same selection also applies to regression jobs, and the development package is installed for the selected target architecture.

Regression tests and static analysis

  • Run the existing ssdeep regression configuration on Ubuntu 22.04, 24.04 and 26.04.
  • Keep regression jobs amd64-only: Ubuntu 22.04 does not provide the required ssdeep development package for i386.
  • Retain the Debian sid cppcheck job.
  • Preserve v2's build and test entry points: ./autogen.sh, Apache integration checks, make test, make test-regression and make check-static.

Actions and build setup

  • Update actions/checkout to v7.0.1, pinned to 3d3c42e5aac5ba805825da76410c181273ba90b1.
  • Use the Node24 GCC problem matcher already used by v3, pinned to cb2e3f949c41b7818628f35f8484a9b0acf90cf9.
  • Add -Wformat alongside the existing -Werror=format-security, allowing the compiler checks to run with that warning enabled.
  • Enable Apache's unique_id module explicitly before the integration smoke test; ModSecurity requires it for request processing.
  • Give build, unit-test and regression jobs distinct names and set matrix fail-fast: false.

why

This provides actual compiler and architecture coverage while retaining 32-bit compatibility testing on Ubuntu 22.04 and adding 64-bit coverage for newer Ubuntu versions.

Architecture-specific Apache packages are necessary because compiler flags alone cannot make a 64-bit Apache load a 32-bit module. Restricting dependency discovery and checking the resulting ELF files also prevents host libraries from silently undermining the intended coverage.

Dynamic Lua selection follows the v3 workflow and exercises the newest distribution-provided Lua supported by the current v2 source. Explicit PCRE1 exclusions avoid package-installation failures on Ubuntu 26.04 while keeping PCRE1 coverage on Ubuntu 22.04 and 24.04.

Review and operational considerations

  • The workflow expands from 82 jobs to 148: 72 build/smoke jobs, 72 unit-test jobs, three regression jobs and one cppcheck job. This increases runner usage.
  • Check names change to include the job purpose, Ubuntu version, architecture, compiler and configuration. Repositories that require individual named checks should review their required-check configuration.
  • Only .github/workflows/ci.yml changes.

validation

Completed

  • git diff --check.
  • Actionlint v1.7.12 and Bash syntax checks for workflow shell steps. Actionlint's outdated Ubuntu 26.04 runner-label warning was ignored after checking the label against the official runner-image list.
  • Independent expansion of the matrix: i386 appears only on Ubuntu 22.04, all four PCRE1 configurations are excluded on Ubuntu 26.04, and build/unit-test matrices each contain 72 jobs.
  • Actual Ubuntu 22.04 package installation replacing amd64 Apache with i386 Apache, with matching development libraries and native compiler tools.
  • An i386 GCC build with Lua and PCRE2; module, Apache and test executable verified as ELF32.
  • Clean GCC builds and complete unit-test runs in Ubuntu 24.04 and 26.04 containers using the final compiler and pkg-config settings.
  • Apache configuration/startup and HTTP 200 smoke tests with unique_id enabled on both 64-bit containers. Lua 5.4 was selected on Ubuntu 24.04 and Lua 5.5 on Ubuntu 26.04.
  • A focused regression test on both 64-bit containers, run as an unprivileged user.
  • Selected native GitHub i386 build/smoke jobs with GCC and Clang, covering Lua, no Lua, PCRE1 and PCRE2, plus cppcheck, succeeded on 55913ebb. The final commit adds explicit activation of Apache unique_id.

Limits and pending checks

  • The full matrix for final commit 4fbfc30d is still queued at PR creation; this description does not claim the complete workflow is green.
  • The complete local regression suite is not counted as passed. Container-specific duplicate localhost resolution caused Apache bind failures; after correcting only the container configuration, focused regression checks passed.
  • The local managed runtime cannot execute i386 binaries natively. Supplementary QEMU checks are not counted as a clean native unit-test pass: an assertion-enabled build hit one invalid-CIDR assertion. The workflow's separate unit-test jobs omit assertions; native i386 execution is covered by GitHub Actions.

references

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7078afab-1853-4f8f-8b34-d91cb2ad6990

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@airween airween added the 2.x Related to ModSecurity version 2.x label Nov 1, 2026
@airween

airween commented Nov 1, 2026

Copy link
Copy Markdown
Member

Hi @Easton97-Jens,

thanks for this PR - could you take a look at the CI tests result, especially to this one? Thanks!

@Easton97-Jens

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out. I checked the logs: 315 of 316 regression tests passed. The “drop in phase:1” case fails because the test harness does not detect Apache’s startup message within 60 seconds, before sending the actual test request.

The same Ubuntu 22.04 regression job passed in both previous fork runs, and the Ubuntu 24.04 and 26.04 jobs passed in this PR. This suggests an intermittent startup issue, although the exact cause is not yet confirmed.

Could you rerun the failed job? If it fails again, I suggest capturing tests/regression/server_root/logs/error.log in CI so we can investigate the underlying Apache error.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.x Related to ModSecurity version 2.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants