Skip to content

ci: really regenerate the parser in the parser generation jobs - #3770

Merged
airween merged 1 commit into
owasp-modsecurity:v3/masterfrom
airween:v3/ci-parser-generation
Nov 18, 2026
Merged

airween merged 1 commit into
owasp-modsecurity:v3/masterfrom
airween:v3/ci-parser-generation

Conversation

@airween

@airween airween commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What

The "with parser generation" jobs in ci_new.yml didn't reliably regenerate the parser, and on macOS they couldn't.

  • The regeneration depended on file times. --enable-parser-generation only makes bison and flex available to make. make regenerates seclang-parser.cc and seclang-scanner.cc only when the .yy or the .ll is newer than the committed output, and after a checkout that depends on the order in which the files were written. In the run of fix: SecDefaultAction applies only to the rules defined after it, and its setvar runs at each match #3769, which changes seclang-parser.yy, the 8 Linux jobs and macOS macos-26 regenerated the parser, while macOS macos-15 and xcode-27 compiled the committed files (there is no ylwrap seclang-parser line in their logs).
  • macOS used the wrong bison. Homebrew installs bison keg-only, so it isn't on PATH, and configure picks up /usr/bin/bison, the 2.3 that comes with macOS. In fix: SecDefaultAction applies only to the rules defined after it, and its setvar runs at each match #3769, the macOS job that did regenerate failed: seclang-parser.yy:2.10-16: require bison 3.0.2, but have 2.3 (macOS, macos-26, with parser generation).

How

  • macOS: a step after the Homebrew install puts $(brew --prefix bison)/bin on GITHUB_PATH.
  • All three parser generation jobs (Linux old, Linux, macOS): before make, a step prints the bison and flex versions and touches src/parser/seclang-parser.yy and src/parser/seclang-scanner.ll, so both are always regenerated.

The committed parser is not affected; the other jobs still compile it as before.

Checks

  • ci_new.yml parses as YAML.
  • The real check is this PR's own CI run: every "with parser generation" job should now show the bison version (3.x on macOS, too) and the ylwrap lines for both the parser and the scanner.

AI disclosure

Made with help of Claude Code (Opus 5.5)

Summary by CodeRabbit

  • Chores
    • Build workflows now report the Bison and Flex versions used on Linux and macOS.
    • Parser grammar and scanner files are prepared before compilation across supported platforms. The macOS build also makes the Homebrew Bison tools available during build setup. These updates provide clearer build environment details and align preparation steps across the platform workflows.

The "with parser generation" jobs only regenerated the parser when make
found seclang-parser.yy or seclang-scanner.ll newer than the committed
output. After a checkout that depends on file times, so some runs just
compiled the committed files. When a run did regenerate on macOS, it
used the bison 2.3 that comes with macOS, because Homebrew installs
bison keg-only, and failed with "require bison 3.0.2, but have 2.3".

- macOS: put the Homebrew bison first in PATH.
- All parser generation jobs: print the bison and flex versions and
  touch the grammar and the scanner before make, so they are always
  regenerated.

AI disclosure: made with help of Claude Code, Opus 5.5
@airween
airween requested a review from fzipi November 18, 2026 16:07
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

CI workflow jobs now report Bison and Flex versions and touch parser files before compilation when parser generation is enabled. The macOS job also adds Homebrew’s Bison binary directory to GITHUB_PATH.

Changes: Parser-generation CI setup

Layer / File(s) Summary
Parser-generation job setup
.github/workflows/ci_new.yml
Linux and macOS jobs report Bison and Flex versions and touch parser grammar and scanner files when parser generation is enabled. The macOS job adds Homebrew’s Bison binary directory to GITHUB_PATH before build preparation and configuration.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: easton97-jens

Merge Risk: Minimal · up to 0de38

This change makes the parser-generation CI jobs regenerate the parser instead of compiling committed files, and it makes macOS use Homebrew's bison. It affects CI only, with no production or runtime impact. No concrete merge-blocking problem was found; confirming a green CI run on the PR is the only remaining check.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the parser-generation CI jobs now regenerate the parser instead of compiling committed parser files. The raw summary confirms the workflow edits in all three parser-ge…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the parser-generation CI jobs now regenerate the parser instead of compiling committed parser files. The raw summary confirms the workflow edits in all three parser-generation jobs (touching the grammar and scanner files, reporting Bison and Flex versions) and the macOS change that adds Homebrew's Bison directory to GITHUB_PATH. The title uses the 'ci:' prefix and is specific, though it does not mention the macOS Bison path fix.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

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: 3c01b53b-f14d-44a1-ab69-92b583246708
Commits

Reviewing files that changed from the base of the PR and between 3921e8e and 0de3872.

Files selected for processing: 1

  • .github/workflows/ci_new.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@airween
airween merged commit 475aece into owasp-modsecurity:v3/master Nov 18, 2026
103 checks passed
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.

2 participants