Skip to content

Conversation

@nicktrn
Copy link
Collaborator

@nicktrn nicktrn commented Nov 28, 2025

SKIP_CLICKHOUSE_MIGRATIONS=1 to disable

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2025

⚠️ No Changeset found

Latest commit: 80d7f25

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

The change modifies the ClickHouse migration logic in the entrypoint script. It introduces a conditional guard that prevents ClickHouse migrations from running unless CLICKHOUSE_URL is set and SKIP_CLICKHOUSE_MIGRATIONS is not "1". When the skip flag is enabled, a skip message is emitted. Additionally, the script now includes robust GOOSE_DBSTRING construction logic that ensures secure=true is appended to the ClickHouse connection string, with handling for three scenarios: when secure= already exists in the URL, when query parameters are present, or when no query parameters exist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • URL manipulation logic for appending secure=true with multiple conditional branches—verify the string concatenation patterns handle all cases correctly
  • Environment variable flag logic (CLICKHOUSE_URL and SKIP_CLICKHOUSE_MIGRATIONS)—ensure the conditional precedence is intentional and correct
  • Skip message emission—confirm the output format and placement are appropriate for the logging context

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and incomplete. It lacks required sections from the template including Closes reference, checklist, testing details, detailed changelog, and screenshots. Complete the PR description by filling in the template sections: add issue reference (Closes #), complete the checklist items, describe testing steps, provide detailed changelog, and add screenshots if applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding an option to optionally disable ClickHouse migrations, which matches the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch optionally-disable-ch-migrations

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@nicktrn nicktrn merged commit 485782c into main Nov 28, 2025
27 of 28 checks passed
@nicktrn nicktrn deleted the optionally-disable-ch-migrations branch November 28, 2025 19:39
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

🧹 Nitpick comments (2)
docker/scripts/entrypoint.sh (2)

18-28: GOOSE_DBSTRING construction is solid, with minor robustness suggestions.

The logic correctly appends secure=true while respecting existing parameter configurations. Consider these optional improvements for maximum robustness:

  1. Use anchored grep pattern to avoid false positives in unlikely but possible edge cases (e.g., my_secure_param=value):

    - if echo "$CLICKHOUSE_URL" | grep -q "secure="; then
    + if echo "$CLICKHOUSE_URL" | grep -qE '(^|[?&])secure='; then
  2. Add URL validation (optional): Verify CLICKHOUSE_URL is well-formed before string manipulation, especially if this runs in varied environments.


33-34: Skip message is functional but could be more informative.

The message confirms the skip flag is active but doesn't indicate context (e.g., development environment, testing, one-off deployment). Consider adding brief context to help operators understand why migrations were skipped.

- echo "SKIP_CLICKHOUSE_MIGRATIONS=1, skipping ClickHouse migrations."
+ echo "SKIP_CLICKHOUSE_MIGRATIONS=1, skipping ClickHouse migrations. (Running in no-migration mode)"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61b338b and 80d7f25.

📒 Files selected for processing (1)
  • docker/scripts/entrypoint.sh (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
docker/scripts/entrypoint.sh (1)

13-13: Conditional logic and control flow look correct.

The added condition properly gates migrations based on both CLICKHOUSE_URL presence and the skip flag. The elif/else branches correctly handle all cases: running migrations, skipping explicitly, and skipping when URL is absent. Backward compatibility is maintained since migrations run by default (only skipped when explicitly requested).

Also applies to: 33-37

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.

4 participants