Skip to content

fix: enhance edge creation and bucket handling in remote database cla…#2351

Merged
robfrank merged 2 commits intomainfrom
fix/1578-remote-mutable-edge
Jul 17, 2025
Merged

fix: enhance edge creation and bucket handling in remote database cla…#2351
robfrank merged 2 commits intomainfrom
fix/1578-remote-mutable-edge

Conversation

@robfrank
Copy link
Collaborator

#1578

This pull request introduces enhancements to the graph and remote database APIs, with updates to edge creation, schema handling, and test cases. The changes improve functionality, add support for bucket-specific edge creation, and simplify edge direction handling in tests.

Graph API Enhancements:

  • Added newLightEdge methods to MutableVertex for creating lightweight edges, including bidirectional edge validation. (engine/src/main/java/com/arcadedb/graph/MutableVertex.java)
  • Enhanced newEdge in RemoteVertex to support edge creation using bucket names, allowing dynamic edge type resolution based on bucket metadata. (network/src/main/java/com/arcadedb/remote/RemoteVertex.java)

Schema and Remote Database Updates:

  • Modified addBucket in RemoteDocumentType to allow adding buckets via SQL commands, enabling schema reload for updated types. (network/src/main/java/com/arcadedb/remote/RemoteDocumentType.java)
  • Updated createBucket and getTypeByBucketName in RemoteSchema to support bucket creation and type retrieval using SQL commands. (network/src/main/java/com/arcadedb/remote/RemoteSchema.java) [1] [2]

Test Improvements:

  • Refactored edge direction handling in tests by replacing Vertex.DIRECTION enum references with static imports, simplifying assertions and edge-related operations. (server/src/test/java/com/arcadedb/remote/RemoteDatabaseIT.java, server/src/test/java/com/arcadedb/remote/RemoteDatabaseJavaApiIT.java) [1] [2]
  • Added a new test case to validate edge creation on a specific bucket, ensuring proper schema and bucket integration. (server/src/test/java/com/arcadedb/remote/RemoteDatabaseJavaApiIT.java)

@robfrank robfrank added this to the 25.7.1 milestone Jul 16, 2025
@robfrank robfrank requested review from gramian and lvca July 16, 2025 08:08
@robfrank robfrank self-assigned this Jul 16, 2025
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.

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 significantly enhances the remote database API by improving edge creation capabilities, particularly by allowing edges to be created directly into specified buckets. It also refines schema handling for remote document types and buckets, making schema operations more robust and fully functional. The changes are supported by updated and new test cases.

Highlights

  • Enhanced Edge Creation: I've introduced support for creating edges directly into specific buckets by allowing a 'bucket:' prefix in the edge type string. This enables more granular control over edge storage. Additionally, I've added @Override annotations to newEdge and newLightEdge methods in MutableVertex for improved code clarity and maintainability.
  • Improved Remote Schema Operations: I've enhanced the remote schema handling by implementing addBucket in RemoteDocumentType to execute SQL ALTER TYPE commands, allowing buckets to be added to document types remotely. Similarly, RemoteSchema now correctly implements createBucket to execute SQL CREATE BUCKET and return a proper RemoteBucket instance, and getTypeByBucketName to retrieve document types by bucket name via SQL queries.
  • Test Suite Refinements: I've refactored existing test cases in RemoteDatabaseIT and RemoteDatabaseJavaApiIT to use static imports for the Vertex.DIRECTION enum, making the code more concise and readable. Crucially, I've added a new test case in RemoteDatabaseJavaApiIT to thoroughly validate the new bucket-specific edge creation functionality.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

@robfrank robfrank force-pushed the fix/1578-remote-mutable-edge branch from 773fbb5 to da8ae37 Compare July 16, 2025 08:10
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 introduces enhancements to the graph and remote database APIs, with updates to edge creation, schema handling, and test cases. I have identified a few areas with potential for improvement, particularly concerning correctness and code clarity, such as a potential NullPointerException and a bug in SQL query construction.

@codacy-production
Copy link

codacy-production bot commented Jul 16, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 7fc08a41 55.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7fc08a4) Report Missing Report Missing Report Missing
Head commit (212e209) 70593 45408 64.32%

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 (#2351) 20 11 55.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

Footnotes

  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.

@lvca lvca added the bug label Jul 16, 2025
@robfrank robfrank merged commit 169191f into main Jul 17, 2025
16 of 19 checks passed
robfrank added a commit that referenced this pull request Aug 21, 2025
@robfrank robfrank deleted the fix/1578-remote-mutable-edge branch January 14, 2026 16:05
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.

2 participants