Skip to content

Commit

Permalink
Merge branch 'main' into release/1-0
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Feb 13, 2024
2 parents 3e49146 + 0f00be0 commit cf9abea
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 12 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
12 changes: 12 additions & 0 deletions integration-tests/worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/worker/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"license": "ISC",
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/compiler

## 0.0.39

### Patch Changes

- Updated dependencies [649ca43]
- @openfn/logger@0.0.20

## 0.0.38

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"license": "ISC",
Expand Down
7 changes: 7 additions & 0 deletions packages/deploy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/deploy

## 0.4.1

### Patch Changes

- Updated dependencies [649ca43]
- @openfn/logger@0.0.20

## 0.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/deploy",
"version": "0.4.0",
"version": "0.4.1",
"description": "Deploy projects to Lightning instances",
"type": "module",
"exports": {
Expand Down
10 changes: 10 additions & 0 deletions packages/engine-multi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/test/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-multi/test/integration.test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
10 changes: 10 additions & 0 deletions packages/lightning-mock/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/lightning-mock/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/runtime

## 0.2.6

### Patch Changes

- Updated dependencies [649ca43]
- @openfn/logger@0.0.20

## 0.2.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/runtime",
"version": "0.2.5",
"version": "0.2.6",
"description": "Job processing runtime.",
"type": "module",
"exports": {
Expand Down
45 changes: 45 additions & 0 deletions packages/runtime/test/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
11 changes: 11 additions & 0 deletions packages/ws-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-worker/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-worker/test/mock/runtime-engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit cf9abea

Please sign in to comment.