-
Notifications
You must be signed in to change notification settings - Fork 50.8k
refactor(core,editor): split logic based on payload type / manual execution type #22219
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
base: master
Are you sure you want to change the base?
refactor(core,editor): split logic based on payload type / manual execution type #22219
Conversation
… nodes without trigger, upgrading to full executions if the destination node's branch does not have enough run data
…root node has runData
❌ 19 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
Found 31 test failures on Blacksmith runners: Failures
|
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.
5 issues found across 9 files
Prompt for AI agents (all 5 issues)
Understand the root cause of the following 5 issues and fix them.
<file name="packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts">
<violation number="1" location="packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts:522">
Rule violated: **Prefer Typeguards over Type casting**
`outputType` is still cast with `as NodeConnectionType`, bypassing any verification of the connection type. Please replace the cast with a proper narrowing strategy (e.g., add a type guard that checks the key against `NodeConnectionTypes` before using it) so the compiler enforces valid connection types instead of relying on `as`.</violation>
</file>
<file name="packages/cli/src/workflows/workflow-execution.service.ts">
<violation number="1" location="packages/cli/src/workflows/workflow-execution.service.ts:150">
Rule violated: **Prefer Typeguards over Type casting**
The payload is cast to `any` just to delete `runData`, bypassing the manual execution typings. Use the existing type guard (or refine the union type) so the deletion happens on a properly narrowed type instead of an `as any` cast, per the Prefer Typeguards over Type casting rule.</violation>
<violation number="2" location="packages/cli/src/workflows/workflow-execution.service.ts:153">
Remove the raw payload console log (or replace it with a redacted logger message) to avoid leaking manual execution data and to respect the project’s logging conventions.</violation>
<violation number="3" location="packages/cli/src/workflows/workflow-execution.service.ts:295">
Await the manual execution run so the method returns the real execution ID instead of a pending Promise.</violation>
</file>
<file name="packages/core/src/execution-engine/workflow-execute.ts">
<violation number="1" location="packages/core/src/execution-engine/workflow-execute.ts:211">
Removing the standalone-node partial execution path now causes manual runs of nodes without parents to throw an assertion instead of executing, regressing a supported scenario.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| from, | ||
| to, | ||
| // TODO: parse outputType instead of casting it | ||
| type: outputType as NodeConnectionType, |
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.
Rule violated: Prefer Typeguards over Type casting
outputType is still cast with as NodeConnectionType, bypassing any verification of the connection type. Please replace the cast with a proper narrowing strategy (e.g., add a type guard that checks the key against NodeConnectionTypes before using it) so the compiler enforces valid connection types instead of relying on as.
Prompt for AI agents
Address the following comment on packages/core/src/execution-engine/partial-execution-utils/directed-graph.ts at line 522:
<comment>`outputType` is still cast with `as NodeConnectionType`, bypassing any verification of the connection type. Please replace the cast with a proper narrowing strategy (e.g., add a type guard that checks the key against `NodeConnectionTypes` before using it) so the compiler enforces valid connection types instead of relying on `as`.</comment>
<file context>
@@ -493,6 +493,44 @@ export class DirectedGraph {
+ from,
+ to,
+ // TODO: parse outputType instead of casting it
+ type: outputType as NodeConnectionType,
+ outputIndex,
+ inputIndex,
</file context>
| // TODO: fix this on the FE | ||
| if ('triggerToStartFrom' in payload) { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access | ||
| delete (payload as any).runData; |
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.
Rule violated: Prefer Typeguards over Type casting
The payload is cast to any just to delete runData, bypassing the manual execution typings. Use the existing type guard (or refine the union type) so the deletion happens on a properly narrowed type instead of an as any cast, per the Prefer Typeguards over Type casting rule.
Prompt for AI agents
Address the following comment on packages/cli/src/workflows/workflow-execution.service.ts at line 150:
<comment>The payload is cast to `any` just to delete `runData`, bypassing the manual execution typings. Use the existing type guard (or refine the union type) so the deletion happens on a properly narrowed type instead of an `as any` cast, per the Prefer Typeguards over Type casting rule.</comment>
<file context>
@@ -91,149 +93,225 @@ export class WorkflowExecutionService {
+ // TODO: fix this on the FE
+ if ('triggerToStartFrom' in payload) {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
+ delete (payload as any).runData;
+ }
+
</file context>
| }); | ||
|
|
||
| return this.processRunExecutionData(graph.toWorkflow({ ...workflow })); | ||
| assert.fail('this code should be dead'); |
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.
Removing the standalone-node partial execution path now causes manual runs of nodes without parents to throw an assertion instead of executing, regressing a supported scenario.
Prompt for AI agents
Address the following comment on packages/core/src/execution-engine/workflow-execute.ts at line 211:
<comment>Removing the standalone-node partial execution path now causes manual runs of nodes without parents to throw an assertion instead of executing, regressing a supported scenario.</comment>
<file context>
@@ -205,37 +205,39 @@ export class WorkflowExecute {
- });
-
- return this.processRunExecutionData(graph.toWorkflow({ ...workflow }));
+ assert.fail('this code should be dead');
+ // // short cut here, only create a subgraph and the stacks
+ // graph = findSubgraph({
</file context>
| delete (payload as any).runData; | ||
| } | ||
|
|
||
| console.log('payload', payload); |
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.
Remove the raw payload console log (or replace it with a redacted logger message) to avoid leaking manual execution data and to respect the project’s logging conventions.
Prompt for AI agents
Address the following comment on packages/cli/src/workflows/workflow-execution.service.ts at line 153:
<comment>Remove the raw payload console log (or replace it with a redacted logger message) to avoid leaking manual execution data and to respect the project’s logging conventions.</comment>
<file context>
@@ -91,149 +93,225 @@ export class WorkflowExecutionService {
+ delete (payload as any).runData;
+ }
+
+ console.log('payload', payload);
+
+ if (isPartialManualExecutionToDestination(payload)) {
</file context>
| console.log('pinnedTrigger', pinnedTrigger); | ||
| } | ||
|
|
||
| const executionId = this.workflowRunner.run({ |
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.
Await the manual execution run so the method returns the real execution ID instead of a pending Promise.
Prompt for AI agents
Address the following comment on packages/cli/src/workflows/workflow-execution.service.ts at line 295:
<comment>Await the manual execution run so the method returns the real execution ID instead of a pending Promise.</comment>
<file context>
@@ -91,149 +93,225 @@ export class WorkflowExecutionService {
+ console.log('pinnedTrigger', pinnedTrigger);
+ }
+
+ const executionId = this.workflowRunner.run({
+ executionMode: 'manual',
+ pinData: payload.workflowData.pinData,
</file context>
Summary
WIP
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)