Skip to content

Commit d34941f

Browse files
authored
Merge pull request #907 from OpenFn/release/next
Release Worker 1.13.0
2 parents 30de447 + 5cc48cd commit d34941f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1567
-214
lines changed

integration-tests/execute/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @openfn/integration-tests-execute
22

3+
## 1.0.18
4+
5+
### Patch Changes
6+
7+
- @openfn/compiler@1.0.2
8+
- @openfn/runtime@1.6.4
9+
310
## 1.0.17
411

512
### Patch Changes

integration-tests/execute/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openfn/integration-tests-execute",
33
"private": true,
4-
"version": "1.0.17",
4+
"version": "1.0.18",
55
"description": "Job execution tests",
66
"author": "Open Function Group <[email protected]>",
77
"license": "ISC",

integration-tests/worker/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @openfn/integration-tests-worker
22

3+
## 1.0.81
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- Updated dependencies [0a176aa]
9+
- Updated dependencies [ce5022a]
10+
- @openfn/logger@1.0.5
11+
- @openfn/ws-worker@1.13.0
12+
- @openfn/engine-multi@1.6.2
13+
- @openfn/lightning-mock@2.1.4
14+
315
## 1.0.80
416

517
### Patch Changes

integration-tests/worker/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openfn/integration-tests-worker",
33
"private": true,
4-
"version": "1.0.80",
4+
"version": "1.0.81",
55
"description": "Lightning WOrker integration tests",
66
"author": "Open Function Group <[email protected]>",
77
"license": "ISC",

integration-tests/worker/test/exit-reasons.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ test('exception: bad credential (not found)', async (t) => {
121121
t.is(error_type, 'CredentialLoadError');
122122
t.is(
123123
error_message,
124-
'Failed to load credential been-to-the-mountain: not_found'
124+
'Failed to load credential been-to-the-mountain: [fetch:credential] not_found'
125125
);
126126
});
127127

integration-tests/worker/test/integration.test.ts

+26-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ test.serial('run a job with bad credentials', (t) => {
313313
t.is(payload.error_type, 'CredentialLoadError');
314314
t.regex(
315315
payload.error_message,
316-
/Failed to load credential zzz: not_found/
316+
/Failed to load credential zzz: \[fetch:credential\] not_found/
317317
);
318318
done();
319319
});
@@ -561,6 +561,31 @@ test.serial("Don't send job logs to stdout", (t) => {
561561
});
562562
});
563563

