Skip to content

Conversation

@maparent
Copy link
Collaborator

@maparent maparent commented Sep 11, 2025

https://linear.app/discourse-graphs/issue/ENG-850/fail-gracefully-when-no-database-is-available

Summary by CodeRabbit

  • Bug Fixes

    • Improved stability when database configuration or session is missing; related features now fail gracefully instead of crashing.
    • Search now returns no results when logged out, avoiding errors.
    • Sync and embedding operations safely skip when the database is unavailable, reducing unexpected failures.
  • Chores

    • Streamlined environment setup and build workflow to improve reliability across local and development runs.

@linear
Copy link

linear bot commented Sep 11, 2025

@supabase
Copy link

supabase bot commented Sep 11, 2025

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@maparent maparent requested a review from mdroidian September 11, 2025 23:15
@maparent
Copy link
Collaborator Author

@CodeRabbit review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@maparent maparent force-pushed the eng-850-fail-gracefully-when-no-database-is-available branch from 3aa88f6 to 749679f Compare September 11, 2025 23:20
@maparent
Copy link
Collaborator Author

@CodeRabbit sorry force-pushed a new version, restart the review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

@maparent I'll restart the review for the updated PR after your force-push.

✅ Actions performed

Full review triggered.

Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

Note that this PR contains some of the same changes as #431
(turbo.json, package.json, etc)

"process.env.SUPABASE_ANON_KEY": `"${dbEnv.SUPABASE_ANON_KEY}"`,
"process.env.SUPABASE_URL": dbEnv.SUPABASE_URL
? `"${dbEnv.SUPABASE_URL}"`
: "null",
Copy link
Contributor

Choose a reason for hiding this comment

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

this won't trigger (!url | !key) in client.ts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

but it does; realize that the "null" string will be bare once substituted.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Caution

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bed3ec2 and 3aa88f6.

📒 Files selected for processing (10)
  • apps/roam/scripts/compile.ts (1 hunks)
  • apps/roam/src/utils/hyde.ts (1 hunks)
  • apps/roam/src/utils/supabaseContext.ts (2 hunks)
  • apps/roam/src/utils/syncDgNodesToSupabase.ts (4 hunks)
  • packages/database/package.json (1 hunks)
  • packages/database/scripts/createEnv.mts (4 hunks)
  • packages/database/src/lib/client.ts (1 hunks)
  • packages/ui/package.json (2 hunks)
  • packages/utils/package.json (1 hunks)
  • turbo.json (2 hunks)
🧰 Additional context used
🧠 Learnings (10)
📚 Learning: 2025-08-27T02:23:45.696Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#377
File: packages/ui/tsconfig.json:5-7
Timestamp: 2025-08-27T02:23:45.696Z
Learning: Don't assume package structure or suggest main/types entries in package.json without verifying the files exist. UI packages and component libraries may not have a single main entry point and can be designed to export components individually or through subpath exports.

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to apps/website/**/*.{tsx,jsx,ts,js} : Use Tailwind CSS for styling where possible

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Prettier with the project's configuration

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-08-31T17:37:17.173Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#400
File: packages/database/src/dbDotEnv.js:24-31
Timestamp: 2025-08-31T17:37:17.173Z
Learning: The "all" variant for SUPABASE_USE_DB should only be used in createEnv.mts and not in the dbDotEnv module. It was incorrectly added to dbDotEnv.d.ts but should be removed to maintain proper separation of concerns.

Applied to files:

  • apps/roam/scripts/compile.ts
  • packages/database/scripts/createEnv.mts
📚 Learning: 2025-07-08T14:51:55.299Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-08T14:51:55.299Z
Learning: DiscourseGraphs maintainers prefer not to add narrowly typed definitions for individual `process.env` keys to avoid unnecessary coupling.

Applied to files:

  • apps/roam/scripts/compile.ts
📚 Learning: 2025-07-22T01:50:20.253Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-22T01:50:20.253Z
Learning: In packages/database/scripts/create_env.ts, the Vercel CLI integration uses both vercel/sdk for deployment queries and vercel CLI for environment variable pulling, with support for different variants (local, branch, production, all) and proper team/project configuration with discourse-graphs defaults.

Applied to files:

  • packages/database/scripts/createEnv.mts
📚 Learning: 2025-05-22T23:48:45.450Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#165
File: packages/database/scripts/deploy.ts:0-0
Timestamp: 2025-05-22T23:48:45.450Z
Learning: The database deployment script in packages/database/scripts/deploy.ts requires that the branch is 'main' and pristine (no uncommitted or unpushed changes) before allowing deployment to proceed.

Applied to files:

  • packages/database/scripts/createEnv.mts
📚 Learning: 2025-06-25T18:03:52.669Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.

