OpenFn / OpenFn/kit

Workflow types don't seem right

Open
#1,381 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

I want to do a deep dive on Project and figure out some type things.

A lot if it is around the adaptor key on a step.

Remember we have several representations of a project:

  1. v1 provisioner state: this is the JSON file that lightning expects.
  2. v2 project.yaml. This is what gets written to main@openfn.org.yaml. The same structure get written to workflow.yaml
  3. The Execution plan used internally by the runtime. This is basically { workflow, options } pair. Note that it supports adaptors as an array.

Typings we have right now aren't really honest. The lexicon is a bit confused and confusing.

Maybe the lexicon needs to break up core into:

  • runtime.dts
  • project-v1.dts
  • project-v2.dts

And be very very mindful about each type definition, duplicating everything so they're all self contained, and validating each.

I suppose project-v1.d.ts might just be an alias for lightning.d.ts, not sure.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing lexicon and lightning.d.ts, then compare the v1 provisioner state, v2 project.yaml, and runtime execution-plan representations. Evaluate whether the types should be split into runtime.d.ts, project-v1.d.ts, and project-v2.d.ts, with each representation self-contained and validated; done means the distinctions and adaptor forms are accurately modeled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.