Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR bumps package versions from 0.1.302 to 0.1.303 across core packages and templates, and extends the bubble flow execution schema by adding an exported Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Deploying bubblelab-documentation with
|
| Latest commit: |
fd304e1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ea877653.bubblelab-documentation.pages.dev |
| Branch Preview URL: | https://history-enhances.bubblelab-documentation.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bubble-shared-schemas/src/bubbleflow-execution-schema.ts`:
- Around line 183-193: The exported MAX_EXECUTION_NAME_LENGTH is defined but not
enforced: update bubbleFlowExecutionSchema to apply
.max(MAX_EXECUTION_NAME_LENGTH) on the name field and add openapi metadata
maxLength: MAX_EXECUTION_NAME_LENGTH; next add a nullable VARCHAR/TEXT `name`
column to the bubbleFlowExecutions table via a new migration that preserves
existing rows and indexes; implement a PATCH handler (e.g., route that updates
execution name by id) that validates input against the same
MAX_EXECUTION_NAME_LENGTH (use the shared schema) and persists to the new
column, and add unit/integration tests for the migration, schema validation, and
PATCH behavior; finally run pnpm build:core to regenerate types after changing
the shared schema.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4c15c17a-28e7-42f8-982d-724b904ebc3c
📒 Files selected for processing (8)
packages/bubble-core/package.jsonpackages/bubble-runtime/package.jsonpackages/bubble-scope-manager/package.jsonpackages/bubble-shared-schemas/package.jsonpackages/bubble-shared-schemas/src/bubbleflow-execution-schema.tspackages/create-bubblelab-app/package.jsonpackages/create-bubblelab-app/templates/basic/package.jsonpackages/create-bubblelab-app/templates/reddit-scraper/package.json
| // Max length for user-assigned execution labels. Shared between the PATCH | ||
| // request schema, the DB-agnostic response schema, and the frontend input | ||
| // maxLength attribute so the three sides can't drift apart. | ||
| export const MAX_EXECUTION_NAME_LENGTH = 120; | ||
|
|
||
| // BubbleFlow execution history item schema | ||
| export const bubbleFlowExecutionSchema = z.object({ | ||
| id: z.number().openapi({ description: 'Execution ID' }), | ||
| name: z.string().nullable().optional().openapi({ | ||
| description: 'User-assigned label for this execution (checkpoint name)', | ||
| }), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Read-only checks for execution-name persistence and generated/shared-schema updates.
set -euo pipefail
echo "DB schemas / migrations mentioning bubble_flow_executions or execution name:"
rg -n -C3 \
'bubble_flow_executions|bubbleFlowExecutions|\bname\b' \
--glob '!node_modules/**' \
--glob '!dist/**' \
--glob '!build/**'
echo
echo "API handlers or schemas using MAX_EXECUTION_NAME_LENGTH / execution name:"
rg -n -C3 \
'MAX_EXECUTION_NAME_LENGTH|execution.*name|name.*execution' \
--glob '!node_modules/**' \
--glob '!dist/**' \
--glob '!build/**'Repository: bubblelabai/BubbleLab
Length of output: 50379
🏁 Script executed:
# Check the actual schema definition for bubble_flow_executions
cat -n apps/bubblelab-api/src/db/schema-postgres.ts | head -120Repository: bubblelabai/BubbleLab
Length of output: 5823
🏁 Script executed:
# Search for PATCH schema and MAX_EXECUTION_NAME_LENGTH usage
rg -n "MAX_EXECUTION_NAME_LENGTH" --type ts --type tsx -A 3 -B 1Repository: bubblelabai/BubbleLab
Length of output: 92
🏁 Script executed:
# Check for PATCH endpoint schema
rg -n "PATCH|patch" apps/bubblelab-api/src --type ts --type tsx -A 5 -B 1 | head -100Repository: bubblelabai/BubbleLab
Length of output: 92
🏁 Script executed:
# Check for any drizzle migrations that might add the name column
fd -e sql -e ts . apps/bubblelab-api/drizzle-postgres | head -20Repository: bubblelabai/BubbleLab
Length of output: 1175
🏁 Script executed:
# Check if pnpm build:core was part of the PR or recently run
git log --oneline --all -20 2>/dev/null | grep -i "build:core\|shared.*schema" || echo "Git history not available"Repository: bubblelabai/BubbleLab
Length of output: 90
🏁 Script executed:
# Check latest migrations for name column addition
cat apps/bubblelab-api/drizzle-postgres/0017_cuddly_kang.sqlRepository: bubblelabai/BubbleLab
Length of output: 441
🏁 Script executed:
# Also check 0016
cat apps/bubblelab-api/drizzle-postgres/0016_add-evaluations-and-execution-logs.sqlRepository: bubblelabai/BubbleLab
Length of output: 989
🏁 Script executed:
# Search for MAX_EXECUTION_NAME_LENGTH more carefully
rg "MAX_EXECUTION_NAME_LENGTH" -n -A 3 -B 1Repository: bubblelabai/BubbleLab
Length of output: 618
🏁 Script executed:
# Search for PATCH endpoints in API
rg "PATCH|patch.*execut" -n -A 5 -B 2 --glob="apps/bubblelab-api/src/**"Repository: bubblelabai/BubbleLab
Length of output: 5361
🏁 Script executed:
# Check if build:core is in package.json scripts
cat package.json | grep -A 20 '"scripts"'Repository: bubblelabai/BubbleLab
Length of output: 2295
🏁 Script executed:
# Read the complete bubbleflow-execution-schema.ts to see the full name field definition
cat packages/bubble-shared-schemas/src/bubbleflow-execution-schema.ts | head -220Repository: bubblelabai/BubbleLab
Length of output: 7551
🏁 Script executed:
# Also check if there are any execution name PATCH handlers elsewhere
rg -n "execution.*name\|patch.*execution" apps/bubblelab-api/src --glob="**/*.ts" -B 2 -A 5Repository: bubblelabai/BubbleLab
Length of output: 47
🏁 Script executed:
# Check the dist output of shared-schemas to see if build:core was run
ls -la packages/bubble-shared-schemas/dist/ 2>/dev/null | head -20Repository: bubblelabai/BubbleLab
Length of output: 47
Wire MAX_EXECUTION_NAME_LENGTH into the schema and back the execution name with persistence, API handler, and migration.
The shared response schema adds a name field for execution labels, but three critical pieces are missing:
-
Unenforced max length:
MAX_EXECUTION_NAME_LENGTHis exported (line 186) but not applied to thenamefield. The schema should enforce.max(MAX_EXECUTION_NAME_LENGTH)and includemaxLengthin OpenAPI metadata. -
Missing DB column and migration: The
bubbleFlowExecutionstable has nonamecolumn, and no migration adds it. Execution labels cannot persist without backing storage. -
No PATCH endpoint: No API handler exists to update execution names. A PATCH endpoint must accept and validate the execution name against
MAX_EXECUTION_NAME_LENGTH.
Also, per coding guidelines, run pnpm build:core after modifying shared schemas to regenerate types.
Schema fix: apply max length constraint
- name: z.string().nullable().optional().openapi({
- description: 'User-assigned label for this execution (checkpoint name)',
- }),
+ name: z
+ .string()
+ .max(MAX_EXECUTION_NAME_LENGTH)
+ .nullable()
+ .optional()
+ .openapi({
+ description: 'User-assigned label for this execution (checkpoint name)',
+ maxLength: MAX_EXECUTION_NAME_LENGTH,
+ }),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Max length for user-assigned execution labels. Shared between the PATCH | |
| // request schema, the DB-agnostic response schema, and the frontend input | |
| // maxLength attribute so the three sides can't drift apart. | |
| export const MAX_EXECUTION_NAME_LENGTH = 120; | |
| // BubbleFlow execution history item schema | |
| export const bubbleFlowExecutionSchema = z.object({ | |
| id: z.number().openapi({ description: 'Execution ID' }), | |
| name: z.string().nullable().optional().openapi({ | |
| description: 'User-assigned label for this execution (checkpoint name)', | |
| }), | |
| // Max length for user-assigned execution labels. Shared between the PATCH | |
| // request schema, the DB-agnostic response schema, and the frontend input | |
| // maxLength attribute so the three sides can't drift apart. | |
| export const MAX_EXECUTION_NAME_LENGTH = 120; | |
| // BubbleFlow execution history item schema | |
| export const bubbleFlowExecutionSchema = z.object({ | |
| id: z.number().openapi({ description: 'Execution ID' }), | |
| name: z | |
| .string() | |
| .max(MAX_EXECUTION_NAME_LENGTH) | |
| .nullable() | |
| .optional() | |
| .openapi({ | |
| description: 'User-assigned label for this execution (checkpoint name)', | |
| maxLength: MAX_EXECUTION_NAME_LENGTH, | |
| }), |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/bubble-shared-schemas/src/bubbleflow-execution-schema.ts` around
lines 183 - 193, The exported MAX_EXECUTION_NAME_LENGTH is defined but not
enforced: update bubbleFlowExecutionSchema to apply
.max(MAX_EXECUTION_NAME_LENGTH) on the name field and add openapi metadata
maxLength: MAX_EXECUTION_NAME_LENGTH; next add a nullable VARCHAR/TEXT `name`
column to the bubbleFlowExecutions table via a new migration that preserves
existing rows and indexes; implement a PATCH handler (e.g., route that updates
execution name by id) that validates input against the same
MAX_EXECUTION_NAME_LENGTH (use the shared schema) and persists to the new
column, and add unit/integration tests for the migration, schema validation, and
PATCH behavior; finally run pnpm build:core to regenerate types after changing
the shared schema.
67dda3f to
fd304e1
Compare
Summary
Related Issues
Type of Change
Checklist
pnpm checkand all tests passScreenshots (Required)
For New Bubble Integrations
.integration.flow.ts) covers all operationsAdditional Context
Summary by CodeRabbit
New Features
Chores