ci: pin runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445
ci: pin runner to ubuntu-24.04 and guard Bison version for GLR grammar#2445gregfelice wants to merge 2 commits into
Conversation
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.
There was a problem hiding this comment.
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-latesttoubuntu-24.04to 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.
|
@gregfelice Please see Copilot review above. |
Address Copilot review on apache#2445: the previous grep-based parse could silently yield an empty version and fail with a confusing 'Bison != 3.8.x' message. Parse the version field with awk and error explicitly when it can't be determined.
|
Thanks @jrgemignani — addressed the Copilot note in 71fe83e. The version guard now parses the field with ver=$(bison --version | awk 'NR==1 {print $NF}')
if [ -z "$ver" ]; then
echo "::error::Could not determine Bison version from 'bison --version'."
exit 1
fiVerified the parse against |
| # in src/backend/parser/cypher_gram.y, and Bison treats %expect as exact-match: | ||
| # a different Bison version can report different counts and break the build. | ||
| # Freezing the runner image freezes Bison; bump both together, intentionally. | ||
| runs-on: ubuntu-24.04 |
|
@gregfelice One last Copilot comment. |
What
Pin the CI runner image and guard the Bison version for the Cypher GLR grammar.
runs-on: ubuntu-latest→ubuntu-24.04Why
src/backend/parser/cypher_gram.ypins exact conflict counts via%expect 7/%expect-rr 3, and Bison treats%expectas exact-match (not a ceiling) — any deviation fails the build.ubuntu-latestfloats 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
%expectcounts 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%expectand updates it on intentional changes.Testing
CI config only; no source or test changes. The existing
Build / Regressionworkflow runs unchanged on the pinned image.