diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 000000000..35b5ba41c --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,21 @@ +name: Add new issues and PRs to project + +on: + issues: + types: + - opened + pull_request: + types: + - opened + +jobs: + add-to-project: + name: Add issue or PR to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.5.0 + with: + # You can target a project in a different organization + # to the issue + project-url: https://github.com/orgs/OpenFn/projects/3 + github-token: ${{ secrets.PROJECT_MANAGEMENT_TOKEN }} diff --git a/integration-tests/worker/CHANGELOG.md b/integration-tests/worker/CHANGELOG.md index 0c46f0e99..1d9079065 100644 --- a/integration-tests/worker/CHANGELOG.md +++ b/integration-tests/worker/CHANGELOG.md @@ -1,5 +1,17 @@ # @openfn/integration-tests-worker +## 1.0.34 + +### Patch Changes + +- Updated dependencies [649ca43] +- Updated dependencies [823b471] +- Updated dependencies [823b471] + - @openfn/logger@0.0.20 + - @openfn/engine-multi@0.4.1 + - @openfn/ws-worker@0.8.1 + - @openfn/lightning-mock@1.2.1 + ## 1.0.33 ### Patch Changes diff --git a/integration-tests/worker/package.json b/integration-tests/worker/package.json index 605b1f523..a5544372c 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.33", + "version": "1.0.34", "description": "Lightning WOrker integration tests", "author": "Open Function Group ", "license": "ISC", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 561ee4d38..1b3cb9dc5 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,15 @@ # @openfn/cli +## 0.4.16 + +### Patch Changes + +- Updated dependencies [649ca43] + - @openfn/logger@0.0.20 + - @openfn/compiler@0.0.39 + - @openfn/deploy@0.4.1 + - @openfn/runtime@0.2.6 + ## 0.4.15 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index dac6b0207..aeae1d2c4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/cli", - "version": "0.4.15", + "version": "0.4.16", "description": "CLI devtools for the openfn toolchain.", "engines": { "node": ">=18", diff --git a/packages/compiler/CHANGELOG.md b/packages/compiler/CHANGELOG.md index aac1758c3..48300926a 100644 --- a/packages/compiler/CHANGELOG.md +++ b/packages/compiler/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/compiler +## 0.0.39 + +### Patch Changes + +- Updated dependencies [649ca43] + - @openfn/logger@0.0.20 + ## 0.0.38 ### Patch Changes diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 42b8dd818..1b44313c6 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/compiler", - "version": "0.0.38", + "version": "0.0.39", "description": "Compiler and language tooling for openfn jobs.", "author": "Open Function Group ", "license": "ISC", diff --git a/packages/deploy/CHANGELOG.md b/packages/deploy/CHANGELOG.md index 0bdf140aa..46ce5ec5d 100644 --- a/packages/deploy/CHANGELOG.md +++ b/packages/deploy/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/deploy +## 0.4.1 + +### Patch Changes + +- Updated dependencies [649ca43] + - @openfn/logger@0.0.20 + ## 0.4.0 ### Minor Changes diff --git a/packages/deploy/package.json b/packages/deploy/package.json index 3d96784f0..3eb36e86a 100644 --- a/packages/deploy/package.json +++ b/packages/deploy/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/deploy", - "version": "0.4.0", + "version": "0.4.1", "description": "Deploy projects to Lightning instances", "type": "module", "exports": { diff --git a/packages/engine-multi/CHANGELOG.md b/packages/engine-multi/CHANGELOG.md index 0f0c245e7..e58b97b27 100644 --- a/packages/engine-multi/CHANGELOG.md +++ b/packages/engine-multi/CHANGELOG.md @@ -1,5 +1,15 @@ # engine-multi +## 0.4.1 + +### Patch Changes + +- 823b471: Update handling of logs so that JSON messages are stringified +- Updated dependencies [649ca43] + - @openfn/logger@0.0.20 + - @openfn/compiler@0.0.39 + - @openfn/runtime@0.2.6 + ## 0.4.0 ### Minor Changes diff --git a/packages/engine-multi/package.json b/packages/engine-multi/package.json index ed7cc0a7c..2a18c5e18 100644 --- a/packages/engine-multi/package.json +++ b/packages/engine-multi/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/engine-multi", - "version": "0.4.0", + "version": "0.4.1", "description": "Multi-process runtime engine", "main": "dist/index.js", "type": "module", diff --git a/packages/engine-multi/test/errors.test.ts b/packages/engine-multi/test/errors.test.ts index 714d64ce6..26849678d 100644 --- a/packages/engine-multi/test/errors.test.ts +++ b/packages/engine-multi/test/errors.test.ts @@ -173,7 +173,7 @@ test.serial.skip('execution error from async code', (t) => { test.serial('emit a crash error on process.exit()', (t) => { return new Promise((done) => { const plan = { - id: 'f', + id: 'z', workflow: { steps: [ { diff --git a/packages/engine-multi/test/integration.test.ts b/packages/engine-multi/test/integration.test.ts index 378123eaa..504fccffd 100644 --- a/packages/engine-multi/test/integration.test.ts +++ b/packages/engine-multi/test/integration.test.ts @@ -1,10 +1,10 @@ import test from 'ava'; import path from 'node:path'; import { createMockLogger } from '@openfn/logger'; +import type { ExecutionPlan } from '@openfn/lexicon'; import createAPI from '../src/api'; import type { RuntimeEngine } from '../src'; -import { ExecutionPlan } from '@openfn/lexicon'; const logger = createMockLogger(); let api: RuntimeEngine; diff --git a/packages/lightning-mock/CHANGELOG.md b/packages/lightning-mock/CHANGELOG.md index b66106aa0..1184018dd 100644 --- a/packages/lightning-mock/CHANGELOG.md +++ b/packages/lightning-mock/CHANGELOG.md @@ -1,5 +1,15 @@ # @openfn/lightning-mock +## 1.2.1 + +### Patch Changes + +- Updated dependencies [649ca43] +- Updated dependencies [823b471] + - @openfn/logger@0.0.20 + - @openfn/engine-multi@0.4.1 + - @openfn/runtime@0.2.6 + ## 1.2.0 ### Minor Changes diff --git a/packages/lightning-mock/package.json b/packages/lightning-mock/package.json index 150e22e5e..170ab1ebf 100644 --- a/packages/lightning-mock/package.json +++ b/packages/lightning-mock/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/lightning-mock", - "version": "1.2.0", + "version": "1.2.1", "private": true, "description": "A mock Lightning server", "main": "dist/index.js", diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index 07aff0583..39c72e12a 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/logger +## 0.0.20 + +### Patch Changes + +- 649ca43: In JSON mode, do not stringify emitted messages. + Better handling of error objects + ## 0.0.19 ### Patch Changes diff --git a/packages/logger/package.json b/packages/logger/package.json index 65c3f61bf..e0b75aa14 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/logger", - "version": "0.0.19", + "version": "0.0.20", "description": "Cross-package logging utility", "module": "dist/index.js", "author": "Open Function Group ", diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index 9d1a0158a..c993ebd55 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,12 @@ # @openfn/runtime +## 0.2.6 + +### Patch Changes + +- Updated dependencies [649ca43] + - @openfn/logger@0.0.20 + ## 0.2.5 ### Patch Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index d39198a72..3c0dcfcb3 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/runtime", - "version": "0.2.5", + "version": "0.2.6", "description": "Job processing runtime.", "type": "module", "exports": { diff --git a/packages/runtime/test/runtime.test.ts b/packages/runtime/test/runtime.test.ts index e7f8af39e..544cb54b7 100644 --- a/packages/runtime/test/runtime.test.ts +++ b/packages/runtime/test/runtime.test.ts @@ -440,6 +440,51 @@ test('log and serialize an error to the job logger', async (t) => { t.falsy(out.message[0].stack); }); +test('log job code to the job logger', async (t) => { + const plan: ExecutionPlan = { + jobs: [ + { + id: 'a', + expression: 'export default [(s) => { console.log("hi"); return s;}]', + }, + ], + }; + + const jobLogger = createMockLogger('JOB', { level: 'debug', json: true }); + await run(plan, {}, { jobLogger }); + + t.is(jobLogger._history.length, 1); + const [out] = jobLogger._history; + + t.is(out.level, 'info'); + t.is(out.message[0], 'hi'); +}); + +test('log and serialize an error to the job logger', async (t) => { + const plan: ExecutionPlan = { + jobs: [ + { + id: 'a', + expression: + 'export default [(s) => { console.log(new Error("hi")); return s;}]', + }, + ], + }; + + const jobLogger = createMockLogger('JOB', { level: 'debug', json: true }); + await run(plan, {}, { jobLogger }); + + t.is(jobLogger._history.length, 1); + const [out] = jobLogger._history; + t.log(out); + + t.is(out.level, 'info'); + t.is(out.message[0].name, 'Error'); + t.is(out.message[0].message, 'hi'); + // should not be an error instance + t.falsy(out.message[0].stack); +}); + test('error reports can be overwritten', async (t) => { const plan: ExecutionPlanNoOptions = { workflow: { diff --git a/packages/ws-worker/CHANGELOG.md b/packages/ws-worker/CHANGELOG.md index 642bb9f92..9fda2dddf 100644 --- a/packages/ws-worker/CHANGELOG.md +++ b/packages/ws-worker/CHANGELOG.md @@ -1,5 +1,16 @@ # ws-worker +## 0.8.1 + +### Patch Changes + +- 823b471: Update handling of logs to accept stringified messages +- Updated dependencies [649ca43] +- Updated dependencies [823b471] + - @openfn/logger@0.0.20 + - @openfn/engine-multi@0.4.1 + - @openfn/runtime@0.2.6 + ## 0.8.0 ### Minor Changes diff --git a/packages/ws-worker/package.json b/packages/ws-worker/package.json index b70a1fc73..1200b2e3c 100644 --- a/packages/ws-worker/package.json +++ b/packages/ws-worker/package.json @@ -1,6 +1,6 @@ { "name": "@openfn/ws-worker", - "version": "0.8.0", + "version": "0.8.1", "description": "A Websocket Worker to connect Lightning to a Runtime Engine", "main": "dist/index.js", "type": "module", diff --git a/packages/ws-worker/test/mock/runtime-engine.test.ts b/packages/ws-worker/test/mock/runtime-engine.test.ts index d60c5b2ab..aa66c2aa6 100644 --- a/packages/ws-worker/test/mock/runtime-engine.test.ts +++ b/packages/ws-worker/test/mock/runtime-engine.test.ts @@ -194,7 +194,7 @@ test.serial('only listen to events for the correct workflow', async (t) => { t.pass(); }); -test.serial('log events should stringify a string message', async (t) => { +test('log events should stringify a string message', async (t) => { const wf = clone(sampleWorkflow); wf.id = t.title; wf.workflow.steps[0].expression =