Skip to content

feat(on): add generic WorkflowRunner interface#7

Open
darlanalves wants to merge 4 commits intomainfrom
codex/create-workflowrunner-interface-definition
Open

feat(on): add generic WorkflowRunner interface#7
darlanalves wants to merge 4 commits intomainfrom
codex/create-workflowrunner-interface-definition

Conversation

@darlanalves
Copy link
Copy Markdown
Contributor

Motivation

  • Provide a shared, strongly-typed contract for different runner implementations (e.g., shell, docker, node) so multiple packages can implement runners against a common interface.
  • Allow consumers to specialize step, context, and output types while keeping a consistent runtime contract for executing workflow steps.

Description

  • Added a new exported WorkflowRunner interface to packages/on/src/types.ts that is generic over TStep, TContext, and TOutput and defaults to StepDefinition, WorkflowContext, and StepOutput respectively.
  • The interface defines the contract run(step, context): Promise<TOutput> modeling an asynchronous execution that returns an exit code, stdout/stderr and the executed command.
  • The new interface is colocated with existing types (StepDefinition, WorkflowContext, StepOutput) so implementations can import and specialize the runner type consistently.

Testing

  • Ran pnpm nx run on:build, which completed successfully.
  • Ran pnpm nx run on:test, which executed but failed in this environment due to missing Docker (spawn docker ENOENT).
  • Test failures occurred in src/cli.spec.ts with 3 failing tests, which is caused by the unavailable Docker runtime rather than the new type addition.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant