Skip to content

fix(database-integrations): update apiIntegrationSchema to allow nullish values for optional fields - #453

Merged
tkislan merged 4 commits into
mainfrom
tk/fix-api-integrations-schema
Aug 12, 2026
Merged

fix(database-integrations): update apiIntegrationSchema to allow nullish values for optional fields#453
tkislan merged 4 commits into
mainfrom
tk/fix-api-integrations-schema

Conversation

@tkislan

@tkislan tkislan commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved integration metadata handling by allowing certain fields to be omitted or explicitly set to null.
    • Prevented malformed integration endpoint URLs when the API base URL includes a trailing slash.
    • Added request timeouts to improve reliability when retrieving integrations.
    • Preserved compatibility when integration visibility, timestamps, or federated authentication details are unavailable.
    • Improved request handling to prevent integrations from waiting indefinitely when the service is unresponsive.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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: 00e5033b-7e3f-4f09-97ef-3ef212e3af6b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b2b3f6 and 99680a4.

📒 Files selected for processing (1)
  • packages/database-integrations/src/loading/fetch-integrations.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/database-integrations/src/loading/fetch-integrations.test.ts

📝 Walkthrough

Walkthrough

The integration schema now permits omitted or null values for four metadata fields. API base URLs now normalize trailing slashes before endpoint construction. Integration requests now use a 30-second abort timeout. Tests cover the abort signal and normalized endpoint.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

  • deepnote/deepnote#394: Both PRs modify the integration fetch loader, with this PR extending the extracted logic to support nullable metadata, timeouts, and URL normalization.
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Updates Docs ⚠️ Warning The PR changes only two source/test files; no OSS documentation changed, and no deepnote-internal roadmap checkout or reference is available. Update the relevant deepnote/deepnote documentation and remind the owner to update the roadmap in the private deepnote-internal repository.
✅ 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 identifies the primary change: allowing nullish values for optional fields in apiIntegrationSchema.
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.

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

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.24%. Comparing base (847ddc4) to head (09e39b6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #453   +/-   ##
=======================================
  Coverage   88.23%   88.24%           
=======================================
  Files         191      191           
  Lines       10688    10691    +3     
  Branches     2993     3077   +84     
=======================================
+ Hits         9431     9434    +3     
  Misses       1255     1255           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 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.

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

🧹 Nitpick comments (1)
packages/database-integrations/src/loading/fetch-integrations.ts (1)

13-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add nullish regression cases.

The supplied tests populate all four fields. Add cases that omit each field and set each field to null. This protects the intended contract for is_public, created_at, updated_at, and federated_auth_method.

🤖 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 `@packages/database-integrations/src/loading/fetch-integrations.ts` around
lines 13 - 16, Add regression tests for the schema fields is_public, created_at,
updated_at, and federated_auth_method, covering both omission and explicit null
values for each. Keep the existing populated-field cases and verify all eight
nullish inputs are accepted.
🤖 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 `@packages/database-integrations/src/loading/fetch-integrations.ts`:
- Around line 13-16: Add regression tests for the schema fields is_public,
created_at, updated_at, and federated_auth_method, covering both omission and
explicit null values for each. Keep the existing populated-field cases and
verify all eight nullish inputs are accepted.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 38e1c215-c60a-4a42-b3db-54e82bd9ad27

📥 Commits

Reviewing files that changed from the base of the PR and between 0ea255d and d73deee.

📒 Files selected for processing (1)
  • packages/database-integrations/src/loading/fetch-integrations.ts

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 11, 2026
`fetchIntegrations` concatenated the base URL without normalizing, so a
`--url` with a trailing slash produced a double-slashed path that gateways
answer with an unexplained 404. The fetch also had no `AbortSignal`, unlike
every other API client in the monorepo, so a stalled API hung `deepnote run`
and `integrations pull` indefinitely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ZoxDFVdqrAaa8EWfaVhFH

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

🧹 Nitpick comments (2)
packages/database-integrations/src/loading/fetch-integrations.ts (1)

13-16: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add tests for nullish metadata.

The provided test changes do not exercise this schema change. Add cases where each field is omitted and where each field is null. Assert that fetchIntegrations accepts both responses.

As per coding guidelines, tests must cover new features and edge cases.

🤖 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 `@packages/database-integrations/src/loading/fetch-integrations.ts` around
lines 13 - 16, Add tests for fetchIntegrations covering the nullable metadata
fields is_public, created_at, updated_at, and federated_auth_method: verify
responses with each field omitted and with each field set to null are accepted
by the schema.

Source: Coding guidelines

packages/database-integrations/src/loading/fetch-integrations.test.ts (1)

52-54: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the 30-second timeout.

expect.any(AbortSignal) only proves that a signal exists. It does not detect an incorrect timeout value or an unbounded signal. Spy on AbortSignal.timeout and assert 30_000, or assert that the captured signal aborts after 30 seconds.

As per coding guidelines, tests must cover new features and edge cases.

🤖 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 `@packages/database-integrations/src/loading/fetch-integrations.test.ts` around
lines 52 - 54, Update the test around the fetch call and its signal assertion to
verify the 30-second timeout, not merely that an AbortSignal exists. Spy on
AbortSignal.timeout and assert it is called with 30_000, or validate that the
captured signal aborts after 30 seconds while preserving the existing fetch
expectations.

Source: Coding guidelines

🤖 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 `@packages/database-integrations/src/loading/fetch-integrations.test.ts`:
- Around line 52-54: Update the test around the fetch call and its signal
assertion to verify the 30-second timeout, not merely that an AbortSignal
exists. Spy on AbortSignal.timeout and assert it is called with 30_000, or
validate that the captured signal aborts after 30 seconds while preserving the
existing fetch expectations.

In `@packages/database-integrations/src/loading/fetch-integrations.ts`:
- Around line 13-16: Add tests for fetchIntegrations covering the nullable
metadata fields is_public, created_at, updated_at, and federated_auth_method:
verify responses with each field omitted and with each field set to null are
accepted by the schema.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a348894c-03c2-4c4e-a944-bf03e79a45c4

📥 Commits

Reviewing files that changed from the base of the PR and between d73deee and 4b2b3f6.

📒 Files selected for processing (2)
  • packages/database-integrations/src/loading/fetch-integrations.test.ts
  • packages/database-integrations/src/loading/fetch-integrations.ts

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 11, 2026
@tkislan
tkislan marked this pull request as ready for review August 12, 2026 08:04
@tkislan
tkislan requested a review from a team as a code owner August 12, 2026 08:04
@tkislan
tkislan merged commit 1a2baed into main Aug 12, 2026
38 of 39 checks passed
@tkislan
tkislan deleted the tk/fix-api-integrations-schema branch August 12, 2026 13:08
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