Applied to files:

  • packages/database/package.json
📚 Learning: 2025-07-13T16:47:14.352Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-13T16:47:14.352Z
Learning: In the discourse-graph codebase, types.gen.ts contains automatically generated database function type definitions that may have reordered signatures between versions. This reordering is expected behavior from the code generation process and should not be flagged as an issue requiring fixes.

Applied to files:

  • packages/database/package.json
📚 Learning: 2025-07-08T14:48:38.048Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#272
File: packages/ui/src/lib/supabase/contextFunctions.ts:50-111
Timestamp: 2025-07-08T14:48:38.048Z
Learning: The Supabase client does not offer transaction support, so idempotent upserts with proper conflict resolution (using onConflict with ignoreDuplicates: false) are the preferred approach for multi-step database operations in packages/ui/src/lib/supabase/contextFunctions.ts. This pattern prevents orphaned records when retrying operations.

Applied to files:

  • apps/roam/src/utils/syncDgNodesToSupabase.ts
🪛 GitHub Actions: PR - Roam To Blob Storage
packages/database/src/lib/client.ts

[error] 1-1: Build failed: 'npm run build' exited with code 2.

packages/database/scripts/createEnv.mts

[error] 1-1: Build failed: 'npm run build' exited with code 2.

packages/database/package.json

[error] 1-1: Build failed: 'npm run build' exited with code 2.

📝 Walkthrough

Walkthrough

The PR introduces nullable Supabase client handling across Roam utilities, adjusts Roam compile-time env defines to allow nulls, refactors database env-generation workflow and Turbo tasks, and shifts multiple packages’ exports to reference TypeScript sources. It also changes the database client factory to return null instead of throwing when env vars are missing.

Changes

Cohort / File(s) Summary of changes
Roam env compile defines
apps/roam/scripts/compile.ts
SUPABASE_URL and SUPABASE_ANON_KEY defines now conditionally resolve to quoted strings or null; other defines unchanged.
Roam Supabase nullability and guards
apps/roam/src/utils/hyde.ts, apps/roam/src/utils/supabaseContext.ts, apps/roam/src/utils/syncDgNodesToSupabase.ts
Added early returns when Supabase client/context is unavailable; getLoggedInClient now returns DGSupabaseClient | null; exceptions replaced with null-based flow; guarded RPC calls and sync functions to avoid null dereferencing.
Database env orchestration
packages/database/scripts/createEnv.mts, turbo.json
Reworked createEnv script with Variant enum, Vercel/CI guards, modular main(), branch/production env writers; added Turbo genenv task; build/dev tasks depend on genenv; added roam#dev and website#dev passthroughs.
Database client API
packages/database/src/lib/client.ts
createClient now returns DGSupabaseClient | null; on missing env, logs error and returns null instead of throwing.
Database package exports and build scripts
packages/database/package.json
Exports switched from dist artifacts to TS sources (./src/...); simplified typesVersions; updated scripts (check-types no-emit; build runs createEnv then tsc; new build-schema sequence).
UI package exports
packages/ui/package.json
Exports now point to TS sources for lib/hooks/components; check-types switches to no-emit.
Utils package exports
packages/utils/package.json
Exports flattened to ./src/*.ts; removed typesVersions; check-types switches to no-emit.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App as Roam App
  participant Ctx as supabaseContext
  participant DB as database/lib/client

  User->>App: Trigger operation (search/sync)
  App->>Ctx: getLoggedInClient()
  Ctx->>DB: createClient()
  alt Env vars present
    DB-->>Ctx: DGSupabaseClient
  else Missing env vars
    DB-->>Ctx: null
  end
  alt Client available
    Ctx-->>App: client
    App->>Ctx: getSupabaseContext(client)
    alt Context available
      Ctx-->>App: context
      App->>DB: RPC / operations
      DB-->>App: result
    else Context null
      Ctx-->>App: null
      App-->>User: Early return (no-op/empty result)
    end
  else No client
    Ctx-->>App: null
    App-->>User: Early return (no-op/empty result)
  end
Loading
sequenceDiagram
  autonumber
  participant Turbo as Turbo genenv
  participant Env as packages/database/scripts/createEnv.mts
  participant Vercel as Vercel API

  Turbo->>Env: run (variant from CLI/SUPABASE_USE_DB)
  Env->>Env: Detect CI/Vercel, resolve Variant
  alt CI/Vercel or Variant none
    Env-->>Turbo: Exit early
  else Local/Branch/Production
    Env->>Env: getVercelToken()
    Env->>Vercel: Initialize client
    alt Variant branch or all
      Env->>Vercel: Query branch deployments
      Vercel-->>Env: Preview env vars
      Env->>Env: Write .env.branch
    end
    alt Variant production or all
      Env->>Vercel: Get latest production deployment
      Vercel-->>Env: Production env vars
      Env->>Env: Write .env.production
    end
    Env-->>Turbo: Done (.env*)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Pre-merge checks (3 passed)

✅ 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 "ENG-850 Fail gracefully when no database is available" succinctly and accurately captures the PR’s primary change: adding defensive null-checks/early returns and converting throws to nullable returns when the Supabase/database client is missing, as shown across the listed files (client creation, supabase context, and roam utilities). It is specific, on-topic, and concise enough for a reviewer scanning history to understand the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@maparent maparent changed the base branch from main to eng-847-temp-fix-compile-roam-against-database-ts-to-get-env-vars September 11, 2025 23:40
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Caution

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bed3ec2 and 749679f.

📒 Files selected for processing (11)
  • apps/roam/scripts/compile.ts (1 hunks)
  • apps/roam/src/utils/hyde.ts (1 hunks)
  • apps/roam/src/utils/supabaseContext.ts (2 hunks)
  • apps/roam/src/utils/syncDgNodesToSupabase.ts (4 hunks)
  • packages/database/package.json (1 hunks)
  • packages/database/scripts/createEnv.mts (4 hunks)
  • packages/database/src/lib/client.ts (1 hunks)
  • packages/database/src/lib/contextFunctions.ts (3 hunks)
  • packages/ui/package.json (2 hunks)
  • packages/utils/package.json (1 hunks)
  • turbo.json (2 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#400
File: packages/database/src/dbDotEnv.js:24-31
Timestamp: 2025-08-31T17:37:17.173Z
Learning: The "all" variant for SUPABASE_USE_DB should only be used in createEnv.mts and not in the dbDotEnv module. It was incorrectly added to dbDotEnv.d.ts but should be removed to maintain proper separation of concerns.
📚 Learning: 2025-08-27T02:23:45.696Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#377
File: packages/ui/tsconfig.json:5-7
Timestamp: 2025-08-27T02:23:45.696Z
Learning: Don't assume package structure or suggest main/types entries in package.json without verifying the files exist. UI packages and component libraries may not have a single main entry point and can be designed to export components individually or through subpath exports.

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to apps/website/**/*.{tsx,jsx,ts,js} : Use Tailwind CSS for styling where possible

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-07-19T22:34:08.725Z
Learnt from: CR
PR: DiscourseGraphs/discourse-graph#0
File: .cursor/rules/main.mdc:0-0
Timestamp: 2025-07-19T22:34:08.725Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Prettier with the project's configuration

