Remove versions from logicFunction (#17540)
## Summary - Remove `latestVersion` and `publishedVersions` columns from `LogicFunction` entity - Remove version parameter from logic function execution, build, and source code retrieval - Update all related services, DTOs, utilities, and tests - Add database migration to drop the version columns
This commit is contained in:
+1
-3
@@ -81,7 +81,7 @@ describe('WorkflowStatusesUpdate', () => {
|
||||
provide: getRepositoryToken(LogicFunctionEntity),
|
||||
useValue: {
|
||||
findOneOrFail: jest.fn().mockResolvedValue({
|
||||
latestVersion: 'v2',
|
||||
id: 'mock-logic-function-id',
|
||||
}),
|
||||
},
|
||||
},
|
||||
@@ -229,7 +229,6 @@ describe('WorkflowStatusesUpdate', () => {
|
||||
|
||||
const mockLogicFunction = {
|
||||
id: 'logic-function-1',
|
||||
latestVersion: 'v2',
|
||||
};
|
||||
|
||||
mockWorkflowRepository.findOneOrFail.mockResolvedValue(mockWorkflow);
|
||||
@@ -262,7 +261,6 @@ describe('WorkflowStatusesUpdate', () => {
|
||||
settings: {
|
||||
input: {
|
||||
logicFunctionId: 'logic-function-1',
|
||||
logicFunctionVersion: 'v2',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
+4
-23
@@ -11,10 +11,6 @@ import { LogicFunctionService } from 'src/engine/metadata-modules/logic-function
|
||||
import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager';
|
||||
import { type WorkspaceRepository } from 'src/engine/twenty-orm/repository/workspace.repository';
|
||||
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
|
||||
import {
|
||||
WorkflowVersionStepException,
|
||||
WorkflowVersionStepExceptionCode,
|
||||
} from 'src/modules/workflow/common/exceptions/workflow-version-step.exception';
|
||||
import {
|
||||
WorkflowVersionStatus,
|
||||
type WorkflowVersionWorkspaceEntity,
|
||||
@@ -179,25 +175,10 @@ export class WorkflowStatusesUpdateJob {
|
||||
const newStep = { ...step };
|
||||
|
||||
if (step.type === WorkflowActionType.CODE) {
|
||||
const logicFunction =
|
||||
await this.logicFunctionService.publishOneLogicFunctionOrFail(
|
||||
step.settings.input.logicFunctionId,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
const newStepSettings = { ...step.settings };
|
||||
|
||||
if (!isDefined(logicFunction.latestVersion)) {
|
||||
throw new WorkflowVersionStepException(
|
||||
`Fail to publish logic function ${logicFunction.id}. Latest version is null`,
|
||||
WorkflowVersionStepExceptionCode.CODE_STEP_FAILURE,
|
||||
);
|
||||
}
|
||||
|
||||
newStepSettings.input.logicFunctionVersion =
|
||||
logicFunction.latestVersion;
|
||||
|
||||
newStep.settings = newStepSettings;
|
||||
await this.logicFunctionService.publishOneLogicFunctionOrFail(
|
||||
step.settings.input.logicFunctionId,
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
|
||||
newSteps.push(newStep);
|
||||
|
||||
Reference in New Issue
Block a user