OpenFn / kit

The bits & pieces that make OpenFn work. (diagrammer, cli, compiler, runtime, runtime manager, logger, etc.)
10 stars 9 forks source link

Support next tag #716

Closed josephjclark closed 3 months ago

josephjclark commented 3 months ago

The PR adds support for the @next tag in the Worker and CLI.

Background

I am working on pr-release dist-tag for adaptors, making them available to the worker in particular but only if asked for.

Over in adaptors, I've added logic to build and publish prereleases with the @next tag.

Implementation

Here in kit, I've had to add logic to the CLI, Runtime and Worker to better manage @next - and for that matter, @latest.

The change is small but deep, so I'm testing carefully before I'm ready to release.

Test Notes

The integration tests are destined to be a little bit fragile as they'll depend on specific adaptor versions being available on NPM.

I am trying to decide whether to skip these tests or do consolidate releases before merging.

QA

In the CLI:

Phew.

In Lightning there isn't much to test yet.

When you pick @latest from the drop-down menu, Lightning will send the actual version number, not @latest, to the worker. In other words lightning is in total control of the versions.

I will later raise a PR against Lightning to enable @next, if it exists.

josephjclark commented 3 months ago

Still something wrong with the engine and @latest. Need to test that carefully tomorrow

josephjclark commented 3 months ago

Oh my days it's passing!! I wonder if this is actually a reasonable fix - struggling to get my head back into this space. I'll self-review this afternoon

josephjclark commented 3 months ago

The behaviour in CLI in production (validated through testing) is:

This is a problem because now and forever, @latest will be locked in that repo to whatever version it downloaded. If we release a new common now, my CLI won't use it even if I pass @latest.

So that's actually not very good!

The behavior on this branch is:

Is this the same in CLI AND Worker?

I think that when Lightning runs from @latest, it instantly version locks the number to whatever is latest now. That's the correct behaviour but I need to verify this.

With @next, though, Lightning should literally use next as the version label, and trust the worker to track the rolling head.