Applied to files:

  • packages/ui/package.json
📚 Learning: 2025-07-08T14:48:38.048Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#272
File: packages/ui/src/lib/supabase/contextFunctions.ts:50-111
Timestamp: 2025-07-08T14:48:38.048Z
Learning: The Supabase client does not offer transaction support, so idempotent upserts with proper conflict resolution (using onConflict with ignoreDuplicates: false) are the preferred approach for multi-step database operations in packages/ui/src/lib/supabase/contextFunctions.ts. This pattern prevents orphaned records when retrying operations.

Applied to files:

  • apps/roam/src/utils/syncDgNodesToSupabase.ts
📚 Learning: 2025-08-31T17:37:17.173Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#400
File: packages/database/src/dbDotEnv.js:24-31
Timestamp: 2025-08-31T17:37:17.173Z
Learning: The "all" variant for SUPABASE_USE_DB should only be used in createEnv.mts and not in the dbDotEnv module. It was incorrectly added to dbDotEnv.d.ts but should be removed to maintain proper separation of concerns.

Applied to files:

  • apps/roam/scripts/compile.ts
  • packages/database/scripts/createEnv.mts
📚 Learning: 2025-07-08T14:51:55.299Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-08T14:51:55.299Z
Learning: DiscourseGraphs maintainers prefer not to add narrowly typed definitions for individual `process.env` keys to avoid unnecessary coupling.

Applied to files:

  • apps/roam/scripts/compile.ts
📚 Learning: 2025-06-25T18:03:52.669Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#241
File: packages/database/tsconfig.json:3-7
Timestamp: 2025-06-25T18:03:52.669Z
Learning: The packages/database directory in the discourse-graph repository has a unique structure as a database schema/migration package. It contains doc/, scripts/, supabase/ directories and TypeScript files at the root level, but no typical src/, test/, dist/, or node_modules directories. The current tsconfig.json with "include": ["."] and "exclude": ["supabase"] is appropriate for this structure.

Applied to files:

  • packages/database/package.json
📚 Learning: 2025-07-13T16:47:14.352Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-13T16:47:14.352Z
Learning: In the discourse-graph codebase, types.gen.ts contains automatically generated database function type definitions that may have reordered signatures between versions. This reordering is expected behavior from the code generation process and should not be flagged as an issue requiring fixes.

