-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8311 serverless function functions can be executed with any input #8380
8311 serverless function functions can be executed with any input #8380
Conversation
…ecuted-with-any-input
e8fcbba
to
9a5232e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR updates the serverless function input schema handling to be more flexible and maintainable. Here's a concise summary of the key changes:
- Replaced ts-morph dependency with native TypeScript compiler API for code introspection and schema generation
- Added new recursive
InputSchema
type system supporting nested objects, arrays, and enums - Changed serverless function handler from
handler(event, context)
tomain(params)
for simpler interface - Updated
WorkflowEditActionFormServerlessFunction
component to handle nested input schemas with path-based access - Added
getDefaultFunctionInputFromInputSchema
utility to generate default values based on schema types
Key points to review:
- Early returns in
serverless-function-publication.listener.ts
could skip processing remaining events in batch - Use of
any
type inFunctionInput
reduces type safety - Consider adding more test cases for
getDefaultFunctionInputFromInputSchema
to cover edge cases - Verify error handling in local driver with new input schema format
21 file(s) reviewed, 21 comment(s)
Edit PR Review Bot Settings | Greptile
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Outdated
Show resolved
Hide resolved
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Outdated
Show resolved
Hide resolved
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Show resolved
Hide resolved
...es/twenty-server/src/modules/workflow/workflow-executor/types/workflow-step-settings.type.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will take time before this gets robust. But looks this is a huge step already. Congrats @martmull 💪
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Outdated
Show resolved
Hide resolved
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Outdated
Show resolved
Hide resolved
...es/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Show resolved
Hide resolved
packages/twenty-server/src/modules/code-introspection/code-introspection.service.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, @martmull! We can merge.
...es/twenty-server/src/modules/code-introspection/__tests__/code-introspection.service.spec.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just spot an any
type that could be replaced with a more specific type.
t.mov
TODO