diff --git a/integration-tests/execute/CHANGELOG.md b/integration-tests/execute/CHANGELOG.md index 68e4e31cf..d893fbef9 100644 --- a/integration-tests/execute/CHANGELOG.md +++ b/integration-tests/execute/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/integration-tests-execute +## 1.0.7 + +### Patch Changes + +- Updated dependencies [eeb660d] + - @openfn/runtime@1.5.1 + ## 1.0.6 ### Patch Changes diff --git a/integration-tests/execute/package.json b/integration-tests/execute/package.json index 85e594a98..8c3e2058c 100644 --- a/integration-tests/execute/package.json +++ b/integration-tests/execute/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/integration-tests-execute", "private": true, - "version": "1.0.6", + "version": "1.0.7", "description": "Job execution tests", "author": "Open Function Group ", "license": "ISC", diff --git a/integration-tests/worker/CHANGELOG.md b/integration-tests/worker/CHANGELOG.md index df7816a03..8d8ed46e6 100644 --- a/integration-tests/worker/CHANGELOG.md +++ b/integration-tests/worker/CHANGELOG.md @@ -1,5 +1,14 @@ # @openfn/integration-tests-worker +## 1.0.64 + +### Patch Changes + +- Updated dependencies [eeb660d] + - @openfn/ws-worker@1.8.1 + - @openfn/engine-multi@1.4.1 + - @openfn/lightning-mock@2.0.22 + ## 1.0.63 ### Patch Changes diff --git a/integration-tests/worker/package.json b/integration-tests/worker/package.json index 8bb566c17..74c79ec98 100644 --- a/integration-tests/worker/package.json +++ b/integration-tests/worker/package.json @@ -1,7 +1,7 @@ { "name": "@openfn/integration-tests-worker", "private": true, - "version": "1.0.63", + "version": "1.0.64", "description": "Lightning WOrker integration tests", "author": "Open Function Group ", "license": "ISC", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index f11db6ae4..fa04d2bb0 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @openfn/cli +## 1.8.7 + +### Patch Changes + +- eeb660d: Fix an issue from previous patch where initial state.configuration could be lost at the start of a step +- Updated dependencies [eeb660d] + - @openfn/runtime@1.5.1 + ## 1.8.6 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 742a1b439..be146a38b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/cli", - "version": "1.8.6", + "version": "1.8.7", "description": "CLI devtools for the openfn toolchain.", "engines": { "node": ">=18", diff --git a/packages/engine-multi/CHANGELOG.md b/packages/engine-multi/CHANGELOG.md index c14320d5f..a830ebeb4 100644 --- a/packages/engine-multi/CHANGELOG.md +++ b/packages/engine-multi/CHANGELOG.md @@ -1,5 +1,12 @@ # engine-multi +## 1.4.1 + +### Patch Changes + +- Updated dependencies [eeb660d] + - @openfn/runtime@1.5.1 + ## 1.4.0 ### Minor Changes diff --git a/packages/engine-multi/package.json b/packages/engine-multi/package.json index 133a6af27..dfad91e0c 100644 --- a/packages/engine-multi/package.json +++ b/packages/engine-multi/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/engine-multi", - "version": "1.4.0", + "version": "1.4.1", "description": "Multi-process runtime engine", "main": "dist/index.js", "type": "module", diff --git a/packages/lightning-mock/CHANGELOG.md b/packages/lightning-mock/CHANGELOG.md index 5d79c74d3..e3ad44a55 100644 --- a/packages/lightning-mock/CHANGELOG.md +++ b/packages/lightning-mock/CHANGELOG.md @@ -1,5 +1,13 @@ # @openfn/lightning-mock +## 2.0.22 + +### Patch Changes + +- Updated dependencies [eeb660d] + - @openfn/runtime@1.5.1 + - @openfn/engine-multi@1.4.1 + ## 2.0.21 ### Patch Changes diff --git a/packages/lightning-mock/package.json b/packages/lightning-mock/package.json index 2a9c14853..1ca96088a 100644 --- a/packages/lightning-mock/package.json +++ b/packages/lightning-mock/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/lightning-mock", - "version": "2.0.21", + "version": "2.0.22", "private": true, "description": "A mock Lightning server", "main": "dist/index.js", diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index d9fd81dc5..5724c4a2f 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,11 @@ # @openfn/runtime +## 1.5.1 + +### Patch Changes + +- eeb660d: Fix an issue from previous patch where initial state.configuration could be lost at the start of a step + ## 1.5.0 ### Minor Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index f7172b47d..51edcc891 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/runtime", - "version": "1.5.0", + "version": "1.5.1", "description": "Job processing runtime.", "type": "module", "exports": { diff --git a/packages/runtime/src/util/assemble-state.ts b/packages/runtime/src/util/assemble-state.ts index e25b94eeb..1c5e3a014 100644 --- a/packages/runtime/src/util/assemble-state.ts +++ b/packages/runtime/src/util/assemble-state.ts @@ -30,7 +30,12 @@ const assembleState = ( } Object.assign(obj, { - configuration: Object.assign({}, globalCredentials, configuration), + configuration: Object.assign( + {}, + globalCredentials, + initialState.configuration, + configuration + ), data: assembleData(initialState.data, defaultState.data), }); diff --git a/packages/runtime/test/util/assemble-state.test.ts b/packages/runtime/test/util/assemble-state.test.ts index b27c99c13..6d35824db 100644 --- a/packages/runtime/test/util/assemble-state.test.ts +++ b/packages/runtime/test/util/assemble-state.test.ts @@ -67,7 +67,7 @@ test('Initial data does not have to be an object', (t) => { }); }); -test('does not merge default and initial config objects', (t) => { +test('merges default and initial config objects', (t) => { const initial = { configuration: { x: 1 } }; const defaultState = undefined; const config = { y: 1 }; @@ -75,6 +75,7 @@ test('does not merge default and initial config objects', (t) => { const result = assembleState(initial, config, defaultState); t.deepEqual(result, { configuration: { + x: 1, y: 1, }, data: {}, @@ -95,6 +96,20 @@ test('configuration overrides initialState.configuration', (t) => { }); }); +test('initialState.configuration is preserved', (t) => { + const initial = { configuration: { x: 1 } }; + const defaultState = undefined; + const config = undefined; + + const result = assembleState(initial, config, defaultState); + t.deepEqual(result, { + configuration: { + x: 1, + }, + data: {}, + }); +}); + test('global credentials should be added', (t) => { const initial = {}; const defaultState = undefined; @@ -127,6 +142,21 @@ test('global credentials should be merged in', (t) => { }); test('local credentials should override global credentials', (t) => { + const initial = { configuration: {} }; + const defaultState = undefined; + const config = { collection_token: 'x.y.z' }; + const global = { collection_token: 'j.w.t' }; + + const result = assembleState(initial, config, defaultState, global); + t.deepEqual(result, { + configuration: { + collection_token: 'x.y.z', + }, + data: {}, + }); +}); + +test('local credentials should override global credentials but still preserve intial credentials', (t) => { const initial = { configuration: { x: 1 } }; const defaultState = undefined; const config = { collection_token: 'x.y.z' }; @@ -135,6 +165,7 @@ test('local credentials should override global credentials', (t) => { const result = assembleState(initial, config, defaultState, global); t.deepEqual(result, { configuration: { + x: 1, collection_token: 'x.y.z', }, data: {}, diff --git a/packages/ws-worker/CHANGELOG.md b/packages/ws-worker/CHANGELOG.md index bcbd69ae6..bfb16057d 100644 --- a/packages/ws-worker/CHANGELOG.md +++ b/packages/ws-worker/CHANGELOG.md @@ -1,5 +1,14 @@ # ws-worker +## 1.8.1 + +### Patch Changes + +- eeb660d: Fix an issue from previous patch where initial state.configuration could be lost at the start of a step +- Updated dependencies [eeb660d] + - @openfn/runtime@1.5.1 + - @openfn/engine-multi@1.4.1 + ## 1.8.0 ### Minor Changes diff --git a/packages/ws-worker/package.json b/packages/ws-worker/package.json index eef4ddfef..173208a43 100644 --- a/packages/ws-worker/package.json +++ b/packages/ws-worker/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/ws-worker", - "version": "1.8.0", + "version": "1.8.1", "description": "A Websocket Worker to connect Lightning to a Runtime Engine", "main": "dist/index.js", "type": "module",