Skip to content

feat: Enhance multi-cloud support in mesh configuration#1298

Merged
piyushKumar-1 merged 1 commit into
mainfrom
backend/enabling-find-all-to-multicloud
May 27, 2026
Merged

feat: Enhance multi-cloud support in mesh configuration#1298
piyushKumar-1 merged 1 commit into
mainfrom
backend/enabling-find-all-to-multicloud

Conversation

@vijaygupta18
Copy link
Copy Markdown
Member

@vijaygupta18 vijaygupta18 commented May 20, 2026

  • Introduced enableFindAllForMultiCloud option in Tables type to control findAll query behavior across multiple clouds.
  • Refactored setMeshConfig and setMeshConfigForFindAll to utilize the new Tables configuration for improved handling of Redis settings.
  • Updated comments for clarity on the impact of multi-cloud settings on findAll queries.

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

  • New Features

    • Added an optional configuration to enable multi-cloud read behavior for broad data retrieval.
  • Improvements

    • Schema-aware configuration selection and validation for mesh and storage options.
    • Multi-cloud enabling for data retrieval now respects both global and per-table flags; secondary-cloud read defaults clarified.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Review limit reached

@vijaygupta18, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 950b5969-7ea8-4c42-baa0-33fd13847015

📥 Commits

Reviewing files that changed from the base of the PR and between c4ed194 and 91e8347.

📒 Files selected for processing (2)
  • lib/mobility-core/src/Kernel/Beam/Functions.hs
  • lib/mobility-core/src/Kernel/Types/Common.hs

Walkthrough

Adds two optional multi-cloud flags to Tables and refactors Beam mesh configuration to load and validate Tables once, compute schema-aware Redis/KV/DB settings, and enable secondary Redis for general and findAll flows based on runInMultiCloud or the new Tables.enableFindAllForMultiCloud flag.

Changes

Multi-cloud configuration and mesh refactoring

Layer / File(s) Summary
Tables configuration type extension
lib/mobility-core/src/Kernel/Types/Common.hs
Tables record gains enableFindAllForMultiCloud :: Maybe Bool and enableAllTablesForSecondaryCloudRead :: Maybe Bool; defaultTableData initializes the new flags to Nothing.
Mesh configuration refactoring with schema validation
lib/mobility-core/src/Kernel/Beam/Functions.hs
Import hides Tables from Kernel.Beam.Types. Documentation for runInMultiCloud clarifies findAll scope. Adds setMeshConfigWithTables and getTablesOption to centralize schema resolution and derive Redis stream/TTL/prefix/sharding and secondaryRedisEnabled from Tables; setMeshConfig delegates to the helper. setMeshConfigForFindAll enables secondary Redis when runInMultiCloud is active OR Tables.enableFindAllForMultiCloud == Just True.

Estimated code review effort:
🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs:

"I'm a rabbit in the mesh, nibbling flags tonight,
Tables sprout options, Redis wakes alight.
Schemas checked once, streams find their tune,
Multi-cloud hops beneath the moon. 🐇✨"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enhancing multi-cloud support by adding configuration options and refactoring mesh configuration functions to handle findAll queries across multiple clouds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend/enabling-find-all-to-multicloud

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
lib/mobility-core/src/Kernel/Beam/Functions.hs (1)

170-170: 💤 Low value

Minor: Error message references wrong function name.

The error message says "Schema not found in setMeshConfig" but this is in setMeshConfigWithTables. Consider updating for accurate debugging:

