Skip to content

refactor: move server path utilities to engine module to eliminate in…#2881

Merged
robfrank merged 3 commits intomainfrom
feat/2863-server-integration-dependency-removal
Dec 5, 2025
Merged

refactor: move server path utilities to engine module to eliminate in…#2881
robfrank merged 3 commits intomainfrom
feat/2863-server-integration-dependency-removal

Conversation

@robfrank
Copy link
Collaborator

@robfrank robfrank commented Dec 5, 2025

This pull request refactors the server path utility logic to improve modularity and reduce dependencies between the server and integration modules. It introduces a new utility class in the engine module, deprecates the old integration utility, and updates references throughout the codebase. Additionally, it adds new vector index test cases and adjusts Maven dependencies for better separation of concerns.

Refactoring and modularization

  • Introduced the new ServerPathUtils utility class in the engine module to handle server root path configuration, moving the logic from IntegrationUtils to avoid server → integration dependency. (engine/src/main/java/com/arcadedb/utility/ServerPathUtils.java)
  • Deprecated the IntegrationUtils class in the integration module, updating its documentation and implementation to delegate to ServerPathUtils for backward compatibility. (integration/src/main/java/com/arcadedb/integration/misc/IntegrationUtils.java)

Dependency management

  • Updated server/pom.xml to remove the compile-time dependency on arcadedb-integration and add it as a test-scoped dependency, ensuring the server module does not depend on integration code at runtime. (server/pom.xml) [1] [2]

Codebase updates

  • Replaced all usages of IntegrationUtils.setRootPath with ServerPathUtils.setRootPath in the ArcadeDBServer class, reflecting the new utility location. (server/src/main/java/com/arcadedb/server/ArcadeDBServer.java) [1] [2] [3]

Testing improvements

  • Added new test classes for vector index functionality, including GloVeReopenVerificationTest to verify vector searches after database restarts and SimpleGloVeTest as an example application for querying word vectors. (integration/src/test/java/com/arcadedb/integration/importer/vector/GloVeReopenVerificationTest.java, integration/src/test/java/com/arcadedb/integration/importer/vector/SimpleGloVeTest.java) [1] [2]

@robfrank robfrank added this to the 25.11.1 milestone Dec 5, 2025
@robfrank robfrank added the enhancement New feature or request label Dec 5, 2025
@robfrank robfrank linked an issue Dec 5, 2025 that may be closed by this pull request
4 tasks
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the architectural modularity and reducing inter-module dependencies by relocating core server path utility logic to a more appropriate module. This refactoring ensures a cleaner separation of concerns between the server and integration components. Concurrently, new comprehensive test cases have been introduced to validate the robustness and correct operation of vector index functionality, particularly concerning database persistence and querying capabilities.

Highlights

  • Server Path Utility Relocation: The logic for setting the server root path has been moved from the IntegrationUtils class in the integration module to a new ServerPathUtils class within the engine module. This change improves modularity and reduces dependencies.
  • IntegrationUtils Deprecation: The original IntegrationUtils class and its setRootPath method have been marked as deprecated. The method now delegates to the new ServerPathUtils for backward compatibility, encouraging new code to use the dedicated utility.
  • Maven Dependency Refinement: The server module's pom.xml has been updated to change the arcadedb-integration dependency from a compile scope to a test scope. This ensures the server module does not depend on integration code at runtime, enhancing separation of concerns.
  • Vector Index Testing Improvements: Two new test classes, GloVeReopenVerificationTest and SimpleGloVeTest, have been added to the integration module. These tests verify vector index functionality, including correct behavior after database restarts and provide an example for querying word vectors.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify
Copy link
Contributor

mergify bot commented Dec 5, 2025

🧪 CI Insights

Here's what we observed from your CI run for 35f9aff.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully refactors server path utility logic to improve modularity and reduce dependencies, which is a great improvement. The dependency of the server module on arcadedb-integration has been correctly moved to a test-only scope. However, the newly added test files, particularly SimpleGloVeTest.java, introduce some significant issues. This includes a hardcoded, user-specific file path which makes the build non-portable, and the use of System.exit(0) in a test class. I've provided detailed feedback and suggestions to address these and other minor issues in the code.

