OpenFn / OpenFn/kit

CLI: rethink step validation

Open
#1,407 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The CLI has logic to validate the structure of a workflow.

The idea here is that if a user mis-types a key like "adapatator", the CLI will catch the error and flag them.

What with all the focus on sync and portability, it's way more likely that a workflow will be machine generated now, and so won't have those typos.

But if the app adds a new key to the workflow, the CLI will refuse to execute it - even if it's a step it doesn't care about.

I would like to think about the following options:

  • Use the common portability spec schema to validate against. The app does have a JSON schema. If the workflow or owning project has aversion, use that, else use latest. This relates to https://github.com/OpenFn/lightning/issues/4734
  • Add a --validate flag which will validate a workflow for you, if you want it (a bit like a circle CI yaml linter app)
  • only validate keys that the CLI cares about, and ignore the rest

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 at the CLI's current workflow-structure validation entry point and inspect the existing JSON schema. Compare the three proposed approaches, including version selection for the common portability schema and the optional --validate flag. Done means the validation policy is defined clearly enough to distinguish typo detection from compatibility with newer workflow keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.