1+ import Batching from '../../batching'
12import type { TelemetryDeps } from '../../telemetry-deps'
23import Identity from '../identity'
34import Machine from '../machine'
@@ -8,10 +9,10 @@ import { linuxFilesOf } from './linux-files-of'
89
910/**
1011 * Gathers what holds for the whole session through the nouns beneath: the
11- * variables, the global config, one machine probe, the directory, the remote .
12+ * variables, the global config, one machine probe, the directory, the engine .
1213 *
13- * Each read that fails leaves its part empty; the Linux files are read on
14- * Linux alone.
14+ * Each read that fails leaves its part empty, the engine's version saying so
15+ * once in the debug log; the Linux files are read on Linux alone.
1516 *
1617 * @param deps the calls on the nouns beneath
1718 * @param isInteractive whether a person is at the prompt
@@ -21,14 +22,23 @@ export async function probeOf(
2122 deps : TelemetryDeps ,
2223 isInteractive : boolean ,
2324) : Promise < Probe > {
24- const [ facts , signals , location , environment , cwd , repo ] = await Promise . all ( [
25- deps . facts ( ) ,
26- deps . deployment ( ) ,
27- deps . configLocation ( ) ,
28- deps . environment ( ) ,
29- deps . cwd ( ) . catch ( ( ) => undefined ) ,
30- deps . repo ( ) . catch ( ( ) => null ) ,
31- ] )
25+ const [ facts , signals , location , environment , cwd , repo , engine ] =
26+ await Promise . all ( [
27+ deps . facts ( ) ,
28+ deps . deployment ( ) ,
29+ deps . configLocation ( ) ,
30+ deps . environment ( ) ,
31+ deps . cwd ( ) . catch ( ( ) => undefined ) ,
32+ deps . repo ( ) . catch ( ( ) => null ) ,
33+ deps . version ( ) . catch ( ( error : unknown ) => {
34+ deps . debug (
35+ "telemetry: the engine's version is not readable here, so the " +
36+ `version columns stay empty (${ Batching . messageOf ( error ) } )` ,
37+ )
38+
39+ return undefined
40+ } ) ,
41+ ] )
3242
3343 const [ identity , machine , vcs , remoteHash ] = await Promise . all ( [
3444 Identity . identityOf ( deps . read , location , environment . userType === 'ant' ) ,
@@ -50,5 +60,6 @@ export async function probeOf(
5060 wslVersion : files . wslVersion ,
5161 vcs,
5262 remoteHash,
63+ engine,
5364 }
5465}
0 commit comments