Skip to content

Commit 7cbc8cc

Browse files
ws-worker: support job log level in lightning plan (#867)
* support job log level in lightning plan * add integration test * add changeset * bump lexicon too * version: [email protected] * package lock * bump cli * package lock, always package lock * bundle lexicon --------- Co-authored-by: Joe Clark <[email protected]>
1 parent 10e5721 commit 7cbc8cc

File tree

22 files changed

+522
-41
lines changed

22 files changed

+522
-41
lines changed

integration-tests/execute/CHANGELOG.md

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

3+
## 1.0.16
4+
5+
### Patch Changes
6+
7+
- @openfn/compiler@1.0.1
8+
- @openfn/runtime@1.6.2
9+
310
## 1.0.15
411

512
### Patch Changes

integration-tests/execute/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-execute",
33
"private": true,
4-
"version": "1.0.15",
4+
"version": "1.0.16",
55
"description": "Job execution tests",
66
"author": "Open Function Group <[email protected]>",
77
"license": "ISC",

integration-tests/worker/CHANGELOG.md

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

3+
## 1.0.76
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [1857b46]
8+
- @openfn/engine-multi@1.5.0
9+
- @openfn/ws-worker@1.10.0
10+
- @openfn/lightning-mock@2.0.31
11+
312
## 1.0.75
413

514
### Patch Changes

integration-tests/worker/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-worker",
33
"private": true,
4-
"version": "1.0.75",
4+
"version": "1.0.76",
55
"description": "Lightning WOrker integration tests",
66
"author": "Open Function Group <[email protected]>",
77
"license": "ISC",

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,5 +974,48 @@ test.serial('Redact logs which exceed the payload limit', (t) => {
974974
});
975975
});
976976

977+
test.serial(
978+
"Don't send job logs to stdout when job_log_level is set to none",
979+
(t) => {
980+
return new Promise(async (done) => {
981+
await worker.destroy();
982+
({ worker, engineLogger } = await createDummyWorker());
983+
984+
const message = 'log that will never exist';
985+
986+
const run = {
987+
id: crypto.randomUUID(),
988+
jobs: [
989+
{
990+
adaptor: '@openfn/[email protected]',
991+
body: `fn((s) => { console.log("${message}"); return s;})`,
992+
},
993+
],
994+
options: {
995+
job_log_level: 'none',
996+
},
997+
};
998+
999+
lightning.once('run:complete', () => {
1000+
const jsonLogs = engineLogger._history;
1001+
// The engine logger shouldn't print out any job logs
1002+
const jobLog = jsonLogs.find((l) => l.name === 'JOB');
1003+
t.falsy(jobLog);
1004+
const jobLog2 = jsonLogs.find((l) => l.message[0] === message);
1005+
t.falsy(jobLog2);
1006+
1007+
// But it SHOULD log engine stuff
1008+
const runtimeLog = jsonLogs.find(
1009+
(l) => l.name === 'engine' && l.message[0].match(/complete workflow/i)
1010+
);
1011+
t.truthy(runtimeLog);
1012+
done();
1013+
});
1014+
1015+
lightning.enqueueRun(run);
1016+
});
1017+
}
1018+
);
1019+
9771020
// REMEMBER the default worker was destroyed at this point!
9781021
// If you want to use a worker, you'll have to create your own

packages/cli/CHANGELOG.md

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

3+
## 1.11.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
39
## 1.11.1
410

511
### 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.11.1",
3+
"version": "1.11.2",
44
"description": "CLI devtools for the openfn toolchain.",
55
"engines": {
66
"node": ">=18",

packages/compiler/CHANGELOG.md

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

3+
## 1.0.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [1857b46]
8+
- @openfn/lexicon@1.2.0
9+
310
## 1.0.0
411

512
### Major Changes

packages/compiler/package.json

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

packages/engine-multi/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# engine-multi
22

3+
## 1.5.0
4+
5+
### Minor Changes
6+
7+
- 1857b46: Allow configuration of job log level
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [1857b46]
12+
- @openfn/lexicon@1.2.0
13+
- @openfn/compiler@1.0.1
14+
- @openfn/runtime@1.6.2
15+
316
## 1.4.9
417

518
### Patch Changes

0 commit comments

Comments
 (0)