-  schema <- maybe (L.throwException $ InternalError "Schema not found in setMeshConfig") pure mSchema
+  schema <- maybe (L.throwException $ InternalError "Schema not found in setMeshConfigWithTables") pure mSchema
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/mobility-core/src/Kernel/Beam/Functions.hs` at line 170, The error
message incorrectly names the function; update the InternalError message used in
the schema failure branch so it references setMeshConfigWithTables instead of
setMeshConfig—specifically modify the string passed to
L.throwException/InternalError in the expression that binds schema (the line
with schema <- maybe (L.throwException $ InternalError "Schema not found in
setMeshConfig") pure mSchema) to read "Schema not found in
setMeshConfigWithTables".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@lib/mobility-core/src/Kernel/Beam/Functions.hs`:
- Line 170: The error message incorrectly names the function; update the
InternalError message used in the schema failure branch so it references
setMeshConfigWithTables instead of setMeshConfig—specifically modify the string
passed to L.throwException/InternalError in the expression that binds schema
(the line with schema <- maybe (L.throwException $ InternalError "Schema not
found in setMeshConfig") pure mSchema) to read "Schema not found in
setMeshConfigWithTables".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 46cdd586-2db7-45d4-a95b-f6a87ed3a827

📥 Commits

Reviewing files that changed from the base of the PR and between 722b431 and 137b143.

📒 Files selected for processing (2)
  • lib/mobility-core/src/Kernel/Beam/Functions.hs
  • lib/mobility-core/src/Kernel/Types/Common.hs

@vijaygupta18 vijaygupta18 force-pushed the backend/enabling-find-all-to-multicloud branch from 137b143 to c4ed194 Compare May 27, 2026 16:01
Copy link
Copy Markdown

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/mobility-core/src/Kernel/Types/Common.hs (1)

88-103: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing field initializations will cause compilation failure.

The defaultTableData record is missing initializations for drainerTtlConfigs and enableFindAllForMultiCloud. With -Wall -Werror this will not compile.

🐛 Proposed fix
       enableSecondaryCloudRead = Nothing,
       tablesForSecondaryCloudRead = Nothing,
-      enableAllTablesForSecondaryCloudRead = Nothing
+      enableAllTablesForSecondaryCloudRead = Nothing,
+      drainerTtlConfigs = Nothing,
+      enableFindAllForMultiCloud = Nothing
     }

As per coding guidelines: "All code must compile without warnings under GHC flags -Wall -Werror".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/mobility-core/src/Kernel/Types/Common.hs` around lines 88 - 103, The
record defaultTableData (of type Tables) is missing initializers for
drainerTtlConfigs and enableFindAllForMultiCloud which breaks compilation;
update the defaultTableData definition to include those fields (e.g. add
drainerTtlConfigs = HM.empty and enableFindAllForMultiCloud = Nothing or the
correct default for its type) alongside the other record fields so the Tables
record is fully initialized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@lib/mobility-core/src/Kernel/Types/Common.hs`:
- Around line 88-103: The record defaultTableData (of type Tables) is missing
initializers for drainerTtlConfigs and enableFindAllForMultiCloud which breaks
compilation; update the defaultTableData definition to include those fields
(e.g. add drainerTtlConfigs = HM.empty and enableFindAllForMultiCloud = Nothing
or the correct default for its type) alongside the other record fields so the
Tables record is fully initialized.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 117646a6-d6f9-4fa3-a453-73647be5e13a

📥 Commits

Reviewing files that changed from the base of the PR and between 137b143 and c4ed194.

📒 Files selected for processing (2)
  • lib/mobility-core/src/Kernel/Beam/Functions.hs
  • lib/mobility-core/src/Kernel/Types/Common.hs

- Introduced `enableFindAllForMultiCloud` option in `Tables` type to control findAll query behavior across multiple clouds.
- Refactored `setMeshConfig` and `setMeshConfigForFindAll` to utilize the new `Tables` configuration for improved handling of Redis settings.
- Updated comments for clarity on the impact of multi-cloud settings on findAll queries.
@vijaygupta18 vijaygupta18 force-pushed the backend/enabling-find-all-to-multicloud branch from c4ed194 to 91e8347 Compare May 27, 2026 16:11
@piyushKumar-1 piyushKumar-1 merged commit 2d924ad into main May 27, 2026
2 checks passed
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