Add natural language pipeline builder with cron/stage generation#81
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
1d9a645
into
codex/fix-remaining-issues-and-raise-pr
| ...(generatedPlan | ||
| ? { | ||
| schedule: { | ||
| cron: generatedPlan.cron, | ||
| timezone: generatedPlan.timezone, | ||
| }, | ||
| stage_config: generatedPlan.stages, | ||
| generated_from_prompt: generatedPlan.config.generatedFromPrompt, | ||
| } | ||
| : {}), |
There was a problem hiding this comment.
🟡 Stale generatedPlan included in submission payload after user edits stages
When a user generates a plan and then manually edits the stages (adding, removing, or renaming), the generatedPlan state is never cleared or updated. On form submission, the payload includes stage_config: generatedPlan.stages (line 72) which contains the original generated stages, while config.stages (lines 62-65) contains the user's edited stages. This creates a data inconsistency in the persisted pipeline config.
Root Cause and Impact
The generatedPlan state is set in handleGenerateFromPrompt (src/components/modals/CreatePipelineModal.tsx:101-102) but is never cleared when the user subsequently edits the form fields via handleStageChange, handleAddStage, or handleRemoveStage.
For example:
- User generates a plan →
generatedPlan.stages=[{name: 'Fetch from S3', ...}, {name: 'Load to PostgreSQL', ...}] - User removes 'Fetch from S3' and adds 'Read from API' manually
- User submits → payload
configcontains:stages: [{name: 'Read from API', order: 0}, {name: 'Load to PostgreSQL', order: 1}](user's edits)stage_config: [{name: 'Fetch from S3', ...}, {name: 'Load to PostgreSQL', ...}](stale generated data)
Any downstream code that reads stage_config will see stages that don't match the actual pipeline stages, leading to potential confusion or incorrect behavior.
Prompt for agents
In src/components/modals/CreatePipelineModal.tsx, clear the generatedPlan state whenever the user manually modifies the form after a plan has been generated. Add setGeneratedPlan(null) calls inside handleStageChange (around line 34), handleAddStage (around line 26), and handleRemoveStage (around line 30). This ensures that stale generated metadata is not included in the submission payload when the user has manually diverged from the generated plan.
Was this helpful? React with 👍 or 👎 to provide feedback.
Motivation
Description
src/lib/nlPipelineBuilder.tsthat parses a natural language prompt to infer a cron schedule, human-readable schedule, pipeline name/description, and stage configurations (source/transform/destination).src/components/modals/CreatePipelineModal.tsx) by adding a prompt textarea,Generate Planbutton, preview panel, and logic to populate the form with the generated plan.configincludesschedule,stage_config, andgenerated_from_promptwhen a plan is generated from NL input.UTCand included a human-readable schedule string in the preview output.Testing
npm run buildwhich completed successfully and produced a production build.npm run lintwhich completed successfully (the repo retains unrelated pre-existing ESLint warnings that are unchanged by this PR).Codex Task