ci: tighten the fully qualified version check (DRIVER-924) - #1049
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Makefile now applies shared validation to fully qualified Cassandra and ScyllaDB versions. Resolvers reject invalid cache values, enforce exact pre-release formats, and write caches only after fresh resolution. ScyllaDB enterprise fallback applies only to four-digit-year versions. Download and integration-test targets validate versions before invoking CCM or Maven. Sequence Diagram(s)sequenceDiagram
participant MakeTarget
participant VersionResolver
participant CCMOrMaven
MakeTarget->>VersionResolver: resolve or receive server version
VersionResolver-->>MakeTarget: return version value
MakeTarget->>MakeTarget: validate fully qualified version
MakeTarget->>CCMOrMaven: pass validated version
Merge Risk: ⚪ Minimal · up to The Makefile now consistently validates Cassandra and ScyllaDB version inputs, cache values, and resolved versions before CCM or Maven use. No concrete merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Tightens server-version resolution to prevent partial or malformed versions from reaching CCM.
Changes:
- Anchors suffixed-version validation and resets exemption flags.
- Invalidates partial cached resolutions.
- Avoids unnecessary ScyllaDB Enterprise lookups.
Suppressed comments (1)
Makefile:161
- This only removes a cached two-component numeric value. The previous unanchored suffix branch could have written the other bypass examples (
5.4.or2026.2x), and these files remain cache hits that return before the tightened parser runs. Accept the cache only when its contents satisfy the current full-version or suffixed-version grammar.
if [[ -f "${SCYLLA_VERSION_FILE}" ]] && [[ "$$(cat ${SCYLLA_VERSION_FILE})" =~ ^[0-9]+\.[0-9]+$$ ]]; then
rm -f "${SCYLLA_VERSION_FILE}"
fi
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a365d2c to
d795cd2
Compare
d795cd2 to
5d5d6c4
Compare
bdda140 to
4cd82b9
Compare
One grammar now decides what counts as a usable version, at every point that accepts one. It could otherwise be bypassed: eviction rejected only a bare MAJOR.MINOR, so a cached '4.1.' was served; the exemption flag was never initialised; and the four targets handing a version to CCM never checked what CI passes them. A warm cache also skipped the GITHUB_OUTPUT write. A pre-release label must carry its own number: CCM strips a trailing -x86_64, so 6.2.0-dev-aarch64 would reach it as the moving 6.2.0-dev. A bare label is exact only before a dated build id such as 2024.2.3-0.20250108.931ce203dcf5. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018vGi2zZJxw51iagdPmVa4t
4cd82b9 to
fe20a88
Compare
The fully qualified version check added in #1043 could be bypassed, so a partial version could
still reach CCM — the one thing it exists to prevent. The cause was two predicates that disagreed:
a flag for freshly resolved values, a shape test for cached ones. This defines the grammar once and
applies it wherever a version is accepted.
MAJOR.MINOR, so a4.1.or4.1xleft byan earlier Makefile was still served unchecked.
SCYLLA_VERSION_EXACT=1disabled thecheck. One shared grammar removes the flag and its double negative.
download-*andtest-integration-*took the version from the environment behind only anon-empty test before handing it to
ccm create/mvn— which is exactly how CI supplies it.GITHUB_OUTPUTwrite, leaving a step output empty.scylla-enterpriselookup for OSS lines like6.2, which never had releases there.A version is exact when it is
MAJOR.MINOR.PATCH, a pre-release label carrying its own number(
2022.2.0-rc0,5.0.rc3,4.0-alpha1), or a dated build id(
2024.2.3-0.20250108.931ce203dcf5,5.4.0~dev-0.20230801.37b548f46365); all pass through with nolookup. The number must sit in the label itself — CCM strips a trailing
-x86_64/-aarch64beforeparsing, so
6.2.0-dev-aarch64would otherwise reach it as the moving6.2.0-dev.Verified against the regex Make actually ships: 77 accept/reject cases covering every Cassandra and
Scylla form found in
ccmlib, plus the invariant that no accepted version turns into a movingselector once CCM strips the arch suffix. End to end with a stubbed
get-versionfor the cache andconsumer cases — a poisoned entry evicted, a warm hit writing
GITHUB_OUTPUTwithout refreshing themtime. Each case was re-run against the previous head to confirm it genuinely flipped. Not covered:
no integration suite was run locally, so the
ccm createpath rests on CI.Follows #1043, which merged before these fixes were ready. The 3.x twin #1044 merged with the
earlier grammar; a port keeping the two byte-identical follows once this one is settled.
Refs: https://scylladb.atlassian.net/browse/DRIVER-924