564+
// This is a test against job logs - but it should work
565+
// exactly the same way for all logs
566+
test.serial("Don't send empty logs to lightning", (t) => {
567+
return new Promise(async (done) => {
568+
const attempt = {
569+
id: crypto.randomUUID(),
570+
jobs: [
571+
{
572+
adaptor: '@openfn/language-common@latest',
573+
body: 'fn((s) => { console.log(); return s })',
574+
},
575+
],
576+
};
577+
578+
lightning.once('run:complete', () => {
579+
// The engine logger shouldn't print out any job logs
580+
const jobLogs = engineLogger._history.filter((l) => l.name === 'JOB');
581+
t.is(jobLogs.length, 0);
582+
done();
583+
});
584+
585+
lightning.enqueueRun(attempt);
586+
});
587+
});
588+
564589
test.serial('Include timestamps on basically everything', (t) => {
565590
return new Promise(async (done) => {
566591
const attempt = {

packages/cli/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# @openfn/cli
22

3+
## 1.11.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
- @openfn/compiler@1.0.2
10+
- @openfn/deploy@0.11.1
11+
- @openfn/lexicon@1.2.0
12+
- @openfn/runtime@1.6.4
13+
314
## 1.11.3
415

516
### Patch Changes

packages/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/cli",
3-
"version": "1.11.3",
3+
"version": "1.11.4",
44
"description": "CLI devtools for the openfn toolchain.",
55
"engines": {
66
"node": ">=18",

packages/compiler/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/compiler
22

3+
## 1.0.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
- @openfn/lexicon@1.2.0
10+
311
## 1.0.1
412

513
### Patch Changes

packages/compiler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/compiler",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Compiler and language tooling for openfn jobs.",
55
"author": "Open Function Group <[email protected]>",
66
"license": "ISC",

packages/deploy/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @openfn/deploy
22

3+
## 0.11.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
310
## 0.11.0
411

512
### Minor Changes

packages/deploy/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/deploy",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"description": "Deploy projects to Lightning instances",
55
"type": "module",
66
"exports": {

packages/engine-multi/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# engine-multi
22

3+
## 1.6.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
- @openfn/compiler@1.0.2
10+
- @openfn/lexicon@1.2.0
11+
- @openfn/runtime@1.6.4
12+
313
## 1.6.1
414

515
### Patch Changes

packages/engine-multi/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/engine-multi",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"description": "Multi-process runtime engine",
55
"main": "dist/index.js",
66
"type": "module",

packages/engine-multi/test/integration.test.ts

+12-11
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ test.serial('run without error if no state is returned', (t) => {
263263

264264
api.execute(plan, emptyState).on('workflow-complete', ({ state }) => {
265265
t.falsy(state);
266-
t.log(logger._history);
267266

268267
// Ensure there are no error logs
269268
const err = logger._find('error', /./);
@@ -532,17 +531,19 @@ export default [(state) => {
532531
},
533532
]);
534533
const options = {
535-
payloadLimitMb: 0.5,
534+
payloadLimitMb: 0.1,
536535
};
537536

538-
api.execute(plan, emptyState, options).on('workflow-log', (evt) => {
539-
if (evt.name === 'JOB') {
540-
t.deepEqual(evt.message, REDACTED_LOG.message);
541-
}
542-
});
543-
544-
api.execute(plan, emptyState, options).on('workflow-complete', () => {
545-
done();
546-
});
537+
api
538+
.execute(plan, emptyState, options)
539+
.on('workflow-log', (evt) => {
540+
console.log(evt);
541+
if (evt.name === 'JOB') {
542+
t.deepEqual(evt.message, REDACTED_LOG.message);
543+
}
544+
})
545+
.on('workflow-complete', () => {
546+
done();
547+
});
547548
});
548549
});

packages/lightning-mock/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @openfn/lightning-mock
22

3+
## 2.1.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
- @openfn/engine-multi@1.6.2
10+
- @openfn/lexicon@1.2.0
11+
- @openfn/runtime@1.6.4
12+
313
## 2.1.3
414

515
### Patch Changes

packages/lightning-mock/package.json

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

packages/lightning-mock/src/api-sockets.ts

+5
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ const createSocketAPI = (
407407
}
408408
state.pending[runId].steps[job_id] = step_id;
409409

410+
// let payload: any = {
411+
// status: 'error',
412+
// response: 'test_error',
413+
// };
414+
410415
let payload: any = {
411416
status: 'ok',
412417
};

packages/logger/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @openfn/logger
22

3+
## 1.0.5
4+
5+
### Patch Changes
6+
7+
- 0a176aa: In JSON mode, don't log empty messages
8+
39
## 1.0.4
410

511
### Patch Changes

packages/logger/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/logger",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Cross-package logging utility",
55
"module": "dist/index.js",
66
"author": "Open Function Group <[email protected]>",

packages/logger/src/logger.ts

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ export default function (name?: string, options: LogOptions = {}): Logger {
158158
level: LogFns,
159159
...args: LogArgs
160160
) => {
161+
if (args.length === 0) {
162+
// In JSON mode, don't log empty lines
163+
// (mostly because this spams Lightning with nonsense, but more generally
164+
// if you have machine readable logs then "whitespace" or "formatting" logs,
165+
// like console.break(), are meaningless)
166+
return;
167+
}
168+
161169
const message = args.map((o) =>
162170
sanitize(o, {
163171
stringify: false,

packages/logger/test/logger.test.ts

+11
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,17 @@ test('json mode should serialize errors nicely', (t) => {
354354
t.deepEqual(result.message[0], { name: 'Error', message: 'wibble' });
355355
});
356356

357+
test('json mode should not log empty lines', (t) => {
358+
const logger = createLogger<JSONLog>(undefined, {
359+
level: 'info',
360+
json: true,
361+
});
362+
363+
logger.info();
364+
365+
t.is(logger._history.length, 0);
366+
});
367+
357368
test('with level=default, logs success, error and warning but not info and debug', (t) => {
358369
const logger = createLogger<StringLog>('x', { level: 'default' });
359370

packages/runtime/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @openfn/runtime
22

3+
## 1.6.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [0a176aa]
8+
- @openfn/logger@1.0.5
9+
310
## 1.6.3
411

512
### Patch Changes

packages/runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/runtime",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"description": "Job processing runtime.",
55
"type": "module",
66
"exports": {

packages/ws-worker/CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# ws-worker
22

3+
## 1.13.0
4+
5+
### Minor Changes
6+
7+
- ce5022a: Added sentry notifications for server and websocket errors
8+
9+
### Patch Changes
10+
11+
- 0a176aa: Ignore empty log lines (don't send them to lightning)
12+
- Updated dependencies [0a176aa]
13+
- @openfn/logger@1.0.5
14+
- @openfn/engine-multi@1.6.2
15+
- @openfn/lexicon@1.2.0
16+
- @openfn/runtime@1.6.4
17+
318
## 1.12.1
419

520
### Patch Changes

packages/ws-worker/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/ws-worker",
3-
"version": "1.12.1",
3+
"version": "1.13.0",
44
"description": "A Websocket Worker to connect Lightning to a Runtime Engine",
55
"main": "dist/index.js",
66
"type": "module",
@@ -25,6 +25,7 @@
2525
"@openfn/lexicon": "workspace:^",
2626
"@openfn/logger": "workspace:*",
2727
"@openfn/runtime": "workspace:*",
28+
"@sentry/node": "^9.5.0",
2829
"@types/koa-logger": "^3.1.2",
2930
"@types/ws": "^8.5.6",
3031
"fast-safe-stringify": "^2.1.1",
@@ -48,6 +49,7 @@
4849
"@types/yargs": "^17.0.12",
4950
"ava": "5.1.0",
5051
"nodemon": "3.0.1",
52+
"sentry-testkit": "^6.1.0",
5153
"tslib": "^2.4.0",
5254
"tsup": "^6.2.3",
5355
"typescript": "^4.6.4",

0 commit comments

Comments
 (0)