Applied to files:

  • packages/database/package.json
📚 Learning: 2025-07-22T01:50:20.253Z
Learnt from: maparent
PR: DiscourseGraphs/discourse-graph#0
File: :0-0
Timestamp: 2025-07-22T01:50:20.253Z
Learning: In packages/database/scripts/create_env.ts, the Vercel CLI integration uses both vercel/sdk for deployment queries and vercel CLI for environment variable pulling, with support for different variants (local, branch, production, all) and proper team/project configuration with discourse-graphs defaults.

Applied to files:

  • packages/database/scripts/createEnv.mts
📝 Walkthrough

Walkthrough

Updates introduce nullable Supabase client handling across Roam and database libs, add early-return guards in callers, and adjust esbuild defines to inject null for missing Supabase env vars. Database build/dev tooling is reworked: env generation script becomes a structured CLI, Turbo tasks add a genenv pipeline, and package exports shift from dist outputs to TS sources in multiple packages.

Changes

Cohort / File(s) Summary
Roam build defines
apps/roam/scripts/compile.ts
Esbuild define now injects null for missing SUPABASE_URL/ANON_KEY instead of strings; other defines unchanged.
Roam Supabase nullability guards
apps/roam/src/utils/hyde.ts, apps/roam/src/utils/supabaseContext.ts, apps/roam/src/utils/syncDgNodesToSupabase.ts
Propagate nullable client: getLoggedInClient now returns Promise<client
Database client/context
packages/database/src/lib/client.ts, packages/database/src/lib/contextFunctions.ts
createClient returns client
Database env tooling and build
packages/database/package.json, packages/database/scripts/createEnv.mts, turbo.json
Export map points to TS sources; build/check scripts updated; createEnv.mts refactored to enum-driven CLI with token fetching and early returns; Turbo adds genenv task and adjusts build/dev dependsOn to genenv.
UI package exports
packages/ui/package.json
Exports remapped from dist objects to TS sources; check-types switches to noEmit.
Utils package exports
packages/utils/package.json
Exports collapsed to TS source glob; typesVersions removed; check-types switches to noEmit.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant RoamCaller as Roam Caller (hyde/sync)
  participant SupaCtx as getLoggedInClient
  participant DBClient as database/lib/createClient
  participant Supabase as Supabase API

  User->>RoamCaller: invoke feature
  RoamCaller->>SupaCtx: getLoggedInClient()
  SupaCtx->>DBClient: createClient()
  alt Env OK
    DBClient-->>SupaCtx: client
    SupaCtx-->>RoamCaller: client
    RoamCaller->>Supabase: proceed with RPC/queries
    Supabase-->>RoamCaller: result
  else Missing env / no session
    DBClient-->>SupaCtx: null
    SupaCtx-->>RoamCaller: null
    RoamCaller-->>User: early return ([], no-op)
  end
  note over RoamCaller,SupaCtx: Exceptions replaced with nullable returns and guards
Loading
sequenceDiagram
  autonumber
  actor Dev
  participant Turbo as Turbo(genenv/build/dev)
  participant CreateEnv as packages/database/scripts/createEnv.mts
  participant Vercel as Vercel API

  Dev->>Turbo: run build/dev
  Turbo->>CreateEnv: genenv (variant from CLI/env)
  alt Vercel/GitHub CI
    CreateEnv-->>Turbo: skip (early return)
  else local/branch/prod
    CreateEnv->>CreateEnv: getVercelToken() (lazy)
    opt branch/prod/all
      CreateEnv->>Vercel: env pull (token)
      Vercel-->>CreateEnv: .env files
    end
    opt local/all
      CreateEnv->>CreateEnv: makeLocalEnv
    end
    CreateEnv-->>Turbo: .env outputs
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Pre-merge checks (3 passed)

✅ 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 "ENG-850 Fail gracefully when no database is available" succinctly and accurately summarizes the primary intent of the changeset (introducing nullability and early-return guards when the Supabase client or env is missing). It is concise, specific, and appropriate for a reviewer scanning PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Base automatically changed from eng-847-temp-fix-compile-roam-against-database-ts-to-get-env-vars to main September 11, 2025 23:56
@maparent maparent force-pushed the eng-850-fail-gracefully-when-no-database-is-available branch from 749679f to 4576257 Compare September 11, 2025 23:59
@maparent maparent merged commit 2afb249 into main Sep 12, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this to Done in General Sep 12, 2025
@maparent maparent deleted the eng-850-fail-gracefully-when-no-database-is-available branch September 12, 2025 00:00
trangdoan982 pushed a commit that referenced this pull request Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants