Commit fae9f0d
Use cfg.NewProvider() in run flags to respect enterprise provider factory (#4755)
* Use cfg.NewProvider() instead of cfg.NewDefaultProvider() in run flags
BuildRunnerConfig and configureMiddlewareAndOptions were loading app
config via cfg.NewDefaultProvider().GetConfig(), which always reads the
global singleton and bypasses any registered ProviderFactory. Enterprise
providers register a factory to merge OTEL config from an external
config-server; by skipping the factory, telemetry and usage-metrics
settings from that source were silently ignored on every `thv run`.
Switch both call sites to cfg.NewProvider().LoadOrCreateConfig(), which
checks registeredFactory first, then falls back to the default path for
non-enterprise deployments.
Add a unit test that exercises the LoadOrCreateConfig() path through a
PathProvider to document and guard the correct config-loading contract.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Address review: pass appConfig through, fix third NewDefaultProvider call
- Thread appConfig from BuildRunnerConfig into buildRunnerConfig and
configureMiddlewareAndOptions so config is loaded exactly once per run
instead of twice; eliminates the double I/O and the split-brain risk if
the backing store returns different snapshots between calls
- Pass the factory-aware configProvider into setupRuntimeAndValidation so
NewCLIEnvVarValidator also uses the provider from RegisterProviderFactory
instead of constructing a NewDefaultProvider that bypasses it
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix line length lint violation in setupRuntimeAndValidation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6cac96a commit fae9f0d
2 files changed
Lines changed: 58 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
322 | | - | |
| 326 | + | |
323 | 327 | | |
324 | 328 | | |
325 | 329 | | |
326 | 330 | | |
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
330 | | - | |
| 334 | + | |
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
| |||
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
356 | | - | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
406 | 410 | | |
407 | 411 | | |
408 | 412 | | |
409 | | - | |
410 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
411 | 418 | | |
412 | 419 | | |
413 | 420 | | |
| |||
417 | 424 | | |
418 | 425 | | |
419 | 426 | | |
420 | | - | |
421 | | - | |
| 427 | + | |
422 | 428 | | |
423 | 429 | | |
424 | 430 | | |
| |||
585 | 591 | | |
586 | 592 | | |
587 | 593 | | |
| 594 | + | |
588 | 595 | | |
589 | 596 | | |
590 | 597 | | |
| |||
666 | 673 | | |
667 | 674 | | |
668 | 675 | | |
669 | | - | |
| 676 | + | |
670 | 677 | | |
671 | 678 | | |
672 | 679 | | |
| |||
684 | 691 | | |
685 | 692 | | |
686 | 693 | | |
| 694 | + | |
687 | 695 | | |
688 | 696 | | |
689 | 697 | | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | 698 | | |
695 | 699 | | |
696 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 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 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
653 | 694 | | |
654 | 695 | | |
655 | 696 | | |
| |||
0 commit comments