age icon indicating copy to clipboard operation
age copied to clipboard

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

Open gregfelice opened this issue 5 months ago • 2 comments

What

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

  • runs-on: ubuntu-latest → ubuntu-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.

gregfelice avatar Jun 22 '26 21:06 gregfelice

@gregfelice Please see Copilot review above.

jrgemignani avatar Jun 24 '26 16:06 jrgemignani

Thanks @jrgemignani — addressed the Copilot note in 71fe83e0.

The version guard now parses the field with awk 'NR==1 {print $NF}' instead of the grep -oE regex, and errors explicitly when the version can't be determined (instead of falling through to the confusing Bison != 3.8.x message):

ver=$(bison --version | awk 'NR==1 {print $NF}')
if [ -z "$ver" ]; then
  echo "::error::Could not determine Bison version from 'bison --version'."
  exit 1
fi

Verified the parse against bison (GNU Bison) 3.8.2 → 3.8.2 and empty input → caught by the guard.

gregfelice avatar Jun 26 '26 16:06 gregfelice

@gregfelice One last Copilot comment.

jrgemignani avatar Jun 29 '26 16:06 jrgemignani

@gregfelice bump

jrgemignani avatar Jul 02 '26 14:07 jrgemignani

@jrgemignani On the remaining Copilot note (the other workflows still on ubuntu-latest): that's intentional, and I've clarified it in the PR description under a new Scope section.

The pin exists only to freeze Bison so the GLR grammar's exact %expect/%expect-rr conflict counts stay reproducible — and installcheck.yaml (Build / Regression) is the only workflow that builds the grammar. The four driver workflows run their drivers against the AGE Docker image and never invoke Bison, so pinning them would freeze their runner for no functional reason (and would fight their own runtime pins, e.g. the Node version in nodejs-driver.yaml). So this PR narrows to Build / Regression by design rather than pinning all five.

Title/description updated to say so explicitly.

gregfelice avatar Jul 02 '26 16:07 gregfelice