Skip to content

feat: Add a data importer for bringing cloud data into onPrem - #44

Merged
twk3 merged 3 commits into
mainfrom
feat/data-importer
Jul 28, 2026
Merged

feat: Add a data importer for bringing cloud data into onPrem#44
twk3 merged 3 commits into
mainfrom
feat/data-importer

Conversation

@twk3

@twk3 twk3 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Currents support is able to create an export of Org data and make it available for import to onPrem

Summary by CodeRabbit

  • New Features
    • Added an optional “toolbox” pod and PVC for one-off organization data import workflows (disabled by default), with persistent scratch storage and configurable resources/scheduling.
    • Introduced a ClickHouse restore mode setting that conditionally enables restore-specific environment behavior to suppress change-stream-driven ClickHouse sync during restores.
  • Documentation
    • Added a Cloud → self-hosted organization data migration guide covering import modes and restore/maintenance steps.
    • Linked the new migration guide from the Resources overview.

Currents support is able to create an export of Org data and make it available for import to onPrem
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a004f127-d7b0-4c11-a7ec-895b37dbd848

📥 Commits

Reviewing files that changed from the base of the PR and between 03602cb and f075e65.

📒 Files selected for processing (3)
  • charts/currents/values.yaml
  • docs/configuration.md
  • docs/org-data-import.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • charts/currents/values.yaml
  • docs/configuration.md
  • docs/org-data-import.md

📝 Walkthrough

Walkthrough

Adds an optional Helm-managed toolbox pod and retained PVC for Cloud-to-self-hosted organization imports. Introduces ClickHouse restore-mode configuration, propagates it to changestreams and toolbox environments, and documents import, incremental migration, recovery, configuration, and troubleshooting procedures.

Changes

Organization data import

Layer / File(s) Summary
Restore mode configuration and changestream wiring
charts/currents/templates/_common.tpl, charts/currents/templates/changestreams/deployment.yaml, charts/currents/values.yaml
Adds the maintenance.clickhouseRestoreMode switch and renders CURRENTS_CLICKHOUSE_RESTORE_MODE=true in changestream containers when enabled.
Toolbox pod and persistent storage
charts/currents/templates/_helpers.tpl, charts/currents/templates/toolbox/*, charts/currents/values.yaml
Adds configurable toolbox settings, a manual sleep infinity pod with import environment and mounts, and a retained PVC for import state.
Import procedure and configuration documentation
docs/README.md, docs/org-data-import.md, docs/configuration.md
Documents toolbox and restore-mode configuration, fresh, merge, and incremental imports, recovery procedures, troubleshooting, and support information.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant Helm
  participant ToolboxPod
  participant MongoDB
  participant ClickHouse
  Operator->>Helm: Enable toolbox and ClickHouse restore mode
  Helm->>ToolboxPod: Render pod with import configuration
  Helm->>ToolboxPod: Mount persistent import state
  Operator->>ToolboxPod: Copy artifact and run currents-import
  ToolboxPod->>MongoDB: Restore and verify organization data
  ToolboxPod->>ClickHouse: Restore and verify ClickHouse data
Loading
🚥 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 clearly matches the main change: adding a cloud-to-on-prem data importer.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/data-importer

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

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

Inline comments:
In `@charts/currents/templates/changestreams/deployment.yaml`:
- Around line 50-53: Update the changestreams deployment env rendering around
clickhouseRestoreModeEnv so CURRENTS_CLICKHOUSE_RESTORE_MODE is emitted after
the concatenated global.env and changestreams.env entries, ensuring it remains
authoritative. Add or update the manifest test to verify the restore-mode
variable is last and overrides duplicate user-defined entries.

In `@charts/currents/templates/toolbox/pod.yaml`:
- Around line 29-34: Update the toolbox pod template near serviceAccountName to
set automountServiceAccountToken to false, preventing Kubernetes API credentials
from being mounted while retaining the existing chart service account.

In `@charts/currents/templates/toolbox/pvc.yaml`:
- Around line 20-23: The PVC retention policy in the toolbox chart must provide
a secure cleanup path for retained import data. Make helm.sh/resource-policy:
keep opt-in through an explicit configuration setting, or document and implement
deletion after successful import completion while preserving the PVC during
resumable or in-flight imports; ensure download.json, export artifacts, and
import state are not left indefinitely without an operator-controlled cleanup
path.

In `@docs/org-data-import.md`:
- Around line 172-181: Correct the fresh ClickHouse resume command in the
documentation by replacing the invalid kubectlexec invocation with kubectl -n
<ns> exec, preserving the existing POD reference and ch-import arguments.
- Around line 57-61: Update all commands in the org-data-import runbook to pass
the documented namespace parameter consistently: add --namespace &lt;ns&gt; to
both helm upgrade commands and -n &lt;ns&gt; to the toolbox get, cp, and exec
commands, including the referenced sections.
- Around line 63-67: Update the Helm command example in the artifact-import
documentation so the toolbox.persistence.size flag is included in the same
command before the final line continuation, or provide it as part of a separate
complete helm upgrade command; ensure no standalone shell token remains.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 19ad337b-5c5e-428c-98ea-3c9963e40794

📥 Commits

Reviewing files that changed from the base of the PR and between ae51929 and ef27443.

📒 Files selected for processing (8)
  • charts/currents/templates/_common.tpl
  • charts/currents/templates/_helpers.tpl
  • charts/currents/templates/changestreams/deployment.yaml
  • charts/currents/templates/toolbox/pod.yaml
  • charts/currents/templates/toolbox/pvc.yaml
  • charts/currents/values.yaml
  • docs/README.md
  • docs/org-data-import.md

Comment thread charts/currents/templates/changestreams/deployment.yaml
Comment thread charts/currents/templates/toolbox/pod.yaml
Comment thread charts/currents/templates/toolbox/pvc.yaml
Comment thread docs/org-data-import.md
Comment thread docs/org-data-import.md
Comment thread docs/org-data-import.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@docs/configuration.md`:
- Line 219: Update the toolbox.env description in the configuration table to say
it applies to “the toolbox container” instead of “both toolbox containers,”
matching the single container rendered by the chart.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9345bdc8-0ef8-45ae-b8ce-7cc6eb661b70

📥 Commits

Reviewing files that changed from the base of the PR and between ef27443 and 03602cb.

📒 Files selected for processing (1)
  • docs/configuration.md

Comment thread docs/configuration.md Outdated
- Updated the description for additional environment variables in the toolbox section of values.yaml and configuration.md for clarity.
- Corrected a syntax error in the org-data-import.md documentation for the kubectl exec command.
@twk3
twk3 merged commit 00cb7eb into main Jul 28, 2026
3 checks passed
@twk3
twk3 deleted the feat/data-importer branch July 28, 2026 23:27
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.

1 participant