Skip to content

Portability Spec#1400

Merged
josephjclark merged 14 commits into
mainfrom
portability-spec
May 10, 2026
Merged

Portability Spec#1400
josephjclark merged 14 commits into
mainfrom
portability-spec

Conversation

@josephjclark
Copy link
Copy Markdown
Collaborator

@josephjclark josephjclark commented May 7, 2026

Introduce a formal portability layer into the project's typings.

The idea is to use TypeScript to define the schema of the abstract project yaml: a file which must be imported and exported by Lightning, executed and deployed with the CLI. Workflow yaml is a subset of this project.yaml.

This is forcing a health healthy, wholesome review of key types across in the codebase.

The key bit is in https://github.com/OpenFn/kit/blob/5e4d65af25a6854886c15294ed4cf17f93ecbc19/packages/lexicon/portability.d.ts

Implementation Details

A major concern of this work is to introduce a better separation between:

  • the abstract project.yaml which is the unit of portability
  • The serialized project state file (which we write to yaml), including UUIDs
  • Internal schema keys used by the core runtime to execute jobs

This PR does not, and is not attempting to, fix every single type discrepancy. There are TODOs in the code. I just want to get the architecture right.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation Bot moved this to New Issues in Core May 7, 2026
@josephjclark
Copy link
Copy Markdown
Collaborator Author

TODO: ensure that adaptors is an implemention detail on the runtime, an adaptor is the name of the key on the spec

Copy link
Copy Markdown
Member

@taylordowns2000 taylordowns2000 left a comment

Choose a reason for hiding this comment

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

questions about the interface between this spec and lightning specific stuff around triggers


/** cron schedule, only meaningful when type is 'cron' */
cron_expression?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how do we deal with things like cron_cursor_job_id

stuff like that, or webhook_reply, or all the kafka stuff topics, initial_offset_reset_policy, ...otherStuff

a. all just flat as keys at the trigger root?
b. all in a kafka: ... or cron: ... or webhook: ... configuration block?
c. all in a lightning: ... configuration block?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Voting a) for now!

In the state file the CLI uses (which isn't part of the portability spec IMO) we store app specific stuff in a key called openfn. Which is basically your lightning key. But I'm not really sure that's working out too well tbh - it's a bit inconsistent which keys are there and which are in the main object.

But that doesn't matter too much in the statefile. We do need to have a clean story in the spec and the story is (for now): trigger nodes can hold any key as a configuration option

Copy link
Copy Markdown
Member

@taylordowns2000 taylordowns2000 May 9, 2026

Choose a reason for hiding this comment

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

@josephjclark josephjclark marked this pull request as ready for review May 9, 2026 14:10
@josephjclark josephjclark merged commit c5b4b33 into main May 10, 2026
7 checks passed
@josephjclark josephjclark deleted the portability-spec branch May 10, 2026 11:12
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants