Repository navigation
Commit 9f6138a
authored
fix(managed-agent): Share the home-expansion and spawn-environment rules of the compatibility evaluation (#12934)
* fix(managed-agent): Share the home-expansion and spawn-environment rules of the compatibility evaluation
Takes the non-blocking suggestions from the review and verification of
#12903.
- storage-paths-lite exports expandsAgainstHome. resolveConfigPathLite
and the evaluation share it, and a test pins the lite helper to core's
Storage.getGlobalQwenDir for every form of QWEN_HOME.
- passedEnvironment models what Node's spawn passes on: every enumerable
key, inherited ones included, whose value is not undefined, as a
string, and on Windows the first spelling of each name in sorted
order. It throws for an environment a session host would not receive
as it is: a missing one, a variable that cannot be read, a Symbol
value or a NUL byte, and a name that contains `=`.
- The evaluation reads the environment through it once, and every rule
reads that copy. The placeholder view leaves out names like an array
index, for which a host's process.env returns nothing, and on Windows
finds any spelling for lookups and `in` tests.
- The evaluation reads the environment and then the home directory,
resolving it as settings loading does, before it checks the locations,
and reports "the home directory or the environment could not be read"
when either fails.
- Two false compatible answers are gone: a name such as QWEN_HOME=alt,
which a host receives as QWEN_HOME=alt=home, is now unknown, and a
placeholder such as $0, which a host keeps as it is, now stays too.
- Both design docs describe the rules, gain the new row, and ask M6 to
spawn the hosts with the variables the evaluation read.
Part of #12737 and #12380.
* fix(managed-agent): Log why the home or environment could not be read, and share the home resolution
Takes the three suggestions of the /review on #12934 and closes the
oracle gap its triage raised.
- R1-1: the evaluation logs the error behind "the home directory or the
environment could not be read" through a debug logger, and the errors
passedEnvironment raises about a variable name it and leave its value
out.
- R1-2: settings.ts exports resolveHomeDirectory, which settings loading
and the evaluation both use, and a snapshot test pins that settings
loading throws when the home directory cannot be resolved.
- R1-3: readEnvironmentVariable documents that for process.env itself it
reads the current process's own value.
- A test spawns a real Node process and checks that it reads what the
view says, for inherited keys, null, empty and undefined values, two
spellings of one name and names like an array index.
Part of #12737 and #12380.1 parent a77d80d commit 9f6138a
8 files changed
Lines changed: 727 additions & 108 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
| |||
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| 383 | + | |
374 | 384 | | |
375 | 385 | | |
376 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
| 301 | + | |
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| |||
0 commit comments