Skip to content

Refactor Runner parameter overloads and resolve review comments#2210

Open
rafal-hawrylak wants to merge 1 commit into
mainfrom
pr4b-refactor-runner
Open

Refactor Runner parameter overloads and resolve review comments#2210
rafal-hawrylak wants to merge 1 commit into
mainfrom
pr4b-refactor-runner

Conversation

@rafal-hawrylak

Copy link
Copy Markdown
Collaborator

Pre follow up of #2184

@rafal-hawrylak rafal-hawrylak requested a review from a team as a code owner June 19, 2026 19:15
@rafal-hawrylak rafal-hawrylak requested review from Ceridan and removed request for a team and Ceridan June 19, 2026 19:15
@rafal-hawrylak rafal-hawrylak force-pushed the pr4b-refactor-runner branch 2 times, most recently from 5911a46 to 7df9bd9 Compare July 2, 2026 07:49
Comment thread cli/api/commands/run.ts
}

export interface IExecutionOptions {
projectDir?: string;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this projectDir used downstream in latter PRs?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this PR I can see that we are adding this field here, and then we are setting it (under some conditions to "."), but I am not sure how it is used. Possibly it is needed latter.

I can guess what this field does in general by the name, but is it needed?

Comment thread cli/api/commands/run.ts
).execute();
}

function handleParamsOverloads(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not obvious to me why we are handling this that way. Can we put some information on what this function is supposed to do?

Comment thread cli/api/commands/run.ts
optionsOrResult: RunOptionsOrResult,
partiallyExecutedRunResult: dataform.IRunResult
): { options: IExecutionOptions; runResult: dataform.IRunResult } {
if (optionsOrResult && (optionsOrResult as dataform.IRunResult).actions !== undefined) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an IRunResult object is passed with actions omitted or undefined, it will inadvertently be misclassified as IExecutionOptions, right? Is that expected?

Comment thread cli/api/commands/run.ts
private executionTask: Promise<dataform.IRunResult>;
private readonly executionOptions: IExecutionOptions;

constructor(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we want to use create and resume from now on to increase readability, what about making those constructors private (or protected) to enforce usage of those methods? wdyt?

Comment thread cli/api/commands/run.ts
}

public cancel() {
public cancel(reason: CancelReason = "user") {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest preparing explicit map of possible reasons to avoid mistakes, and to make it more readable.

Comment thread cli/api/commands/run.ts
public cancel(reason: CancelReason = "user") {
if (!this.skipReason) {
if (reason === "timeout") {
this.skipReason = `Run timed out after ${this.graph.runConfig.timeoutMillis / 1000} seconds`;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that graph.runConfig.timeoutMillis is not defined? I am wondering if this might cause NaN to be displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants