Rename serverlessFunction to logicFunction#17494
Conversation
Greptile OverviewGreptile SummaryThis PR completes the cleanup after PR #17488, which merged the separate trigger entities ( Key Changes
NoteThe PR title "Rename serverlessFunction to logicFunction" does not accurately describe the changes. The actual work removes references to obsolete trigger types as a follow-up to the trigger consolidation in PR #17488. No renaming of Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant PR as PR #17488
participant Meta as Metadata System
participant Cache as Workspace Cache
participant Orch as Migration Orchestrator
Note over Dev,Orch: Previous PR #17488: Merged triggers into ServerlessFunction
PR->>Meta: Add trigger settings to ServerlessFunctionEntity
PR->>Meta: Remove CronTriggerEntity, DatabaseEventTriggerEntity, RouteTriggerEntity
Note over Dev,Orch: Current PR #17494: Cleanup metadata references
Dev->>Meta: Remove cronTrigger from ALL_METADATA_NAME
Dev->>Meta: Remove databaseEventTrigger from ALL_METADATA_NAME
Dev->>Meta: Remove routeTrigger from ALL_METADATA_NAME
Meta->>Meta: Remove trigger types from all-flat-entity-properties-to-compare-and-stringify.constant.ts
Meta->>Meta: Remove trigger types from all-metadata-entity-by-metadata-name.constant.ts
Meta->>Meta: Remove trigger types from all-metadata-relations.constant.ts
Meta->>Meta: Remove trigger types from all-metadata-required-metadata-for-validation.constant.ts
Meta->>Meta: Remove trigger types from all-flat-entity-types-by-metadata-name.ts
Cache->>Cache: Remove flatCronTriggerMaps cache key
Cache->>Cache: Remove flatDatabaseEventTriggerMaps cache key
Cache->>Cache: Remove flatRouteTriggerMaps cache key
Orch->>Orch: Remove cronTrigger actions (create/update/delete)
Orch->>Orch: Remove databaseEventTrigger actions (create/update/delete)
Orch->>Orch: Remove routeTrigger actions (create/update/delete)
Note over Meta: Test snapshots updated to reflect removal
|
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:4793 This environment will automatically shut down when the PR is closed or after 5 hours. |
.../twenty-server/src/engine/metadata-modules/logic-function/jobs/logic-function-trigger.job.ts
Show resolved
Hide resolved
...space-manager/workspace-migration/services/workspace-migration-build-orchestrator.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/metadata-modules/logic-function/logic-function.service.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
1 issue found across 78 files (changes from recent commits).
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-server/src/engine/metadata-modules/logic-function/logic-function.resolver.ts">
<violation number="1" location="packages/twenty-server/src/engine/metadata-modules/logic-function/logic-function.resolver.ts:240">
P1: Subscription payload key mismatch: resolver expects logicFunctionLogs but publisher still sends serverlessFunctionLogs, so logic function log events will be filtered out and never delivered.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| @Subscription(() => LogicFunctionLogsDTO, { | ||
| filter: ( | ||
| payload: { logicFunctionLogs: LogicFunctionLogsDTO }, |
There was a problem hiding this comment.
P1: Subscription payload key mismatch: resolver expects logicFunctionLogs but publisher still sends serverlessFunctionLogs, so logic function log events will be filtered out and never delivered.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-server/src/engine/metadata-modules/logic-function/logic-function.resolver.ts, line 240:
<comment>Subscription payload key mismatch: resolver expects logicFunctionLogs but publisher still sends serverlessFunctionLogs, so logic function log events will be filtered out and never delivered.</comment>
<file context>
@@ -237,17 +237,17 @@ export class LogicFunctionResolver {
@Subscription(() => LogicFunctionLogsDTO, {
filter: (
- payload: { serverlessFunctionLogs: LogicFunctionLogsDTO },
+ payload: { logicFunctionLogs: LogicFunctionLogsDTO },
variables: { input: LogicFunctionLogsInput },
) => {
</file context>
There was a problem hiding this comment.
2 issues found across 23 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionTestTab.tsx">
<violation number="1" location="packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionTestTab.tsx:42">
P2: Parsing editor input with `JSON.parse` on every change can throw on partial/invalid JSON and crash the test tab. Guard the parse and keep the previous input when parsing fails.</violation>
</file>
<file name="packages/twenty-front/src/modules/settings/serverless-functions/hooks/useGetOneServerlessFunction.ts">
<violation number="1" location="packages/twenty-front/src/modules/settings/serverless-functions/hooks/useGetOneServerlessFunction.ts:10">
P2: Renaming the hook export to `useGetOneLogicFunction` without updating existing mocks/imports (e.g., useServerlessFunctionUpdateFormState.test.ts still mocks `useGetOneServerlessFunction`) will cause module export/mocking failures. Update the consumers to the new export name or provide a backward-compatible export alias.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| setLogicFunctionTestData((prev) => ({ | ||
| ...prev, | ||
| input: JSON.parse(newInput), | ||
| })); |
There was a problem hiding this comment.
P2: Parsing editor input with JSON.parse on every change can throw on partial/invalid JSON and crash the test tab. Guard the parse and keep the previous input when parsing fails.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/settings/serverless-functions/components/tabs/SettingsServerlessFunctionTestTab.tsx, line 42:
<comment>Parsing editor input with `JSON.parse` on every change can throw on partial/invalid JSON and crash the test tab. Guard the parse and keep the previous input when parsing fails.</comment>
<file context>
@@ -20,27 +23,29 @@ const StyledCodeEditorContainer = styled.div`
const onChange = (newInput: string) => {
- setServerlessFunctionTestData((prev) => ({
+ setLogicFunctionTestData((prev) => ({
...prev,
input: JSON.parse(newInput),
</file context>
| setLogicFunctionTestData((prev) => ({ | |
| ...prev, | |
| input: JSON.parse(newInput), | |
| })); | |
| setLogicFunctionTestData((prev) => { | |
| try { | |
| return { | |
| ...prev, | |
| input: JSON.parse(newInput), | |
| }; | |
| } catch { | |
| return prev; | |
| } | |
| }); |
| } from '~/generated-metadata/graphql'; | ||
|
|
||
| export const useGetOneServerlessFunction = ({ | ||
| export const useGetOneLogicFunction = ({ |
There was a problem hiding this comment.
P2: Renaming the hook export to useGetOneLogicFunction without updating existing mocks/imports (e.g., useServerlessFunctionUpdateFormState.test.ts still mocks useGetOneServerlessFunction) will cause module export/mocking failures. Update the consumers to the new export name or provide a backward-compatible export alias.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/settings/serverless-functions/hooks/useGetOneServerlessFunction.ts, line 10:
<comment>Renaming the hook export to `useGetOneLogicFunction` without updating existing mocks/imports (e.g., useServerlessFunctionUpdateFormState.test.ts still mocks `useGetOneServerlessFunction`) will cause module export/mocking failures. Update the consumers to the new export name or provide a backward-compatible export alias.</comment>
<file context>
@@ -7,7 +7,7 @@ import {
} from '~/generated-metadata/graphql';
-export const useGetOneServerlessFunction = ({
+export const useGetOneLogicFunction = ({
id,
onCompleted,
</file context>
There was a problem hiding this comment.
1 issue found across 87 files (changes from recent commits).
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts">
<violation number="1" location="packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts:467">
P2: `LOGIC_FUNCTION_LOGS_ENABLED` is only typed as `false` and never initialized, so it defaults to `undefined` at runtime instead of `false`. Set a default value the same way other boolean config fields do.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }) | ||
| @IsOptional() | ||
| SERVERLESS_LOGS_ENABLED: false; | ||
| LOGIC_FUNCTION_LOGS_ENABLED: false; |
There was a problem hiding this comment.
P2: LOGIC_FUNCTION_LOGS_ENABLED is only typed as false and never initialized, so it defaults to undefined at runtime instead of false. Set a default value the same way other boolean config fields do.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts, line 467:
<comment>`LOGIC_FUNCTION_LOGS_ENABLED` is only typed as `false` and never initialized, so it defaults to `undefined` at runtime instead of `false`. Set a default value the same way other boolean config fields do.</comment>
<file context>
@@ -446,27 +446,28 @@ export class ConfigVariables {
})
@IsOptional()
- SERVERLESS_LOGS_ENABLED: false;
+ LOGIC_FUNCTION_LOGS_ENABLED: false;
@ConfigVariablesMetadata({
</file context>
| LOGIC_FUNCTION_LOGS_ENABLED: false; | |
| LOGIC_FUNCTION_LOGS_ENABLED = false; |
…ogic-function-executor - Rename serverless-functions module to logic-functions across frontend - Rename function-executor core module to logic-function-executor in server - Update all related types, services, and imports - Update documentation references
# Conflicts: # packages/twenty-docs/developers/extend/capabilities/apps.mdx # packages/twenty-sdk/README.md # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/af-ZA.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ar-SA.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ca-ES.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/cs-CZ.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/da-DK.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/de-DE.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/el-GR.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/en.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/es-ES.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/fi-FI.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/fr-FR.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/he-IL.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/hu-HU.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/it-IT.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ja-JP.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ko-KR.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/nl-NL.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/no-NO.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/pl-PL.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/pt-BR.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/pt-PT.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ro-RO.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/ru-RU.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/sr-Cyrl.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/sv-SE.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/tr-TR.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/uk-UA.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/vi-VN.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/zh-CN.ts # packages/twenty-server/src/engine/core-modules/i18n/locales/generated/zh-TW.ts
d1513d6 to
fc8d9c1
Compare
There was a problem hiding this comment.
1 issue found across 16 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-sdk/src/cli/__tests__/e2e/constants/testConfig.ts">
<violation number="1" location="packages/twenty-sdk/src/cli/__tests__/e2e/constants/testConfig.ts:6">
P2: Avoid committing API keys/tokens in source. Even in test configs, hardcoded credentials can leak; load from an environment variable or test secret fixture instead.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| apiUrl: 'http://localhost:3000', | ||
| apiKey: | ||
| 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC1lNmI1LTQ2ODAtOGEzMi1iODIwOTczNzE1NmIiLCJ1c2VySWQiOiIyMDIwMjAyMC1lNmI1LTQ2ODAtOGEzMi1iODIwOTczNzE1NmIiLCJ3b3Jrc3BhY2VJZCI6IjIwMjAyMDIwLTFjMjUtNGQwMi1iZjI1LTZhZWNjZjdlYTQxOSIsIndvcmtzcGFjZU1lbWJlcklkIjoiMjAyMDIwMjAtNDYzZi00MzViLTgyOGMtMTA3ZTAwN2EyNzExIiwidXNlcldvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWU3Yy00M2Q5LWE1ZGItNjg1YjUwNjlkODE2IiwidHlwZSI6IkFDQ0VTUyIsImF1dGhQcm92aWRlciI6InBhc3N3b3JkIiwiaWF0IjoxNzUxMjgxNzA0LCJleHAiOjIwNjY4NTc3MDR9.HMGqCsVlOAPVUBhKSGlD1X86VoHKt4LIUtET3CGIdik', | ||
| 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzY5NTU4MjgyLCJleHAiOjQ5MjMxNTgyODEsImp0aSI6ImE4YWE4MjMwLWI3ZjYtNDM0OC1hM2VhLWVkNjBlN2VhNTgwOCJ9.5cjOZIHI67rJUACRap75qDWdx02OEo3xUXIn-I_46bk', |
There was a problem hiding this comment.
P2: Avoid committing API keys/tokens in source. Even in test configs, hardcoded credentials can leak; load from an environment variable or test secret fixture instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/e2e/constants/testConfig.ts, line 6:
<comment>Avoid committing API keys/tokens in source. Even in test configs, hardcoded credentials can leak; load from an environment variable or test secret fixture instead.</comment>
<file context>
@@ -3,5 +3,5 @@ import { type TwentyConfig } from '@/cli/utilities/config/config-service';
apiUrl: 'http://localhost:3000',
apiKey:
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC1lNmI1LTQ2ODAtOGEzMi1iODIwOTczNzE1NmIiLCJ1c2VySWQiOiIyMDIwMjAyM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hLWVkNjBlN2VhNTgwOCJ9.5cjOZIHI67rJUACRap75qDWdx02OEo3xUXIn-I_46bk', | |
| process.env.TWENTY_TEST_API_KEY ?? '', |
There was a problem hiding this comment.
1 issue found across 5 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-sdk/vitest.e2e.config.ts">
<violation number="1" location="packages/twenty-sdk/vitest.e2e.config.ts:15">
P2: Setting `include: []` disables all e2e tests, so the suite will no longer run. If the intent is to temporarily skip flaky tests, consider keeping the include pattern and using `test.skip` or a conditional filter in CI instead, so coverage isn’t silently lost.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__e2e__/applications-install-delete-reinstall.e2e-spec.ts">
<violation number="1" location="packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__e2e__/applications-install-delete-reinstall.e2e-spec.ts:11">
P2: Switching the suite to xdescribe skips all tests in this file, so the install/delete/reinstall coverage won’t execute. Use describe so the re-enabled tests actually run.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| inspect.defaultOptions.depth = 10; | ||
|
|
||
| describe('Application: install delete and reinstall rich-app', () => { | ||
| xdescribe('Application: install delete and reinstall rich-app', () => { |
There was a problem hiding this comment.
P2: Switching the suite to xdescribe skips all tests in this file, so the install/delete/reinstall coverage won’t execute. Use describe so the re-enabled tests actually run.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__e2e__/applications-install-delete-reinstall.e2e-spec.ts, line 11:
<comment>Switching the suite to xdescribe skips all tests in this file, so the install/delete/reinstall coverage won’t execute. Use describe so the re-enabled tests actually run.</comment>
<file context>
@@ -8,7 +8,7 @@ import { inspect } from 'util';
inspect.defaultOptions.depth = 10;
-describe('Application: install delete and reinstall rich-app', () => {
+xdescribe('Application: install delete and reinstall rich-app', () => {
const applicationName = 'rich-app';
const deleteCommand = new AppUninstallCommand();
</file context>
| xdescribe('Application: install delete and reinstall rich-app', () => { | |
| describe('Application: install delete and reinstall rich-app', () => { |
Summary
Rename "Serverless Function" to "Logic Function" across the codebase for clearer naming.
Environment Variable Changes
SERVERLESS_TYPELOGIC_FUNCTION_TYPESERVERLESS_LAMBDA_REGIONLOGIC_FUNCTION_LAMBDA_REGIONSERVERLESS_LAMBDA_ROLELOGIC_FUNCTION_LAMBDA_ROLESERVERLESS_LAMBDA_SUBHOSTING_URLLOGIC_FUNCTION_LAMBDA_SUBHOSTING_URLSERVERLESS_LAMBDA_ACCESS_KEY_IDLOGIC_FUNCTION_LAMBDA_ACCESS_KEY_IDSERVERLESS_LAMBDA_SECRET_ACCESS_KEYLOGIC_FUNCTION_LAMBDA_SECRET_ACCESS_KEYBreaking Changes
serverlessFunction→logicFunctiontables