fix(manual): mock payloads nested recursion#4037
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview This results in generated mock payloads that better match deeply nested trigger output schemas during manual/external trigger execution. Reviewed by Cursor Bugbot for commit 4f8b70b. Configure here. |
Greptile SummaryThis PR fixes incorrect mock payload generation for nested structures during manual workflow execution. The Key changes:
Confidence Score: 5/5Safe to merge — the fix is a targeted, well-guarded extension of the existing recursive mock-generation logic with no regressions to existing branches. All remaining findings from prior review rounds are P2 or already resolved (the tuple-items guard concern was dismissed by the senior dev; the test-coverage gap was already flagged). The new code is logically correct, bounded by No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/workflows/triggers/trigger-utils.ts | Adds two new recursive branches to processOutputField to correctly expand JSON-Schema-style properties (objects/JSON) and items (arrays) into realistic mock values; logic is sound and protected by the existing maxDepth guard. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[processOutputField key, field, depth] --> B{depth > maxDepth?}
B -- yes --> C[return null]
B -- no --> D{field has 'type' string?}
D -- no --> E{field is plain object?}
E -- yes --> F[Recurse into each key]
E -- no --> G[return null]
D -- yes --> H{type is 'object'/'json' AND has properties?}
H -- yes --> I[NEW: Iterate properties, recurse each nestedField]
I --> J[return nestedObject Record]
H -- no --> K{type is 'array' AND has items object?}
K -- yes --> L[NEW: Recurse on items schema]
L --> M[return itemValue array]
K -- no --> N[generateMockValue type, description, key]
N --> O[return primitive/generic mock]
Reviews (2): Last reviewed commit: "fix(manual): mock payloads nested recurs..." | Re-trigger Greptile
|
@greptile |
|
@cursor review |
|
Tip: Greploops — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4f8b70b. Configure here.
Summary
Manual execs had incorrect mock payloads for nested structures.
Type of Change
Testing
Tested manually
Checklist