@elisra-devops/docgen-data-provider 1.140.0 → 1.142.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.
Files changed (74) hide show
  1. package/.github/workflows/ci.yml +2 -0
  2. package/bin/helpers/requestContext.d.ts +51 -0
  3. package/bin/helpers/requestContext.js +218 -0
  4. package/bin/helpers/requestContext.js.map +1 -0
  5. package/bin/helpers/tfs.d.ts +5 -0
  6. package/bin/helpers/tfs.js +24 -24
  7. package/bin/helpers/tfs.js.map +1 -1
  8. package/bin/modules/GitDataProvider.js +3 -2
  9. package/bin/modules/GitDataProvider.js.map +1 -1
  10. package/bin/modules/JfrogDataProvider.js +3 -2
  11. package/bin/modules/JfrogDataProvider.js.map +1 -1
  12. package/bin/modules/PipelinesDataProvider.js +5 -4
  13. package/bin/modules/PipelinesDataProvider.js.map +1 -1
  14. package/bin/modules/ResultDataProvider.js +32 -25
  15. package/bin/modules/ResultDataProvider.js.map +1 -1
  16. package/bin/modules/TestDataProvider.js +4 -3
  17. package/bin/modules/TestDataProvider.js.map +1 -1
  18. package/bin/modules/TicketsDataProvider.js +26 -22
  19. package/bin/modules/TicketsDataProvider.js.map +1 -1
  20. package/bin/tests/helpers/requestContext.test.d.ts +1 -0
  21. package/bin/tests/helpers/requestContext.test.js +165 -0
  22. package/bin/tests/helpers/requestContext.test.js.map +1 -0
  23. package/bin/tests/helpers/tfs.test.js +54 -0
  24. package/bin/tests/helpers/tfs.test.js.map +1 -1
  25. package/bin/tests/modules/JfrogDataProvider.test.js +4 -2
  26. package/bin/tests/modules/JfrogDataProvider.test.js.map +1 -1
  27. package/bin/tests/modules/ResultDataProvider.test.js +9 -3
  28. package/bin/tests/modules/ResultDataProvider.test.js.map +1 -1
  29. package/bin/tests/modules/gitDataProvider.test.js +1 -1
  30. package/bin/tests/modules/gitDataProvider.test.js.map +1 -1
  31. package/bin/tests/modules/pipelineDataProvider.test.js +1 -1
  32. package/bin/tests/modules/pipelineDataProvider.test.js.map +1 -1
  33. package/bin/tests/modules/testDataProvider.test.js +1 -1
  34. package/bin/tests/modules/testDataProvider.test.js.map +1 -1
  35. package/bin/tests/modules/ticketsDataProvider.test.js +2 -2
  36. package/bin/tests/modules/ticketsDataProvider.test.js.map +1 -1
  37. package/bin/tests/utils/logger.test.d.ts +1 -0
  38. package/bin/tests/utils/logger.test.js +332 -0
  39. package/bin/tests/utils/logger.test.js.map +1 -0
  40. package/bin/tests/utils/runContext.test.d.ts +1 -0
  41. package/bin/tests/utils/runContext.test.js +51 -0
  42. package/bin/tests/utils/runContext.test.js.map +1 -0
  43. package/bin/utils/logSink.d.ts +39 -0
  44. package/bin/utils/logSink.js +28 -0
  45. package/bin/utils/logSink.js.map +1 -0
  46. package/bin/utils/logger.d.ts +7 -0
  47. package/bin/utils/logger.js +266 -27
  48. package/bin/utils/logger.js.map +1 -1
  49. package/bin/utils/runContext.d.ts +8 -0
  50. package/bin/utils/runContext.js +12 -0
  51. package/bin/utils/runContext.js.map +1 -0
  52. package/eslint.config.mjs +40 -0
  53. package/package.json +8 -3
  54. package/src/helpers/requestContext.ts +222 -0
  55. package/src/helpers/tfs.ts +30 -24
  56. package/src/modules/GitDataProvider.ts +3 -2
  57. package/src/modules/JfrogDataProvider.ts +3 -2
  58. package/src/modules/PipelinesDataProvider.ts +5 -4
  59. package/src/modules/ResultDataProvider.ts +31 -25
  60. package/src/modules/TestDataProvider.ts +4 -3
  61. package/src/modules/TicketsDataProvider.ts +28 -26
  62. package/src/tests/helpers/requestContext.test.ts +202 -0
  63. package/src/tests/helpers/tfs.test.ts +86 -0
  64. package/src/tests/modules/JfrogDataProvider.test.ts +5 -2
  65. package/src/tests/modules/ResultDataProvider.test.ts +10 -3
  66. package/src/tests/modules/gitDataProvider.test.ts +2 -1
  67. package/src/tests/modules/pipelineDataProvider.test.ts +2 -1
  68. package/src/tests/modules/testDataProvider.test.ts +4 -1
  69. package/src/tests/modules/ticketsDataProvider.test.ts +2 -2
  70. package/src/tests/utils/logger.test.ts +381 -0
  71. package/src/tests/utils/runContext.test.ts +48 -0
  72. package/src/utils/logSink.ts +59 -0
  73. package/src/utils/logger.ts +269 -29
  74. package/src/utils/runContext.ts +25 -0
