Skip to content

fix: require integer limits in findAndRerank - #2623

Open
erichare wants to merge 5 commits into
mainfrom
fix/find-and-rerank-integer-limits
Open

erichare wants to merge 5 commits into
mainfrom
fix/find-and-rerank-integer-limits

Conversation

@erichare

@erichare erichare commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Requires limit and scalar or object hybridLimits values to be JSON integers within the Java integer range before conversion. Invalid values return REQUEST_STRUCTURE_MISMATCH with the field path and value. Null defaults, positivity checks, and configured hybrid bounds retain their existing behavior.

Which issue(s) this PR fixes:

Fixes #2610

Verification:

Passed on Java 21 with 242 tests, no failures, errors, or skips. Formatting and whitespace checks passed, including request-error and MCP schema contract coverage. Full unit and database integration suites were not run.

JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw clean fmt:check -Dtest=FindAndRerankCommandLimitsTest,FindAndRerankLimitsTest,HybridLimitsDeserializerTest,FindAndRerankPlannerTest,FindAndRerankOperationBuilderTest,McpClauseSchemaContractTest test
git diff --check cca16839af848aa3bed8f34d02845f5eb8123511...HEAD

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@erichare
erichare requested a review from a team as a code owner October 7, 2026 15:00
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 56.74%
This PR 56.91%
Delta 🟢 +0.18%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 56.91% 🍏
Files changed 100% 🍏

File Coverage
FindAndRerankCommand.java 89.62% 🍏

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.98%
This PR 72.96%
Delta 🔴 -0.02%
⚠️ Coverage decreased

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 72.96% -0.04% 🍏
Files changed 58.82% ❌

File Coverage
FindAndRerankCommand.java 71.63% -14.53% ❌

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.31% -0.04% 🍏
Files changed 58.82% ❌

File Coverage
FindAndRerankCommand.java 72.32% -14.53% ❌

Confirmed RED on main: 32 cases expose decimal truncation, integer overflow, or unhelpful overflow errors. Integer boundaries and omitted/null defaults still pass.
Confirmed RED for whole-valued decimals, exponent notation, and numeric strings alongside the numeric regressions. Added HTTP error mapping and positivity regression tests.
Confirmed GREEN: 104 parsing and HTTP tests pass. Limit values must be JSON integers fitting int32 before conversion, while defaults, positivity checks, and configured hybrid bounds are retained.
Confirmed RED: 5.0 and 5e0 produce messages displaying 5 without explaining that the input is floating point.
Confirmed GREEN: all 239 targeted tests pass, including HTTP checks explaining that 5.0 and 5e0 are floating-point inputs.
@erichare
erichare force-pushed the fix/find-and-rerank-integer-limits branch from abaf2cf to da87349 Compare November 5, 2026 22:35
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📉 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.33%
This PR 74.31%
Delta 🔴 -0.02%
⚠️ Coverage decreased

This branch has not been deployed

No deployments
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.

Unclear error message when hybridLimits/limits is not an integer in findAndRerank

1 participant