*/
public class SimpleGloVeTest {
private final static int PARALLEL_LEVEL = 8;
private static final String FILE_NAME = "/Users/frank/Downloads/glove.twitter.27B/glove.twitter.27B.100d.txt";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This file contains a hardcoded, user-specific file path. This will cause the test/application to fail on any machine other than the original author's. This path should be parameterized, for example, by reading it from a configuration file or a system property. Hardcoding absolute paths like this makes the build non-portable and should be avoided.

Comment on lines +52 to +73
public static void main(String[] args) {
new SimpleGloVeTest();
}

public SimpleGloVeTest() {

final DatabaseFactory factory = new DatabaseFactory("databases/glovedb");
final Database database;

try {

database = importDataSet(factory);

LogManager.instance().log(this, Level.SEVERE, "Found index with %d entries",
database.getSchema().getIndexByName("Word[vector]").countEntries());

querySQL(database);
} finally {
factory.close();
}
System.exit(0);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This class is located in the test sources (src/test/java) but is structured like a standalone application with a main method and a System.exit(0) call. This is not appropriate for automated tests.

  • If this is intended to be an example application, it should be moved to src/main/java in an examples package.
  • If it is an automated test, it should be refactored into a proper JUnit test case with @Test methods, and System.exit() must be removed.

The call to System.exit(0) is particularly problematic as it can terminate the entire JVM, which will prematurely stop the test suite.

*
* @author Luca Garulli (l.garulli@arcadedata.com)
*/
public class ServerPathUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a utility class with only static methods. To prevent instantiation, it's a good practice to add a private constructor.

public class ServerPathUtils {
  private ServerPathUtils() {
    // Utility class
  }

* @author Luca Garulli (l.garulli@arcadedata.com)
*/
@Deprecated(forRemoval = true, since = "25.11.1")
public class IntegrationUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This utility class only contains a static method. To prevent accidental instantiation, it's a good practice to add a private constructor, even for a deprecated class.

public class IntegrationUtils {
  private IntegrationUtils() {
    // Utility class
  }

Comment on lines +44 to +47
if (!factory.exists()) {
System.out.println("Skipping test - glovedb database does not exist");
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of manually checking for the database's existence and printing to standard output, it's better to use JUnit 5's Assumptions.assumeTrue(). This will properly mark the test as skipped in test reports, which is more informative. You'll need to add import org.junit.jupiter.api.Assumptions;.

Additionally, System.out.println is used throughout this test. It should be avoided in tests. Please use a logger for any output.

    Assumptions.assumeTrue(factory.exists(), "Skipping test - glovedb database does not exist");

Comment on lines +48 to +50
private final static int PARALLEL_LEVEL = 8;
private static final String FILE_NAME = "/Users/frank/Downloads/glove.twitter.27B/glove.twitter.27B.100d.txt";
private boolean USE_SQL = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are several unused variables in this class that should be removed to improve code clarity:

  • The field PARALLEL_LEVEL (line 48) is not used.
  • The field USE_SQL (line 50) is not used.
  • The local variable startWord in querySQL (line 87) is initialized but never used.

Comment on lines +65 to +66
LogManager.instance().log(this, Level.SEVERE, "Found index with %d entries",
database.getSchema().getIndexByName("Word[vector]").countEntries());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logging level Level.SEVERE is used here and in other places in this file for informational messages. SEVERE should be reserved for serious failures. For informational messages, Level.INFO or Level.FINE would be more appropriate. Please review all logging statements in this file and use the correct log levels.

Suggested change
LogManager.instance().log(this, Level.SEVERE, "Found index with %d entries",
database.getSchema().getIndexByName("Word[vector]").countEntries());
LogManager.instance().log(this, Level.INFO, "Found index with %d entries",

Comment on lines +123 to +125
// TODO: REMOVE THIS
// if (factory.exists())
// factory.open().drop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This commented-out code block with a TODO: REMOVE THIS should be removed before merging. Leaving such artifacts in the codebase can cause confusion.

@robfrank
Copy link
Collaborator Author

robfrank commented Dec 5, 2025

Review Comments Resolution

Fixed Issues

ServerPathUtils - Private Constructor (Comment #2593292814)

  • Added private constructor to prevent instantiation of utility class

IntegrationUtils - Private Constructor (Comment #2593292821)

  • Added private constructor to deprecated utility class

Requires Removal/Refactoring

SimpleGloVeTest.java - Critical Issues
The following comments are valid and indicate this file should be removed from the PR:

  1. Hardcoded File Path (Comment #2593292809)

    • Contains hardcoded path: /Users/frank/Downloads/glove.twitter.27B/glove.twitter.27B.100d.txt
    • This will fail on any other machine
  2. Inappropriate Test Structure (Comment #2593292812)

    • Located in src/test/java but designed as a standalone application
    • Has main() method and calls System.exit(0)
    • This will terminate the JVM during test suite execution
    • Should be either moved to examples or refactored as a proper JUnit test
  3. Unused Variables (Comment #2593292831)

    • PARALLEL_LEVEL (line 48) - never used
    • USE_SQL (line 50) - never used
    • startWord (line 87) - initialized but never used
  4. Wrong Log Levels (Comment #2593292835)

    • Using Level.SEVERE for informational messages (lines 65, 116, 129, 132, 136, 148)
    • Should use Level.INFO for info messages
  5. System.out.println in Tests (Comment #2593292826)

    • Should use logger instead (GloVeReopenVerificationTest.java)
  6. Commented TODO Code (Comment #2593292842)

    • Commented-out code block with "TODO: REMOVE THIS" (lines 123-125)

Recommendation

SimpleGloVeTest.java should be removed from this PR. This file:

  • Is an example/standalone application, not a unit test
  • Has production code issues (hardcoded paths, System.exit calls)
  • Will cause test suite failures
  • Does not belong in a PR focused on dependency refactoring

The core fix (ServerPathUtils, dependency management, IntegrationUtils deprecation) is solid and should be merged separately from this problematic test file.

@codacy-production
Copy link

codacy-production bot commented Dec 5, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.12% 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (0bbd914) 70174 46362 66.07%
Head commit (35f9aff) 70179 (+5) 46452 (+90) 66.19% (+0.12%)

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 (#2881) 7 7 100.00%

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%

See your quality gate settings    Change summary preferences

@robfrank robfrank merged commit d5bcde7 into main Dec 5, 2025
26 of 33 checks passed
@robfrank robfrank deleted the feat/2863-server-integration-dependency-removal branch December 5, 2025 22:35
mdre pushed a commit to mdre/arcadedb that referenced this pull request Dec 8, 2025
… /studio in the security-critical group [skip ci]

Bumps the security-critical group in /studio with 1 update: [sweetalert2](https://github.com/sweetalert2/sweetalert2).
Updates `sweetalert2` from 11.26.1 to 11.26.2
Release notes

*Sourced from [sweetalert2's releases](https://github.com/sweetalert2/sweetalert2/releases).*

> v11.26.2
> --------
>
> [11.26.2](sweetalert2/sweetalert2@v11.26.1...v11.26.2) (2025-10-12)
> ----------------------------------------------------------------------------------------------
>
> ### Bug Fixes
>
> * DismissReason type, ESLint warnings ([ArcadeData#2882](https://redirect.github.com/sweetalert2/sweetalert2/issues/2882)) ([c5af0cf](sweetalert2/sweetalert2@c5af0cf))


Changelog

*Sourced from [sweetalert2's changelog](https://github.com/sweetalert2/sweetalert2/blob/main/CHANGELOG.md).*

> [11.26.2](sweetalert2/sweetalert2@v11.26.1...v11.26.2) (2025-10-12)
> ----------------------------------------------------------------------------------------------
>
> ### Bug Fixes
>
> * DismissReason type, ESLint warnings ([ArcadeData#2882](https://redirect.github.com/sweetalert2/sweetalert2/issues/2882)) ([c5af0cf](sweetalert2/sweetalert2@c5af0cf))


Commits

* [`c19156f`](sweetalert2/sweetalert2@c19156f) chore(release): 11.26.2 [skip ci]
* [`c5af0cf`](sweetalert2/sweetalert2@c5af0cf) fix: DismissReason type, ESLint warnings ([ArcadeData#2882](https://redirect.github.com/sweetalert2/sweetalert2/issues/2882))
* [`5f32bff`](sweetalert2/sweetalert2@5f32bff) chore: bump bun.lock
* [`8be0497`](sweetalert2/sweetalert2@8be0497) chore: yarn -> bun migration ([ArcadeData#2881](https://redirect.github.com/sweetalert2/sweetalert2/issues/2881))
* See full diff in [compare view](sweetalert2/sweetalert2@v11.26.1...v11.26.2)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=sweetalert2&package-manager=npm\_and\_yarn&previous-version=11.26.1&new-version=11.26.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore  major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore  minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore  ` will remove the ignore condition of the specified dependency and ignore conditions
robfrank added a commit that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TASK-P1-001: Fix Server → Integration Dependency

1 participant