Commit 7d481f7
authored
fix(manifest): stream Coana output and surface the real failure reason (#1353)
* fix(manifest): stream Coana output and surface the real failure reason
`socket manifest {gradle,kotlin,scala}` delegate Socket facts generation to
the Coana CLI via spawnCoanaDlx, passing `{ stdio: 'inherit' }` so the
build-tool and Coana output streams to the user. On the dlx path that stdio
was silently dropped: shadowNpmBase configures the child's stdio from its
`options` arg, not the registry-spawn `extra` arg, so Coana ran piped and its
output — including the actual failure reason — never reached the user. A
generation failure then collapsed to an unhelpful
"Coana command failed (exit code 1): command failed" with no detail.
- spawnCoanaDlx now promotes the requested stdio (from spawnExtra, falling
back to options) into the dlx launcher options, aligning the dlx path with
the local-path and npm-install branches that already honor spawnExtra.stdio.
- buildDlxErrorResult falls back to captured stdout when stderr is empty,
since Coana logs some failures (e.g. unresolved dependencies) to stdout.
Add regression tests and bump the CLI to 1.1.115.
* fix(dlx): report launcher-vs-Coana failures honestly; stop muzzling the launcher
On the dlx path the spawned process is the package-manager launcher
(npx / pnpm dlx / yarn dlx), which downloads @coana-tech/cli and only then runs
it. A failure there may be the launcher dying before Coana ever started (e.g.
the package failed to download), yet buildDlxErrorResult always claimed "Coana
command failed", and `silent: true` (npm loglevel silent) hid npm's own
download/registry errors — so the user got a bare exit code with no cause and no
hint that Coana itself may never have run.
- buildDlxErrorResult now distinguishes three cases: Coana booted (banner seen)
-> "Coana command failed"; launcher died before Coana started (spawn error /
signal / exit >= 128) -> "Failed to launch Coana via the package manager ...";
ambiguous small-int exit -> neutral "Coana failed to run via the package
manager" (no false blame on Coana).
- Drop the forced `--silent` on the Coana launcher; shadowNpmBase still defaults
to `--loglevel error`, so real launcher/download errors surface while success
stays quiet.
- Factor the launcher-vs-Coana heuristic into dlxLauncherFailedBeforeCoana and
coanaBannerSeen, shared by shouldFallbackOnDlxError and the message builder.
Known gap: the npm-install + node fallback (#1327) still fires only for spawn
errors / signals / exit >= 128, not for a small-int exit. A broken npx that
exits 1 (common for download failures) is therefore not yet auto-recovered.
Add regression tests for the new wording and the un-muzzled launcher.
* fix(dlx): don't mislabel ambiguous Coana failures as launcher failures
Bugbot flagged that with stdio:'inherit' the spawn rejection carries no
captured output, so coanaBannerSeen is always false and a Coana process that
started then died by signal / exit >= 128 (e.g. OOM, exit 137) was wrongly
reported as "the launcher exited before Coana started".
Empirically, `coana manifest gradle` writes all output to stdout and never
prints the "Coana CLI version" banner, so banner-based detection never worked
for the manifest / reachability (inherit) paths anyway. Only a spawn-level
error (a string `code` like ENOENT) definitively proves the launcher never
started.
- buildDlxErrorResult now claims a launch failure ONLY for a spawn-level error;
signals and non-zero exits get neutral wording ("Coana failed to run via the
package manager (exit code N)") since we cannot tell launcher-vs-Coana apart
without captured output.
- Soften the fallback warning to drop the "before Coana started" claim (it
fires on the ambiguous >= 128 / signal cases too).
The npm-install + node fallback gating is unchanged (pre-existing #1327
behavior): it still retries on spawn errors / signals / exit >= 128. Fully
suppressing a retry when Coana actually ran would require capturing the
launcher output, which conflicts with live streaming (and the reachability
spinner); left as a possible follow-up.
Update tests for the definitive (ENOENT) vs ambiguous (signal / >= 128) split.1 parent e75b2d6 commit 7d481f7
4 files changed
Lines changed: 241 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
447 | 459 | | |
448 | 460 | | |
449 | 461 | | |
| |||
454 | 466 | | |
455 | 467 | | |
456 | 468 | | |
457 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
458 | 475 | | |
| 476 | + | |
459 | 477 | | |
460 | 478 | | |
461 | 479 | | |
| |||
484 | 502 | | |
485 | 503 | | |
486 | 504 | | |
487 | | - | |
| 505 | + | |
488 | 506 | | |
489 | 507 | | |
490 | 508 | | |
| |||
526 | 544 | | |
527 | 545 | | |
528 | 546 | | |
529 | | - | |
530 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
531 | 550 | | |
532 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
533 | 570 | | |
534 | 571 | | |
535 | 572 | | |
| |||
541 | 578 | | |
542 | 579 | | |
543 | 580 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
548 | 593 | | |
549 | 594 | | |
550 | 595 | | |
| |||
553 | 598 | | |
554 | 599 | | |
555 | 600 | | |
| 601 | + | |
556 | 602 | | |
557 | 603 | | |
558 | 604 | | |
| |||
564 | 610 | | |
565 | 611 | | |
566 | 612 | | |
567 | | - | |
568 | | - | |
569 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
570 | 636 | | |
571 | 637 | | |
572 | 638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| |||
396 | 399 | | |
397 | 400 | | |
398 | 401 | | |
399 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
413 | 418 | | |
414 | 419 | | |
415 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
416 | 427 | | |
417 | 428 | | |
418 | 429 | | |
419 | 430 | | |
420 | 431 | | |
421 | 432 | | |
422 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
423 | 470 | | |
424 | 471 | | |
425 | 472 | | |
| |||
518 | 565 | | |
519 | 566 | | |
520 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
521 | 677 | | |
0 commit comments