OpenFn / OpenFn/kit

Simplify state assembly

Open
#558 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The runtime has some fairly complex code for assembling state objects between steps in a run. A big part of the complexity comes from merging data objects - although I'm not actually sure we want to do that 🤔

Anyway, one problem of this approach - apart form complexity - is that state objects are default to { data: {}, configuration: {} }. But we shouldn't create those keys unless they're actually needed.

Most of the complexity in this is around unit tests and strict mode. Strict mode ought to be killed off along with this (we can bring it back later), and we just have to go through the tests one at a time.

We have to deal with the input state and the state on the job object (I think we call this globals), and the incoming configuration.

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 locating the runtime code that assembles state objects and the unit tests covering strict mode. Trace the input state, job globals, and incoming configuration, then determine how unused data and configuration keys should be handled. Done means the unnecessary default keys and strict mode are removed consistently and the affected tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.