@@ -1,35 +1,274 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagnosticsTransport = exports.redact = exports.withRunContext = void 0;
4
+ exports.redactValue = redactValue;
3
5
  const winston = require("winston");
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const Transport = require("winston-transport");
9
+ const runContext_1 = require("./runContext");
10
+ const logSink_1 = require("./logSink");
4
11
  let logger;
5
- const logFormat = winston.format.printf((info) => `${info.timestamp} - ${info.level}: ${info.message}`);
6
- // if (typeof window === "undefined") {
7
- // let logsPath = process.env.logs_path || "./logs/";
8
- // logger = winston.createLogger({
9
- // format: winston.format.timestamp(),
10
- // level: "silly",
11
- // transports: [
12
- // new winston.transports.File({
13
- // filename: `${logsPath}azure-rest-api-errors.log`,
14
- // level: "error",
15
- // format: logFormat,
16
- // }),
17
- // new winston.transports.File({
18
- // filename: `${logsPath}azure-rest-api-all.log`,
19
- // format: logFormat,
20
- // }),
21
- // new winston.transports.Console({ format: logFormat, level: "debug" }),
22
- // ],
23
- // });
24
- // } else {
12
+ // Merges the ambient runId (set by content-control's request middleware, once Phase 3 lands
13
+ // there) into every log record. A never-populated store is a harmless no-op — this package
14
+ // only reads it, never sets it.
15
+ exports.withRunContext = winston.format((info) => {
16
+ const store = runContext_1.runContextStore.getStore();
17
+ if (store === null || store === void 0 ? void 0 : store.runId)
18
+ info.runId = store.runId;
19
+ // Phase 7b — same ambient, per-run treatment as runId.
20
+ if (store === null || store === void 0 ? void 0 : store.docType)
21
+ info.docType = store.docType;
22
+ // Phase 7c — same read-only treatment; populated by content-control's attachRunContext.
23
+ if (store === null || store === void 0 ? void 0 : store.project)
24
+ info.project = store.project;
25
+ return info;
26
+ });
27
+ // Defense-in-depth: scrubs known-sensitive keys out of any object attached to a log call
28
+ // (meta, splat, an Error's own enumerable props — e.g. AxiosError.toJSON()'s
29
+ // config.auth.password / config.headers.Authorization, which is exactly how a PAT was
30
+ // leaking via `logger.error(JSON.stringify(error))` on ADO REST failures). Does not
31
+ // redact secrets interpolated into a message string — that's the corresponding call-site
32
+ // fixes' job; this is a backstop for structured fields.
33
+ // "accesskey" (not just "minioaccesskey") so this also catches an *AccessKeyId-style field —
34
+ // a real gap found in api-gate's copy during the Phase 5 manifest work: only the *SecretKey
35
+ // sibling was covered before, via "secret". Applied here too to keep the four copies in sync.
36
+ const SENSITIVE_KEY = /token|pat|password|secret|authorization|accesskey|minioaccesskey|miniosecretkey/i;
37
+ // A per-key try/catch on the *read*, not just around the whole loop: a getter that throws
38
+ // (e.g. `{ get boom() { throw ... } }`) would otherwise abort redaction for every remaining
39
+ // key in the same object, or — worse — survive redaction untouched and re-throw later, inside
40
+ // winston's json() formatter, which is not wrapped in anything. redactValue always returns a
41
+ // freshly built plain object/array, never the original reference, so once a value has passed
42
+ // through here nothing downstream can re-trigger a throwing accessor on it.
43
+ function safeRead(obj, key) {
44
+ try {
45
+ return { ok: true, value: obj[key] };
46
+ }
47
+ catch (_a) {
48
+ return { ok: false };
49
+ }
50
+ }
51
+ function redactValue(value, depth = 0, seen = new WeakSet()) {
52
+ if (depth > 6 || value === null || typeof value !== 'object')
53
+ return value;
54
+ if (seen.has(value))
55
+ return '[Circular]';
56
+ seen.add(value);
57
+ if (Array.isArray(value))
58
+ return value.map((v) => redactValue(v, depth + 1, seen));
59
+ const out = {};
60
+ for (const key of Object.keys(value)) {
61
+ const read = safeRead(value, key);
62
+ if (!read.ok) {
63
+ out[key] = '[Unreadable property]';
64
+ continue;
65
+ }
66
+ out[key] = SENSITIVE_KEY.test(key) ? '[REDACTED]' : redactValue(read.value, depth + 1, seen);
67
+ }
68
+ return out;
69
+ }
70
+ exports.redact = winston.format((info) => {
71
+ const target = info;
72
+ for (const key of Object.keys(target)) {
73
+ // level/timestamp are always plain strings winston sets itself — never touched. message is
74
+ // NOT exempt: when logger.error(x) is called with a single non-string/non-Error argument,
75
+ // winston nests the whole thing under info.message (this is exactly the shape hit by a raw
76
+ // object argument), so message can carry a throwing getter or a sensitive key just as much
77
+ // as any other field — redactValue already no-ops on a plain string, so including it here
78
+ // costs nothing for the common case and closes that gap for the uncommon one.
79
+ if (key === 'level' || key === 'timestamp')
80
+ continue;
81
+ const read = safeRead(target, key);
82
+ const value = !read.ok
83
+ ? '[Unreadable property]'
84
+ : // A top-level primitive (e.g. token: "abc") has no children for redactValue to walk into —
85
+ // the key itself has to be checked here too, not just inside the recursive object walk.
86
+ SENSITIVE_KEY.test(key)
87
+ ? '[REDACTED]'
88
+ : redactValue(read.value);
89
+ try {
90
+ target[key] = value;
91
+ }
92
+ catch (_a) {
93
+ // The original property could be a getter-only accessor with no setter, which throws on
94
+ // plain assignment in strict mode — redefine it outright rather than skip it.
95
+ Object.defineProperty(target, key, { value, writable: true, enumerable: true, configurable: true });
96
+ }
97
+ }
98
+ return info;
99
+ });
100
+ // Resolves the package's own version for defaultMeta. Node-only (this package is currently
101
+ // only ever consumed by docgen-content-control at runtime — the browser transport below is
102
+ // unused/commented out), so fs/path are safe here.
103
+ function readOwnVersion() {
104
+ const candidates = [
105
+ path.resolve(__dirname, '../package.json'),
106
+ path.resolve(__dirname, '../../package.json'),
107
+ path.resolve(process.cwd(), 'package.json'),
108
+ ];
109
+ for (const candidate of candidates) {
110
+ try {
111
+ if (!fs.existsSync(candidate))
112
+ continue;
113
+ return JSON.parse(fs.readFileSync(candidate, 'utf8')).version || 'unknown';
114
+ }
115
+ catch (_a) {
116
+ // try next candidate
117
+ }
118
+ }
119
+ return 'unknown';
120
+ }
121
+ // A template literal's implicit ToString throws on a Symbol value (unlike String(), which
122
+ // calls Symbol.prototype.toString() explicitly) — logger.error(Symbol('x')) would otherwise
123
+ // crash inside this formatter itself, the one place in the pipeline with no try/catch around
124
+ // it. Symbol.toString() itself never throws, so this needs no further guarding.
125
+ const safeMessageString = (value) => typeof value === 'symbol' ? value.toString() : String(value);
126
+ // A failed ADO request's description (helpers/requestContext.ts), attached to the thrown error
127
+ // and merged onto the record by winston. In text mode — the default, which prints only the
128
+ // message — this is the only way the URL reaches stdout for a record whose own message doesn't
129
+ // carry it. Never throws: this runs inside the formatter, which has no try/catch around it.
130
+ const requestSuffix = (ctx) => {
131
+ try {
132
+ if (!ctx || typeof ctx !== 'object')
133
+ return '';
134
+ const c = ctx;
135
+ if (typeof c.url !== 'string')
136
+ return '';
137
+ const method = typeof c.method === 'string' ? `${c.method} ` : '';
138
+ const status = typeof c.status === 'number' ? ` -> ${c.status}` : '';
139
+ return ` [${method}${c.url}${status}]`;
140
+ }
141
+ catch (_a) {
142
+ return '';
143
+ }
144
+ };
145
+ const textFormat = winston.format.printf((info) => `${info.timestamp} - ${info.level}: ${safeMessageString(info.message)}${requestSuffix(info.adoRequest)}`);
146
+ // Bounded so one oversized message/stack can't produce an unbounded LogEvent document.
147
+ const MAX_MESSAGE_LEN = 2000;
148
+ const MAX_STACK_LEN = 4000;
149
+ function clamp(value, max) {
150
+ if (typeof value !== 'string')
151
+ return undefined;
152
+ return value.length > max ? value.slice(0, max) : value;
153
+ }
154
+ // Re-validates the request description at the transport instead of trusting its shape — it
155
+ // arrives via an Error's own properties, which anything upstream could have set. Allowlisted
156
+ // keys only, each type-checked and bounded.
157
+ function pickContext(raw) {
158
+ if (!raw || typeof raw !== 'object')
159
+ return undefined;
160
+ const c = raw;
161
+ const context = {};
162
+ const method = clamp(c.method, logSink_1.CONTEXT_LIMITS.method);
163
+ const url = clamp(c.url, logSink_1.CONTEXT_LIMITS.url);
164
+ const requestBody = clamp(c.requestBody, logSink_1.CONTEXT_LIMITS.requestBody);
165
+ const responseExcerpt = clamp(c.responseExcerpt, logSink_1.CONTEXT_LIMITS.responseExcerpt);
166
+ if (method)
167
+ context.method = method;
168
+ if (url)
169
+ context.url = url;
170
+ if (requestBody)
171
+ context.requestBody = requestBody;
172
+ if (responseExcerpt)
173
+ context.responseExcerpt = responseExcerpt;
174
+ if (typeof c.status === 'number' && Number.isFinite(c.status))
175
+ context.status = c.status;
176
+ if (typeof c.attempt === 'number' && Number.isFinite(c.attempt))
177
+ context.attempt = c.attempt;
178
+ return Object.keys(context).length ? context : undefined;
179
+ }
180
+ // Ships warn/error records to whatever LogSink the host process (docgen-content-control's
181
+ // index.ts) has installed — this package never installs one itself, only reads it. This is
182
+ // the dominant source of real ADO error records (tfs.ts's executeWithRetry is the single
183
+ // static axios instance handling all Azure DevOps traffic), so without this transport most
184
+ // real generation failures either never reach the store or get misattributed to
185
+ // dg-content-control. Reads info *after* the rest of the format chain has already run —
186
+ // redact() has already scrubbed it by the time this transport sees it. Never throws, never
187
+ // blocks the call path, and never logs through `logger` itself (that would recurse back
188
+ // into this same transport) — failures go to console.error only.
189
+ const DIAGNOSTICS_CAPTURE_ENABLED = (process.env.DIAGNOSTICS_CAPTURE_ENABLED || 'true').toLowerCase() !== 'false';
190
+ // Exported for tests, the same treatment as redact()/withRunContext() — so a test pipeline
191
+ // can exercise this transport without going through the real singleton logger's env-gated
192
+ // json()/textFormat branch.
193
+ class DiagnosticsTransport extends Transport {
194
+ log(info, callback) {
195
+ var _a, _b, _c, _d, _e;
196
+ setImmediate(() => this.emit('logged', info));
197
+ try {
198
+ const level = info.level;
199
+ const isWarnOrError = level === 'warn' || level === 'error';
200
+ // Phase 6b — the logger's own level gate is now 'debug' (see createLogger below), so a
201
+ // debug/info call reaches this transport regardless of mode; this is the one place that
202
+ // decides whether it's actually persisted, keyed off the per-run capture mode rather
203
+ // than a process-wide setting — concurrent runs in 'normal' mode are unaffected by a
204
+ // sibling run's 'verbose'/'retain-on-failure' opt-in.
205
+ const captureMode = (_a = runContext_1.runContextStore.getStore()) === null || _a === void 0 ? void 0 : _a.captureMode;
206
+ const isCapturedDebugOrInfo = (level === 'debug' || level === 'info') && (captureMode === 'verbose' || captureMode === 'retain-on-failure');
207
+ if (DIAGNOSTICS_CAPTURE_ENABLED && (isWarnOrError || isCapturedDebugOrInfo)) {
208
+ // winston.errors({stack:true}) merges an Error's own enumerable properties (stack,
209
+ // and anything else the call site set, e.g. `err.code`) directly onto `info` — there
210
+ // is no separate nested info.err. `info.stack`'s presence is the only reliable signal
211
+ // that this record came from `logger.error('...', err)`/`logger.error(err)` rather
212
+ // than a plain string message. When present, info.message is already the
213
+ // stable-message-plus-error-message string winston produced, so err.message reuses it.
214
+ const hasErr = typeof info.stack === 'string';
215
+ const message = (_b = clamp(info.message, MAX_MESSAGE_LEN)) !== null && _b !== void 0 ? _b : '';
216
+ const event = {
217
+ ts: typeof info.timestamp === 'string' ? info.timestamp : new Date().toISOString(),
218
+ level: String(info.level),
219
+ service: String((_c = info.service) !== null && _c !== void 0 ? _c : '@elisra-devops/docgen-data-provider'),
220
+ version: String((_d = info.version) !== null && _d !== void 0 ? _d : 'unknown'),
221
+ runId: typeof info.runId === 'string' ? info.runId : undefined,
222
+ docType: typeof info.docType === 'string' ? info.docType : undefined,
223
+ step: typeof info.step === 'string' ? info.step : undefined,
224
+ contentControlType: typeof info.contentControlType === 'string' ? info.contentControlType : undefined,
225
+ contentControlTitle: typeof info.contentControlTitle === 'string' ? info.contentControlTitle : undefined,
226
+ project: typeof info.project === 'string' ? info.project : undefined,
227
+ userId: typeof info.userId === 'string' ? info.userId : undefined,
228
+ message,
229
+ err: hasErr
230
+ ? {
231
+ message,
232
+ code: typeof info.code === 'string' ? info.code : undefined,
233
+ stack: clamp(info.stack, MAX_STACK_LEN),
234
+ }
235
+ : undefined,
236
+ context: pickContext(info.adoRequest),
237
+ retainPending: !isWarnOrError && captureMode === 'retain-on-failure' ? true : undefined,
238
+ };
239
+ (_e = (0, logSink_1.getLogSink)()) === null || _e === void 0 ? void 0 : _e.push(event);
240
+ }
241
+ }
242
+ catch (e) {
243
+ // eslint-disable-next-line no-console
244
+ console.error('DiagnosticsTransport failed to push event', e);
245
+ }
246
+ callback();
247
+ }
248
+ }
249
+ exports.DiagnosticsTransport = DiagnosticsTransport;
250
+ // LOG_FORMAT=json is the eventual default (structured stdout a collector can parse), but
251
+ // stays opt-in for one release so switching is a config change, not an image rebuild, if
252
+ // anyone reading raw console output needs to roll back.
253
+ const useJson = (process.env.LOG_FORMAT || 'text').toLowerCase() === 'json';
254
+ // Phase 6b — the Logger's own level gate must be 'debug' (winston's most permissive) so a
255
+ // debug/info call always reaches every transport's log(); a static per-logger level can't
256
+ // depend on the ALS store's per-run capture mode, so DiagnosticsTransport has to be the one
257
+ // deciding what's actually persisted. The Console transport below gets its own explicit
258
+ // level so stdout's default behavior (info/warn/error unless LOG_LEVEL=debug) is unchanged —
259
+ // this only spends the format-chain cost on debug() calls that previously short-circuited
260
+ // for free; info/warn/error volume (Phase 4's focus) is unaffected either way.
261
+ const CONSOLE_LOG_LEVEL = process.env.LOG_LEVEL || 'info';
25
262
  logger = winston.createLogger({
26
- format: winston.format.timestamp(),
27
- level: 'silly',
28
- transports: [
29
- new winston.transports.Console({ format: logFormat, level: 'debug' }),
30
- // new BrowserConsole({ format: logFormat, level: 'debug' }),
31
- ],
263
+ level: 'debug',
264
+ defaultMeta: { service: '@elisra-devops/docgen-data-provider', version: readOwnVersion() },
265
+ format: useJson
266
+ ? winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), (0, exports.withRunContext)(), (0, exports.redact)(), winston.format.splat(), winston.format.json())
267
+ : winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), (0, exports.withRunContext)(), (0, exports.redact)(), winston.format.splat(), textFormat),
268
+ // Stdout only — no File transports, consistent with the other DocGen services (no mounted
269
+ // log volume anywhere in this deployment, so a File transport is invisible to `kubectl logs`
270
+ // and can throw at import time under a read-only root filesystem).
271
+ transports: [new winston.transports.Console({ level: CONSOLE_LOG_LEVEL }), new DiagnosticsTransport()],
32
272
  });
33
- // }
34
273
  exports.default = logger;
35
274
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,mCAAmC;AAEnC,IAAI,MAAsB,CAAC;AAE3B,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AACxG,uCAAuC;AACvC,uDAAuD;AAEvD,oCAAoC;AACpC,0CAA0C;AAC1C,sBAAsB;AACtB,oBAAoB;AACpB,sCAAsC;AACtC,4DAA4D;AAC5D,0BAA0B;AAC1B,6BAA6B;AAC7B,YAAY;AACZ,sCAAsC;AACtC,yDAAyD;AACzD,6BAA6B;AAC7B,YAAY;AACZ,+EAA+E;AAC/E,SAAS;AACT,QAAQ;AACR,WAAW;AACX,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE;IAClC,KAAK,EAAE,OAAO;IACd,UAAU,EAAE;QACV,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACrE,6DAA6D;KAC9D;CACF,CAAC,CAAC;AACH,IAAI;AAEJ,kBAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AA8Cb,kCAeC;AA5DD,mCAAmC;AACnC,yBAAyB;AACzB,6BAA6B;AAC7B,+CAA+C;AAC/C,6CAA+C;AAC/C,uCAAwE;AACxE,IAAI,MAAsB,CAAC;AAE3B,4FAA4F;AAC5F,2FAA2F;AAC3F,gCAAgC;AACnB,QAAA,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;IACpD,MAAM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} from 'async_hooks';
2
+ export interface RunContext {
3
+ runId: string;
4
+ captureMode?: 'verbose' | 'retain-on-failure';
5
+ docType?: string;
6
+ project?: string;
7
+ }
8
+ export declare const runContextStore: AsyncLocalStorage<RunContext>;
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.runContextStore = void 0;
5
+ const async_hooks_1 = require("async_hooks");
6
+ // Symbol.for uses the global symbol registry, so every duplicated copy of this file across
7
+ // the DocGen packages — hoisted or nested at any depth by npm — converges on the same
8
+ // AsyncLocalStorage instance. Keying by module identity instead would silently split into
9
+ // two stores and runId would go missing with no visible error.
10
+ const KEY = Symbol.for('elisradevops.docgen.runContext');
11
+ exports.runContextStore = (_a = globalThis[KEY]) !== null && _a !== void 0 ? _a : (globalThis[KEY] = new async_hooks_1.AsyncLocalStorage());
12
+ //# sourceMappingURL=runContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runContext.js","sourceRoot":"","sources":["../../src/utils/runContext.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;AACb,6CAAgD;AAehD,2FAA2F;AAC3F,sFAAsF;AACtF,0FAA0F;AAC1F,+DAA+D;AAC/D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAE5C,QAAA,eAAe,GAC1B,MAAE,UAAsC,CAAC,GAAG,CAA+C,mCAC3F,CAAE,UAAsC,CAAC,GAAG,CAAC,GAAG,IAAI,+BAAiB,EAAc,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@elisra-devops/docgen-data-provider",
3
- "version": "1.140.0",
3
+ "version": "1.142.0",
4
4
  "description": "A document generator data provider, aimed to retrive data from azure devops",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,9 +11,11 @@
11
11
  "types": "./bin/index.d.ts",
12
12
  "scripts": {
13
13
  "test": "jest --coverage --runInBand --forceExit",
14
- "build": "tsc"
14
+ "build": "tsc",
15
+ "lint": "eslint ."
15
16
  },
16
17
  "devDependencies": {
18
+ "@eslint/js": "^9.39.5",
17
19
  "@types/babel__generator": "^7.6.8",
18
20
  "@types/babel__template": "^7.4.4",
19
21
  "@types/caseless": "^0.12.5",
@@ -24,11 +26,14 @@
24
26
  "@types/yargs-parser": "^21.0.3",
25
27
  "baseline-browser-mapping": "^2.9.0",
26
28
  "dotenv": "^16.4.5",
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
  "npm": "^10.8.2",
30
34
  "ts-jest": "^29.2.3",
31
- "typescript": "^5.5.4"
35
+ "typescript": "^5.5.4",
36
+ "typescript-eslint": "^8.71.0"
32
37
  },
33
38
  "dependencies": {
34
39
  "@types/xml2js": "^0.4.5",