Skip to content

fix(#5942)(#5943): retarget stale exception-type assertions after CommandSemanticException retyping - #5954

Merged
lvca merged 1 commit into
mainfrom
issue-5942-5943-exception-type
Aug 8, 2026
Merged

lvca merged 1 commit into
mainfrom
issue-5942-5943-exception-type

Conversation

@lvca

@lvca lvca commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #5942 and #5943 (duplicates of the same root cause) - main's unit-tests job was deterministically red.

PR #5909 (fix for #5794) retyped the errors thrown by RangeFunction.execute() (zero step) and CypherPointFunction.coerceCoordinate() (non-numeric coordinate) from CommandExecutionException to CommandSemanticException, deliberately, so the HTTP layer's 400 arm (which keys on CommandParsingException, the parent of CommandSemanticException) picks them up.

That PR added its own new test (CypherFunctionArgumentValidationIssue5794Test) correctly asserting the new type, but two pre-existing tests exercising the same call sites were not touched by that diff and kept asserting the old type:

  • RangeFunctionTest.stepZeroIsStillRejected
  • Issue4305Test.pointRaisesCleanErrorOnNonNumericString

Both failed on every CI run since 456f670 landed, masking any real regression in the unit-tests job.

Fix

Retarget both assertions to CommandSemanticException, matching the class's own hierarchy (CommandSemanticException extends CommandParsingException) and what CypherFunctionArgumentValidationIssue5794Test already asserts for the same functions. Removed the now-unused CommandExecutionException import from both files and updated the one Javadoc reference in Issue4305Test that named the old type.

No production code changed - the thrown-exception behavior introduced by #5909 was correct; only the two stale assertions were wrong.

Out of scope

Issue #5942 also flagged PostgresWJdbcIT.parsingErrorMgmt as "possibly the same root cause, not verified." I checked it: it asserts a PSQLException on a malformed \u30 unicode escape in a SQL literal, unrelated to the range()/point() retyping. It's being tracked separately.

Test plan

…mandSemanticException retyping

RangeFunction.execute() and CypherPointFunction.coerceCoordinate() were
retyped from CommandExecutionException to CommandSemanticException by
PR #5909 (#5794) so the HTTP layer answers 400 on these errors. Two
pre-existing tests untouched by that PR, RangeFunctionTest.stepZeroIsStillRejected
and Issue4305Test.pointRaisesCleanErrorOnNonNumericString, still asserted the old
type and were deterministically failing on main.
@mergify

mergify Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codacy-production

codacy-production Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage

Metric Results
Coverage variation Report missing for 49715e21
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (49715e2) Report Missing Report Missing Report Missing
Head commit (5cc0613) 185484 130702 70.47%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5954) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review

Small, well-scoped fix and I verified the core claims directly against main:

  • RangeFunction.execute() throws CommandSemanticException at engine/src/main/java/com/arcadedb/function/coll/RangeFunction.java:72, and CypherPointFunction.coerceCoordinate() throws CommandSemanticException (engine/src/main/java/com/arcadedb/function/geo/CypherPointFunction.java) - both production sites already match what the two retargeted tests now assert.
  • CommandSemanticException extends CommandParsingException (engine/src/main/java/com/arcadedb/exception/CommandSemanticException.java:26), so the HTTP-400 mapping rationale in the description checks out.
  • The new assertions are consistent with the sibling test added by fix(#5794): range() zero step, invalid date()/datetime(), non-numeric point() coordinates return HTTP 400 #5909, CypherFunctionArgumentValidationIssue5794Test, which already asserts CommandSemanticException for both range() zero-step and point() non-numeric-coordinate cases.
  • Grepped both changed test files and the surrounding function/opencypher test packages: no leftover CommandExecutionException references remain, so the import removals are safe and there is no other stale assertion of the old type for these two call sites.

Notes:

  • Good catch tracing this back to fix(#5794): range() zero step, invalid date()/datetime(), non-numeric point() coordinates return HTTP 400 #5909's deliberate retyping rather than treating it as a fresh regression - the PR description makes the causal chain easy to follow.
  • Nicely scoped: production code is untouched, matching the stated "no behavior change, only stale assertions" intent.
  • The Javadoc update in Issue4305Test (renaming the referenced exception type) is a nice touch for keeping docs in sync with the assertion.
  • Appreciate that the out-of-scope investigation (PostgresWJdbcIT.parsingErrorMgmt) was called out explicitly rather than silently left aside.

No code quality, correctness, performance, or security concerns here - this is test-only and the retyped assertions are the right ones per the actual exception hierarchy. Test coverage is unchanged in scope (existing tests fixed, not added), which is appropriate since the underlying behavior isn't new.

@lvca lvca added this to the 26.9.1 milestone Aug 8, 2026
@lvca lvca self-assigned this Aug 8, 2026
@lvca
lvca merged commit 6f6028f into main Aug 8, 2026
23 of 26 checks passed
@lvca
lvca deleted the issue-5942-5943-exception-type branch August 8, 2026 05:13
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.10%. Comparing base (73be2e7) to head (5cc0613).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5954   +/-   ##
=======================================
  Coverage   68.10%   68.10%           
=======================================
  Files        1797     1797           
  Lines      153141   153141           
  Branches    32436    32436           
=======================================
+ Hits       104299   104303    +4     
+ Misses      35442    35436    -6     
- Partials    13400    13402    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant