Skip to content

Commit dfdc06e

Browse files
Release cli@1.41.3: ensure cron_cursor_job_id is sent as a uuid (#1565)
* fix(project): map step id to uuid * add changeset * tweak comment * version --------- Co-authored-by: Joe Clark <jclark@openfn.org>
1 parent a8325e1 commit dfdc06e

10 files changed

Lines changed: 75 additions & 4 deletions

File tree

‎integration-tests/cli/CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/integration-tests-cli
22

3+
## 1.0.33
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [c3464ed]
8+
- @openfn/project@0.20.4
9+
- @openfn/lightning-mock@2.5.3
10+
311
## 1.0.32
412

513
### Patch Changes

‎integration-tests/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openfn/integration-tests-cli",
33
"private": true,
4-
"version": "1.0.32",
4+
"version": "1.0.33",
55
"description": "CLI integration tests",
66
"author": "Open Function Group <admin@openfn.org>",
77
"license": "ISC",

‎packages/cli/CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/cli
22

3+
## 1.41.3
4+
5+
### Patch Changes
6+
7+
- c3464ed: deploy v2: Fix an issue where a cron trigger's `cron_cursor_job_id` is sent as a step id instead of a UUID, so Lightning rejects the deploy
8+
- Updated dependencies [c3464ed]
9+
- @openfn/project@0.20.4
10+
311
## 1.41.2
412

513
### Patch Changes

‎packages/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/cli",
3-
"version": "1.41.2",
3+
"version": "1.41.3",
44
"description": "CLI devtools for the OpenFn toolchain",
55
"repository": {
66
"url": "https://github.com/OpenFn/kit"

‎packages/lightning-mock/CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @openfn/lightning-mock
22

3+
## 2.5.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [c3464ed]
8+
- @openfn/project@0.20.4
9+
310
## 2.5.2
411

512
### Patch Changes

‎packages/lightning-mock/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/lightning-mock",
3-
"version": "2.5.2",
3+
"version": "2.5.3",
44
"private": true,
55
"description": "A mock Lightning server",
66
"main": "dist/index.js",

‎packages/project/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @openfn/project
22

3+
## 0.20.4
4+
5+
### Patch Changes
6+
7+
- c3464ed: deploy v2: Fix an issue where a cron trigger's `cron_cursor_job_id` is sent as a step id instead of a UUID, so Lightning rejects the deploy
8+
39
## 0.20.3
410

511
### Patch Changes

‎packages/project/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/project",
3-
"version": "0.20.3",
3+
"version": "0.20.4",
44
"description": "Read, serialize, replicate and sync OpenFn projects",
55
"author": "Open Function Group <admin@openfn.org>",
66
"license": "ISC",

‎packages/project/src/serialize/to-app-state.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ export const mapWorkflow = (
165165
node = { id: nodeUuid, delete: true } as Provisioner.Trigger;
166166
} else {
167167
const { type, id, next, openfn, ...rest } = s;
168+
// map cron_cursor_job_id back to a uuid
169+
if (rest.cron_cursor_job_id && lookup[rest.cron_cursor_job_id]) {
170+
rest.cron_cursor_job_id = lookup[rest.cron_cursor_job_id];
171+
}
168172
node = {
169173
...rest,
170174
type: s.type ?? 'webhook', // this is mostly for tests

‎packages/project/test/serialize/to-app-state.test.ts‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,44 @@ test('should ignore workflow start keys', (t) => {
436436
t.falsy(state.workflows['wf'].start);
437437
});
438438

439+
test('should map cron_cursor_job_id back to the step uuid', (t) => {
440+
const data = {
441+
id: 'my-project',
442+
workflows: [
443+
{
444+
id: 'wf',
445+
name: 'wf',
446+
steps: [
447+
{
448+
id: 'cron',
449+
type: 'cron',
450+
cron_expression: '0 0 * * *',
451+
cron_cursor_job_id: 'step',
452+
next: {
453+
step: {},
454+
},
455+
},
456+
{
457+
id: 'step',
458+
expression: '.',
459+
openfn: {
460+
uuid: '66add020-e6eb-4eec-836b-20008afca816',
461+
},
462+
},
463+
],
464+
},
465+
],
466+
};
467+
468+
const state = toAppState(new Project(data), {
469+
format: 'json',
470+
}) as any;
471+
t.is(
472+
state.workflows['wf'].triggers.cron.cron_cursor_job_id,
473+
'66add020-e6eb-4eec-836b-20008afca816'
474+
);
475+
});
476+
439477
test('should handle edge labels', (t) => {
440478
const data = {
441479
id: 'my-project',

0 commit comments

Comments
 (0)