Skip to content

ci: pin runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445

Open
gregfelice wants to merge 1 commit into
apache:masterfrom
gregfelice:ci/pin-bison-for-glr-grammar
Open

ci: pin runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445
gregfelice wants to merge 1 commit into
apache:masterfrom
gregfelice:ci/pin-bison-for-glr-grammar

Conversation

@gregfelice

Copy link
Copy Markdown
Contributor

What

Pin the CI runner image and guard the Bison version for the Cypher GLR grammar.

  • runs-on: ubuntu-latestubuntu-24.04
  • Add a "Verify Bison version" step that fails with a clear, actionable message if Bison ever drifts off 3.8.x.

Why

src/backend/parser/cypher_gram.y pins exact conflict counts via %expect 7 / %expect-rr 3, and Bison treats %expect as exact-match (not a ceiling) — any deviation fails the build. ubuntu-latest floats to new Ubuntu releases, which can ship a different Bison version that reports different conflict counts, breaking the build with a cryptic grammar-generation error unrelated to the actual change.

Freezing the runner image freezes Bison at 3.8.x, so the pinned %expect counts stay reproducible. The version guard turns a future drift into an explicit, self-explanatory failure ("re-run bison, update %expect, and bump the pinned runner together") instead of a confusing one.

Reproducibility comes from pinning the variable rather than widening the conflict-count tolerance, keeping the exact-match alarm for genuinely new grammar conflicts intact. This mirrors PostgreSQL's own gram.y, which keeps an exact %expect and updates it on intentional changes.

Testing

CI config only; no source or test changes. The existing Build / Regression workflow runs unchanged on the pinned image.

The Cypher GLR grammar pins exact shift/reduce and reduce/reduce conflict
counts via %expect / %expect-rr in cypher_gram.y, and Bison treats %expect
as exact-match: a different Bison version can report different counts and
break the build. ubuntu-latest floats to new Ubuntu releases (and new Bison
versions), which would silently shift those counts.

Pin runs-on to ubuntu-24.04 to freeze Bison at 3.8.x, and add a guard step
that fails loudly with a pointer to cypher_gram.y if Bison ever drifts off
3.8.x. Reproducibility comes from pinning the variable rather than widening
the conflict-count tolerance, keeping the exact-match alarm for genuinely
new grammar conflicts intact.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the CI environment more reproducible for the Cypher GLR grammar by pinning the GitHub Actions runner image and adding an explicit guard that fails early if the Bison version drifts from the expected 3.8.x series (which would change %expect/%expect-rr conflict counts and break grammar generation).

Changes:

  • Pin the workflow runner from ubuntu-latest to ubuntu-24.04 to avoid unexpected toolchain drift.
  • Add a “Verify Bison version” step that errors with an actionable message when Bison is not 3.8.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +40
ver=$(bison --version | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "bison $ver"
case "$ver" in
@jrgemignani

Copy link
Copy Markdown
Contributor

@gregfelice Please see Copilot review above.

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.

3 participants