Skip to content

fix SqlAlchemyInput.ssh_options.enabled typing to properly disable SSH - #135

Merged
jankuca merged 1 commit into
mainfrom
jk/fix-sql-alchemy-ssh-enabled
Nov 10, 2025
Merged

jankuca merged 1 commit into
mainfrom
jk/fix-sql-alchemy-ssh-enabled

Conversation

@jankuca

@jankuca jankuca commented Nov 7, 2025 •

Copy link
Copy Markdown
Contributor

We did not extract the SSH part of the SQL Alchemy input logic correctly - the enabled flag should have a boolean value, not a stringified one. enabled: 'false' was leading to the following error:

Screenshot 2025-11-07 at 13 48 28

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed SSH configuration handling across all database integrations by correcting the enabled flag data type from string to boolean, ensuring proper type consistency and optimizing the configuration structure to only include SSH settings when actively enabled.

@coderabbitai

coderabbitai Bot commented Nov 7, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

SSH options representation refactored across database integrations. The ssh_options.enabled property changed from a string to a boolean type. When SSH is enabled, ssh_options now contains { enabled: true, host, port, user }; when disabled, it becomes an empty object. Type definitions and test expectations updated to match the boolean representation.

Possibly related PRs

Suggested reviewers

  • Artmann

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating SSH options typing from string to boolean in SqlAlchemyInput to properly disable SSH.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4c28c16 and 9f51f9a.

📒 Files selected for processing (3)
  • packages/database-integrations/src/database-integration-env-vars.test.ts (11 hunks)
  • packages/database-integrations/src/database-integration-env-vars.ts (8 hunks)
  • packages/database-integrations/src/sql-alchemy-types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/*/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

packages/*/src/**/*.{ts,tsx}: Use strict type checking and prefer type safety over convenience
Use const for immutable values
Avoid any; use proper type definitions and type guards

Files:

  • packages/database-integrations/src/sql-alchemy-types.ts
  • packages/database-integrations/src/database-integration-env-vars.test.ts
  • packages/database-integrations/src/database-integration-env-vars.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Follow Biome's lint rules as configured in biome.json
Use literal keys (dot notation) instead of bracket notation when possible
Prefer single quotes for strings (except when avoiding escapes)

Files:

  • packages/database-integrations/src/sql-alchemy-types.ts
  • packages/database-integrations/src/database-integration-env-vars.test.ts
  • packages/database-integrations/src/database-integration-env-vars.ts
packages/*/src/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Place source code under packages/*/src/

Files:

  • packages/database-integrations/src/sql-alchemy-types.ts
  • packages/database-integrations/src/database-integration-env-vars.test.ts
  • packages/database-integrations/src/database-integration-env-vars.ts
packages/*/src/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

packages/*/src/**/*.test.{ts,tsx}: Place test files next to the source files with .test.ts or .test.tsx extension
Use Vitest as the testing framework for all tests
Import { describe, expect, it } from 'vitest' in tests
Use dedent from ts-dedent for multiline string comparisons in tests
Follow existing test patterns (see packages/blocks/src/blocks/*.test.ts); write clear names, group with describe(), cover edge cases, errors, special characters, and verify exact output for code-generation functions

Files:

  • packages/database-integrations/src/database-integration-env-vars.test.ts
🔇 Additional comments (3)
packages/database-integrations/src/database-integration-env-vars.ts (1)

222-229: Consistent boolean implementation across all database types.

The pattern sshEnabled ? { enabled: true, ... } : {} is consistently applied across Databricks, Dremio, SQL Server, PostgreSQL/AlloyDB, Redshift, Materialize, ClickHouse, and MySQL variants. Clean approach—empty object when SSH disabled rather than enabled: false.

Also applies to: 252-259, 279-286, 331-338, 381-388, 449-456, 568-575, 695-702

packages/database-integrations/src/database-integration-env-vars.test.ts (1)

77-77: Test expectations correctly updated to boolean.

All SSH-enabled test cases across 11+ database types now expect enabled: true (boolean) instead of 'true' (string). Comprehensive coverage matches the implementation changes.

Also applies to: 600-600, 677-677, 746-746, 854-854, 1057-1057, 1258-1258, 1500-1500, 1659-1659, 1887-1887, 2372-2372

packages/database-integrations/src/sql-alchemy-types.ts (1)

9-9: Boolean type is correct; verify Python integration manually.

The TypeScript type change to boolean | undefined is appropriate. JSON serialization will correctly emit true/false values per JSON spec, not string representations.

However, this repository contains no Python code. The verification of whether your Python SQLAlchemy consumer correctly handles boolean values (vs. expecting string "true"/"false") must be done outside this codebase. Check that the Python integration accepts native boolean types in the ssh_options configuration.


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

@codecov

codecov Bot commented Nov 7, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.41%. Comparing base (4c28c16) to head (9f51f9a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   95.31%   95.41%   +0.10%     
==========================================
  Files          26       26              
  Lines         726      742      +16     
  Branches      210      223      +13     
==========================================
+ Hits          692      708      +16     
  Misses         34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jankuca
jankuca marked this pull request as ready for review November 7, 2025 12:51
@jankuca
jankuca requested a review from a team as a code owner November 7, 2025 12:51
@dinohamzic
dinohamzic self-requested a review November 7, 2025 13:10

@dinohamzic dinohamzic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. 👌

@jankuca
jankuca enabled auto-merge (squash) November 7, 2025 13:42
@jankuca
jankuca merged commit ef6f1ea into main Nov 10, 2025
@jankuca
jankuca deleted the jk/fix-sql-alchemy-ssh-enabled branch November 10, 2025 07:50
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