@elisra-devops/docgen-skins 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +2 -0
- package/bin/index.js +8 -3
- package/bin/index.js.map +1 -1
- package/bin/models/json/table/JSONTableCell.js +4 -3
- package/bin/models/json/table/JSONTableCell.js.map +1 -1
- package/bin/services/logSink.d.ts +25 -0
- package/bin/services/logSink.js +16 -0
- package/bin/services/logSink.js.map +1 -0
- package/bin/services/logger.d.ts +6 -0
- package/bin/services/logger.js +212 -16
- package/bin/services/logger.js.map +1 -1
- package/bin/services/runContext.d.ts +7 -0
- package/bin/services/runContext.js +12 -0
- package/bin/services/runContext.js.map +1 -0
- package/bin/test/logger.test.d.ts +1 -0
- package/bin/test/logger.test.js +272 -0
- package/bin/test/logger.test.js.map +1 -0
- package/bin/test/runContext.test.d.ts +1 -0
- package/bin/test/runContext.test.js +96 -0
- package/bin/test/runContext.test.js.map +1 -0
- package/eslint.config.mjs +40 -0
- package/package.json +8 -3
- package/src/index.ts +8 -5
- package/src/models/json/table/JSONTableCell.ts +4 -3
- package/src/services/logSink.ts +44 -0
- package/src/services/logger.ts +220 -17
- package/src/services/runContext.ts +22 -0
- package/src/test/logger.test.ts +268 -0
- package/src/test/runContext.test.ts +48 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const winston = __importStar(require("winston"));
|
|
40
|
+
const winston_transport_1 = __importDefault(require("winston-transport"));
|
|
41
|
+
const logger_1 = require("../services/logger");
|
|
42
|
+
const logSink_1 = require("../services/logSink");
|
|
43
|
+
const runContext_1 = require("../services/runContext");
|
|
44
|
+
const applyRedact = (info) => (0, logger_1.redact)().transform(Object.assign({}, info));
|
|
45
|
+
describe('logger redact format', () => {
|
|
46
|
+
test('scrubs a top-level token/password/secret regardless of key casing', () => {
|
|
47
|
+
const out = applyRedact({ level: 'info', message: 'x', token: 'abc', Password: 'p', SECRET: 's' });
|
|
48
|
+
expect(out.token).toBe('[REDACTED]');
|
|
49
|
+
expect(out.Password).toBe('[REDACTED]');
|
|
50
|
+
expect(out.SECRET).toBe('[REDACTED]');
|
|
51
|
+
});
|
|
52
|
+
test('scrubs nested config.auth.password and config.headers.Authorization — the AxiosError.toJSON() leak', () => {
|
|
53
|
+
const axiosLikeError = {
|
|
54
|
+
message: 'Request failed',
|
|
55
|
+
config: {
|
|
56
|
+
auth: { username: '', password: 'super-secret-pat' },
|
|
57
|
+
headers: { Authorization: 'Bearer abc.def.ghi' },
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const out = applyRedact({ level: 'error', message: 'upstream failed', err: axiosLikeError });
|
|
61
|
+
expect(out.err.config.auth.password).toBe('[REDACTED]');
|
|
62
|
+
expect(out.err.config.headers.Authorization).toBe('[REDACTED]');
|
|
63
|
+
expect(out.err.message).toBe('Request failed');
|
|
64
|
+
});
|
|
65
|
+
test('leaves non-sensitive fields untouched', () => {
|
|
66
|
+
const out = applyRedact({ level: 'info', message: 'ok', project: 'Cube-ADCS', docType: 'SVD' });
|
|
67
|
+
expect(out.project).toBe('Cube-ADCS');
|
|
68
|
+
expect(out.docType).toBe('SVD');
|
|
69
|
+
});
|
|
70
|
+
test('never throws on a circular object', () => {
|
|
71
|
+
const circular = { name: 'x' };
|
|
72
|
+
circular.self = circular;
|
|
73
|
+
expect(() => applyRedact({ level: 'info', message: 'x', circular })).not.toThrow();
|
|
74
|
+
});
|
|
75
|
+
test('never throws and passes info through on null/undefined meta', () => {
|
|
76
|
+
expect(() => applyRedact({ level: 'info', message: 'x', meta: null })).not.toThrow();
|
|
77
|
+
expect(() => applyRedact({ level: 'info', message: 'x', meta: undefined })).not.toThrow();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
// A capturing transport + the exact JSON format chain logger.ts uses (errors -> timestamp ->
|
|
81
|
+
// redact -> splat -> json), so these tests exercise the real pipeline, not just redact() alone.
|
|
82
|
+
class CaptureTransport extends winston_transport_1.default {
|
|
83
|
+
constructor() {
|
|
84
|
+
super(...arguments);
|
|
85
|
+
this.lines = [];
|
|
86
|
+
}
|
|
87
|
+
log(info, callback) {
|
|
88
|
+
var _a;
|
|
89
|
+
this.lines.push(JSON.parse((_a = info[Symbol.for('message')]) !== null && _a !== void 0 ? _a : JSON.stringify(info)));
|
|
90
|
+
callback();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function makeTestLogger() {
|
|
94
|
+
const capture = new CaptureTransport();
|
|
95
|
+
const logger = winston.createLogger({
|
|
96
|
+
level: 'silly',
|
|
97
|
+
format: winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), (0, logger_1.redact)(), winston.format.splat(), winston.format.json()),
|
|
98
|
+
transports: [capture],
|
|
99
|
+
});
|
|
100
|
+
return { logger, capture };
|
|
101
|
+
}
|
|
102
|
+
describe('logger pipeline — errors({stack:true})', () => {
|
|
103
|
+
test('logger.error(err) (single-arg Error) still produces a non-empty message and a stack', () => {
|
|
104
|
+
// This is the regression errors({stack:true}) exists to prevent: without it, winston's
|
|
105
|
+
// single-arg path makes `info` *be* the Error, and message/stack are non-enumerable, so
|
|
106
|
+
// json() would emit {"level":"error","timestamp":"…"} — content-free.
|
|
107
|
+
const { logger, capture } = makeTestLogger();
|
|
108
|
+
logger.error(new Error('boom'));
|
|
109
|
+
expect(capture.lines).toHaveLength(1);
|
|
110
|
+
expect(capture.lines[0].message).toBe('boom');
|
|
111
|
+
expect(typeof capture.lines[0].stack).toBe('string');
|
|
112
|
+
expect(capture.lines[0].stack.length).toBeGreaterThan(0);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
describe('logger pipeline — hostile inputs never throw', () => {
|
|
116
|
+
test.each([
|
|
117
|
+
['null', null],
|
|
118
|
+
['undefined', undefined],
|
|
119
|
+
['NaN', NaN],
|
|
120
|
+
['a circular object', (() => { const c = { a: 1 }; c.self = c; return c; })()],
|
|
121
|
+
['an object with a throwing getter', { get boom() { throw new Error('nope'); } }],
|
|
122
|
+
['a BigInt', BigInt(9007199254740993)],
|
|
123
|
+
['a Symbol', Symbol('x')],
|
|
124
|
+
['an Error with no message', new Error()],
|
|
125
|
+
['a 10MB string', 'x'.repeat(10 * 1024 * 1024)],
|
|
126
|
+
])('logger.error(%s) does not throw', (_label, value) => {
|
|
127
|
+
const { logger } = makeTestLogger();
|
|
128
|
+
expect(() => logger.error(value)).not.toThrow();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
describe('DiagnosticsTransport (Phase 6a)', () => {
|
|
132
|
+
function makeDiagnosticsLogger() {
|
|
133
|
+
const capture = new CaptureTransport();
|
|
134
|
+
const logger = winston.createLogger({
|
|
135
|
+
level: 'silly',
|
|
136
|
+
format: winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), (0, logger_1.redact)(), winston.format.splat(), winston.format.json()),
|
|
137
|
+
transports: [capture, new logger_1.DiagnosticsTransport()],
|
|
138
|
+
});
|
|
139
|
+
return { logger, capture };
|
|
140
|
+
}
|
|
141
|
+
test('pushes warn/error records to whatever sink is installed', () => {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
const events = [];
|
|
144
|
+
const sink = { push: (e) => events.push(e) };
|
|
145
|
+
(0, logSink_1.installLogSink)(sink);
|
|
146
|
+
const { logger } = makeDiagnosticsLogger();
|
|
147
|
+
logger.warn('a stable warning');
|
|
148
|
+
logger.error('a stable error', Object.assign(new Error('boom'), { code: 'ECONN' }));
|
|
149
|
+
expect(events).toHaveLength(2);
|
|
150
|
+
expect(events[0].level).toBe('warn');
|
|
151
|
+
expect((_a = events[1].err) === null || _a === void 0 ? void 0 : _a.code).toBe('ECONN');
|
|
152
|
+
expect((_b = events[1].err) === null || _b === void 0 ? void 0 : _b.stack).toEqual(expect.any(String));
|
|
153
|
+
});
|
|
154
|
+
test('does not push info/debug records', () => {
|
|
155
|
+
const events = [];
|
|
156
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
157
|
+
const { logger } = makeDiagnosticsLogger();
|
|
158
|
+
logger.info('not interesting to the dashboard');
|
|
159
|
+
expect(events).toHaveLength(0);
|
|
160
|
+
});
|
|
161
|
+
test('a throwing sink cannot break the log call', () => {
|
|
162
|
+
(0, logSink_1.installLogSink)({
|
|
163
|
+
push: () => {
|
|
164
|
+
throw new Error('sink is down');
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
const { logger } = makeDiagnosticsLogger();
|
|
168
|
+
expect(() => logger.error('still must not throw')).not.toThrow();
|
|
169
|
+
});
|
|
170
|
+
test.each([
|
|
171
|
+
['null', null],
|
|
172
|
+
['undefined', undefined],
|
|
173
|
+
['NaN', NaN],
|
|
174
|
+
['a circular object', (() => { const c = { a: 1 }; c.self = c; return c; })()],
|
|
175
|
+
['an object with a throwing getter', { get boom() { throw new Error('nope'); } }],
|
|
176
|
+
['a BigInt', BigInt(9007199254740993)],
|
|
177
|
+
['a Symbol', Symbol('x')],
|
|
178
|
+
['an Error with no message', new Error()],
|
|
179
|
+
['a 10MB string', 'x'.repeat(10 * 1024 * 1024)],
|
|
180
|
+
])('logger.error(%s) with a sink installed does not throw', (_label, value) => {
|
|
181
|
+
(0, logSink_1.installLogSink)({ push: () => undefined });
|
|
182
|
+
const { logger } = makeDiagnosticsLogger();
|
|
183
|
+
expect(() => logger.error(value)).not.toThrow();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
describe('textFormat safety (regression)', () => {
|
|
187
|
+
// The hostile-input matrix above exercises makeTestLogger()'s json() pipeline — it never
|
|
188
|
+
// touched the real singleton logger's text-format branch (LOG_FORMAT's default), which is
|
|
189
|
+
// where a Symbol message crashed: a template literal's implicit ToString throws on a Symbol,
|
|
190
|
+
// and this formatter sits with no try/catch around it.
|
|
191
|
+
test('logger.error(Symbol) does not throw through the real default-exported logger', () => {
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
193
|
+
const logger = require('../services/logger').default;
|
|
194
|
+
expect(() => logger.error(Symbol('x'))).not.toThrow();
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('DiagnosticsTransport capture policy (Phase 6b)', () => {
|
|
198
|
+
function makeDiagnosticsLogger() {
|
|
199
|
+
const capture = new CaptureTransport();
|
|
200
|
+
const logger = winston.createLogger({
|
|
201
|
+
level: 'silly',
|
|
202
|
+
format: winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), (0, logger_1.redact)(), winston.format.splat(), winston.format.json()),
|
|
203
|
+
transports: [capture, new logger_1.DiagnosticsTransport()],
|
|
204
|
+
});
|
|
205
|
+
return { logger, capture };
|
|
206
|
+
}
|
|
207
|
+
test('normal mode (no captureMode) does not persist debug/info', () => {
|
|
208
|
+
const events = [];
|
|
209
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
210
|
+
const { logger } = makeDiagnosticsLogger();
|
|
211
|
+
runContext_1.runContextStore.run({ runId: 'run-1' }, () => {
|
|
212
|
+
logger.debug('a debug line');
|
|
213
|
+
logger.info('an info line');
|
|
214
|
+
});
|
|
215
|
+
expect(events).toHaveLength(0);
|
|
216
|
+
});
|
|
217
|
+
test('verbose mode persists debug and info', () => {
|
|
218
|
+
const events = [];
|
|
219
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
220
|
+
const { logger } = makeDiagnosticsLogger();
|
|
221
|
+
runContext_1.runContextStore.run({ runId: 'run-2', captureMode: 'verbose' }, () => {
|
|
222
|
+
logger.debug('a debug line');
|
|
223
|
+
logger.info('an info line');
|
|
224
|
+
});
|
|
225
|
+
expect(events).toHaveLength(2);
|
|
226
|
+
expect(events[0].retainPending).toBeUndefined();
|
|
227
|
+
});
|
|
228
|
+
test('warn/error persist regardless of capture mode', () => {
|
|
229
|
+
const events = [];
|
|
230
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
231
|
+
const { logger } = makeDiagnosticsLogger();
|
|
232
|
+
runContext_1.runContextStore.run({ runId: 'run-3' }, () => {
|
|
233
|
+
logger.warn('a warning');
|
|
234
|
+
logger.error('an error');
|
|
235
|
+
});
|
|
236
|
+
expect(events).toHaveLength(2);
|
|
237
|
+
});
|
|
238
|
+
test('retain-on-failure persists debug/info tagged retainPending: true', () => {
|
|
239
|
+
const events = [];
|
|
240
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
241
|
+
const { logger } = makeDiagnosticsLogger();
|
|
242
|
+
runContext_1.runContextStore.run({ runId: 'run-4', captureMode: 'retain-on-failure' }, () => {
|
|
243
|
+
logger.debug('a debug line');
|
|
244
|
+
});
|
|
245
|
+
expect(events).toHaveLength(1);
|
|
246
|
+
expect(events[0].retainPending).toBe(true);
|
|
247
|
+
});
|
|
248
|
+
test('retain-on-failure does not tag warn/error as retainPending', () => {
|
|
249
|
+
const events = [];
|
|
250
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
251
|
+
const { logger } = makeDiagnosticsLogger();
|
|
252
|
+
runContext_1.runContextStore.run({ runId: 'run-5', captureMode: 'retain-on-failure' }, () => {
|
|
253
|
+
logger.error('an error');
|
|
254
|
+
});
|
|
255
|
+
expect(events).toHaveLength(1);
|
|
256
|
+
expect(events[0].retainPending).toBeUndefined();
|
|
257
|
+
});
|
|
258
|
+
test('a concurrent normal-mode run is unaffected by a sibling verbose run', () => {
|
|
259
|
+
const events = [];
|
|
260
|
+
(0, logSink_1.installLogSink)({ push: (e) => events.push(e) });
|
|
261
|
+
const { logger } = makeDiagnosticsLogger();
|
|
262
|
+
runContext_1.runContextStore.run({ runId: 'verbose-run', captureMode: 'verbose' }, () => {
|
|
263
|
+
logger.debug('verbose debug');
|
|
264
|
+
});
|
|
265
|
+
runContext_1.runContextStore.run({ runId: 'normal-run' }, () => {
|
|
266
|
+
logger.debug('normal debug');
|
|
267
|
+
});
|
|
268
|
+
expect(events).toHaveLength(1);
|
|
269
|
+
expect(events[0].message).toBe('verbose debug');
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+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C,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
const winston = __importStar(require("winston"));
|
|
49
|
+
const winston_transport_1 = __importDefault(require("winston-transport"));
|
|
50
|
+
const logger_1 = require("../services/logger");
|
|
51
|
+
const runContext_1 = require("../services/runContext");
|
|
52
|
+
class CaptureTransport extends winston_transport_1.default {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(...arguments);
|
|
55
|
+
this.lines = [];
|
|
56
|
+
}
|
|
57
|
+
log(info, callback) {
|
|
58
|
+
var _a;
|
|
59
|
+
this.lines.push(JSON.parse((_a = info[Symbol.for('message')]) !== null && _a !== void 0 ? _a : JSON.stringify(info)));
|
|
60
|
+
callback();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function makeTestLogger() {
|
|
64
|
+
const capture = new CaptureTransport();
|
|
65
|
+
const logger = winston.createLogger({
|
|
66
|
+
level: 'silly',
|
|
67
|
+
format: winston.format.combine((0, logger_1.withRunContext)(), winston.format.json()),
|
|
68
|
+
transports: [capture],
|
|
69
|
+
});
|
|
70
|
+
return { logger, capture };
|
|
71
|
+
}
|
|
72
|
+
describe('withRunContext', () => {
|
|
73
|
+
test('is a no-op when the store was never populated', () => {
|
|
74
|
+
const { logger, capture } = makeTestLogger();
|
|
75
|
+
logger.info('outside any run');
|
|
76
|
+
expect(capture.lines[0].runId).toBeUndefined();
|
|
77
|
+
});
|
|
78
|
+
test('stamps runId onto every log emitted inside store.run(...)', () => {
|
|
79
|
+
const { logger, capture } = makeTestLogger();
|
|
80
|
+
runContext_1.runContextStore.run({ runId: 'run-123' }, () => {
|
|
81
|
+
logger.info('inside the run');
|
|
82
|
+
});
|
|
83
|
+
logger.info('outside again');
|
|
84
|
+
expect(capture.lines[0].runId).toBe('run-123');
|
|
85
|
+
expect(capture.lines[1].runId).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
test('async work started inside the run keeps the runId across the await boundary', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
+
const { logger, capture } = makeTestLogger();
|
|
89
|
+
yield runContext_1.runContextStore.run({ runId: 'run-async' }, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
yield new Promise((resolve) => setTimeout(resolve, 0));
|
|
91
|
+
logger.info('after await');
|
|
92
|
+
}));
|
|
93
|
+
expect(capture.lines[0].runId).toBe('run-async');
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=runContext.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runContext.test.js","sourceRoot":"","sources":["../../src/test/runContext.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,0EAA0C;AAC1C,+CAAoD;AACpD,uDAAyD;AAEzD,MAAM,gBAAiB,SAAQ,2BAAS;IAAxC;;QACE,U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,gBAAgB,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6EAA6E,EAAE,GAAS,EAAE;QAC7F,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;QAC7C,MAAM,4BAAe,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,GAAS,EAAE;YAC3D,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7B,CAAC,CAAA,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
|
|
4
|
+
// Phase 4 regression guard: bans the two log-record-corrupting patterns the observability plan
|
|
5
|
+
// found and fixed by hand across all four backend repos. Deliberately does NOT extend
|
|
6
|
+
// js.configs.recommended/tseslint's recommended rule sets — this repo has never had a linter,
|
|
7
|
+
// and pulling in a general rule set now would surface a large, unrelated pre-existing backlog
|
|
8
|
+
// (unused vars, etc.) as new lint failures. Scope is exactly the one regression this guards
|
|
9
|
+
// against. Keep this file identical in shape across docgen-api-gate / docgen-content-control /
|
|
10
|
+
// docgen-data-provider-package / docgen-dg-skins-package — see each repo's CLAUDE.md "keep
|
|
11
|
+
// these files in sync" note.
|
|
12
|
+
export default tseslint.config(
|
|
13
|
+
{
|
|
14
|
+
ignores: ['bin/**', 'coverage/**', '**/test/**', '**/tests/**'],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
files: ['src/**/*.ts'],
|
|
18
|
+
extends: [tseslint.configs.base],
|
|
19
|
+
languageOptions: {
|
|
20
|
+
globals: globals.node,
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
'no-restricted-syntax': [
|
|
24
|
+
'error',
|
|
25
|
+
{
|
|
26
|
+
selector:
|
|
27
|
+
"CallExpression[callee.object.name='logger'] > :matches(TemplateLiteral, BinaryExpression[operator='+']).arguments:first-child MemberExpression[property.name='stack']",
|
|
28
|
+
message:
|
|
29
|
+
'Do not embed .stack in the log message string — errors({stack:true}) attaches it automatically when the Error is passed as an argument. Pass the Error itself as a positional/meta argument instead.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
selector:
|
|
33
|
+
"CallExpression[callee.object.name='logger'] CallExpression[callee.object.name='JSON'][callee.property.name='stringify'] > Identifier.arguments:first-child[name=/^(e|err|error|ex)$/]",
|
|
34
|
+
message:
|
|
35
|
+
"Don't JSON.stringify an Error — message/stack are non-enumerable and it serializes to {}. Pass the Error object directly as a log argument.",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
);
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elisra-devops/docgen-skins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Can be outputed in various types:",
|
|
5
5
|
"main": "./bin/index.js",
|
|
6
6
|
"types": "./bin/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"start": "node ./bin/server.js",
|
|
9
9
|
"build": "tsc",
|
|
10
|
-
"test": "jest --coverage --runInBand --forceExit"
|
|
10
|
+
"test": "jest --coverage --runInBand --forceExit",
|
|
11
|
+
"lint": "eslint ."
|
|
11
12
|
},
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
@@ -22,12 +23,16 @@
|
|
|
22
23
|
"winston": "^3.2.1"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^9.39.5",
|
|
25
27
|
"@types/babel__traverse": "^7.20.2",
|
|
26
28
|
"@types/jest": "^29.5.12",
|
|
29
|
+
"eslint": "^9.39.5",
|
|
30
|
+
"globals": "^15.15.0",
|
|
27
31
|
"jest": "^29.7.0",
|
|
28
32
|
"jest-junit": "^16.0.0",
|
|
29
33
|
"ts-jest": "^29.2.3",
|
|
30
|
-
"typescript": "^5.2.2"
|
|
34
|
+
"typescript": "^5.2.2",
|
|
35
|
+
"typescript-eslint": "^8.71.0"
|
|
31
36
|
},
|
|
32
37
|
"jest": {
|
|
33
38
|
"testEnvironment": "node",
|
package/src/index.ts
CHANGED
|
@@ -665,11 +665,14 @@ export default class Skins {
|
|
|
665
665
|
testSkin.push(populatedTableSkin);
|
|
666
666
|
}
|
|
667
667
|
} catch (error) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
668
|
+
// One event, one record — this used to be three separate calls (two
|
|
669
|
+
// warnings plus an error) for a single failure.
|
|
670
|
+
logger.error('Error occurred when building test steps', {
|
|
671
|
+
message: error.message,
|
|
672
|
+
suiteId: testSuite.suiteSkinData.fields[0].value,
|
|
673
|
+
testCaseHeader: testcase.testCaseHeaderSkinData.fields[0].value,
|
|
674
|
+
testCaseStepsSkinData: testcase.testCaseStepsSkinData,
|
|
675
|
+
});
|
|
673
676
|
aggregatedErrors.push(error.message);
|
|
674
677
|
}
|
|
675
678
|
|
|
@@ -93,9 +93,10 @@ export default class JSONTableCell {
|
|
|
93
93
|
runs = [...runs, ...jsonRun.getRun()];
|
|
94
94
|
}
|
|
95
95
|
} catch (e) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
// One event, one record — three separate calls used to interleave with other
|
|
97
|
+
// requests' output under concurrency and would have become three unrelated
|
|
98
|
+
// entries in the dashboard's error grouping instead of one.
|
|
99
|
+
logger.error('Error generating JSON cell', { message: e.message, data, typeOfDataValue: typeof data.value });
|
|
99
100
|
let jsonRun = new JSONRun('Docgen Error: Invalid data value', styles);
|
|
100
101
|
runs = [...runs, ...jsonRun.getRun()];
|
|
101
102
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// The one queryable-error-store event shape, emitted by DiagnosticsTransport (logger.ts).
|
|
4
|
+
// This package never installs a sink itself — it only reads whatever the host process
|
|
5
|
+
// (docgen-content-control's index.ts) installed. err is intentionally narrow —
|
|
6
|
+
// {message, code, stack} — per the settled Phase 6 schema decision: no generic
|
|
7
|
+
// extra-fields bucket.
|
|
8
|
+
export interface DiagnosticEvent {
|
|
9
|
+
ts: string;
|
|
10
|
+
level: string;
|
|
11
|
+
service: string;
|
|
12
|
+
version: string;
|
|
13
|
+
runId?: string;
|
|
14
|
+
docType?: string;
|
|
15
|
+
step?: string;
|
|
16
|
+
contentControlType?: string;
|
|
17
|
+
contentControlTitle?: string;
|
|
18
|
+
project?: string;
|
|
19
|
+
userId?: string;
|
|
20
|
+
message: string;
|
|
21
|
+
err?: { message: string; code?: string; stack?: string };
|
|
22
|
+
// Phase 6b — set on a debug/info event captured under retain-on-failure. Deleted by
|
|
23
|
+
// api-gate at the run's one success point; left alone (and thus permanent, subject to the
|
|
24
|
+
// normal TTL) if the run fails.
|
|
25
|
+
retainPending?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface LogSink {
|
|
29
|
+
push(event: DiagnosticEvent): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Symbol.for so this package's copy converges on the same installed sink as
|
|
33
|
+
// docgen-content-control's (the host process this package runs inside) and
|
|
34
|
+
// docgen-data-provider-package's, the same reasoning as runContext.ts's AsyncLocalStorage. A
|
|
35
|
+
// never-populated sink is a harmless no-op — this package only reads it, never installs one.
|
|
36
|
+
const KEY = Symbol.for("elisradevops.docgen.logSink");
|
|
37
|
+
|
|
38
|
+
export function getLogSink(): LogSink | undefined {
|
|
39
|
+
return (globalThis as Record<symbol, unknown>)[KEY] as LogSink | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function installLogSink(sink: LogSink): void {
|
|
43
|
+
(globalThis as Record<symbol, unknown>)[KEY] = sink;
|
|
44
|
+
}
|