Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra Connection String Changes #3585

Merged
merged 18 commits into from
Apr 11, 2024
Merged

Conversation

aditydha
Copy link
Contributor

@aditydha aditydha commented Apr 5, 2024

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Summary by CodeRabbit

  • New Features
    • Introduced SSL support for secure Cassandra database connections.
  • Bug Fixes
    • Improved resource management by ensuring proper disposal of session and cluster objects in Cassandra connections.

Copy link
Contributor

coderabbitai bot commented Apr 5, 2024

Walkthrough

The recent updates enhance security and functionality in database interactions within the Ginger software framework. SSL support is now available for Cassandra connections, ensuring secure communication. Additionally, the Couchbase interaction logic has been refined to handle case sensitivity in SQL queries more effectively.

Changes

File Path Change Summary
.../NoSqlBase/GingerCassandra.cs Introduced SSL support for secure Cassandra connections and added a method for SSL configuration.
.../NoSqlBase/GingerCouchbase.cs Adjusted logic for extracting bucket names from SQL queries, focusing on case sensitivity.

🐰✨
In the land of code and byte,
Secure connections take their flight.
With SSL, our data's tight,
And queries tuned just right.
Cheers to devs, by day and night! 🌟
🐰


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6839511 and 810b051.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (4 hunks)
Additional Context Used
GitHub Check Runs (1)
Codacy Static Code Analysis action_required (1)

Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs: [notice] 78-78: Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs#L78
'sender' is not used. Use discard parameter instead.

@digvijayAMDX digvijayAMDX self-requested a review April 5, 2024 14:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 810b051 and 554c606.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 554c606 and 419e38d.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (4 hunks)
Additional Context Used
GitHub Check Runs (1)
Codacy Static Code Analysis action_required (1)

Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs: [notice] 64-64: Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs#L64
'certificate' is not used. Use discard parameter instead.

Additional comments not posted (2)
Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (2)

47-48: Consider using a more descriptive variable name for queryTimeoutString and sslString.

While the current names are not incorrect, using names like queryTimeoutParam and sslParam could provide clearer context that these strings are used as parameters in the connection string.


231-231: Ensure resources are released in a finally block to guarantee execution.

Consider enclosing resource disposal within a try block followed by a finally block to ensure that resources are always released, even if an exception occurs. This enhances the robustness of resource management.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 419e38d and 1a08980.
Files selected for processing (2)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs

Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1a08980 and 65088c2.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 65088c2 and 49253bd.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs

Copy link
Contributor

@digvijayAMDX digvijayAMDX left a comment

Choose a reason for hiding this comment

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

Approved for Cassandra DB.
For Couchbase
lets define constants for storing "update " and " from " strings and then refer them in code like, IndexOf("strUpdate") + strUpdate.Length so that in future if we want to change the value to be compared it will be just a single place change

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 49253bd and 1d3a9fe.
Files selected for processing (2)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCouchbase.cs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1d3a9fe and 9ac26e8.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9ac26e8 and 1f3a061.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
Additional Context Used
GitHub Check Runs (1)
Codacy Static Code Analysis action_required (2)

Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs: [failure] 56-56: Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs#L56
Add a 'default' clause to this 'switch' statement.


Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs: [notice] 56-56: Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs#L56
Replace this 'switch' statement with 'if' statements to increase readability.

Additional comments not posted (4)
Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (4)

49-72: Consider adding a default case to the switch statement for handling unexpected cases gracefully. Additionally, replacing the switch statement with if statements could enhance readability.


49-73: The handling of query timeout and SSL parameters in the connection string is robust and follows best practices.


73-108: The logic for creating the cluster connection with or without SSL options is correctly implemented.


131-132: The error logging in the Connect method is clear and informative, aiding in troubleshooting connection issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1f3a061 and 33705e5.
Files selected for processing (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Ginger/GingerCoreNET/Database/NoSqlBase/GingerCassandra.cs

@Maheshkale447
Copy link
Contributor

@digvijayAMDX please review the changes

Copy link
Contributor

@digvijayAMDX digvijayAMDX left a comment

Choose a reason for hiding this comment

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

Please merge the changes

@aditydha aditydha merged commit 8686624 into Releases/Beta Apr 11, 2024
8 of 9 checks passed
@aditydha aditydha deleted the BugFix/DatabaseIssues branch April 11, 2024 09:07
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.

3 participants