Commit 47ea8a7
authored
Call resolveHostMetadata on Config init (#713)
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/databricks-sdk-java/pull/713/files/12f05320deaf1e2d96229e7bb280ecf7c59b25ce..f5a4892cb3877c74bd8cff5979a3a2d177d304ff)
to review incremental changes.
-
[hectorcast-db/stack/port-3-test-get-workspace-client-spog](#712)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/712/files)]
-
[**hectorcast-db/stack/port-4-resolve-metadata-on-init**](#713)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/713/files/12f05320deaf1e2d96229e7bb280ecf7c59b25ce..f5a4892cb3877c74bd8cff5979a3a2d177d304ff)]
-
[hectorcast-db/stack/port-5-token-audience-from-metadata](#714)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/714/files/f5a4892cb3877c74bd8cff5979a3a2d177d304ff..513d3f937652fe2a92564fddbb50a46b0527cf97)]
-
[hectorcast-db/stack/port-6-gcp-sa-nonblocking](#718)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/718/files/513d3f937652fe2a92564fddbb50a46b0527cf97..560f2173f1ac8880634d9ad874a72824903a91e9)]
-
[hectorcast-db/stack/port-7-integration-test-metadata](#719)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/719/files/560f2173f1ac8880634d9ad874a72824903a91e9..f79a3e876905d11de94c5f8c589b2af702397cd3)]
-
[hectorcast-db/stack/port-8-remove-unified-flag](#720)
[[Files
changed](https://github.com/databricks/databricks-sdk-java/pull/720/files/f79a3e876905d11de94c5f8c589b2af702397cd3..3c63fc8995cba2381947a52f485bef2cb17693a3)]
---------
## Summary
Port of Go SDK
[#1542](databricks/databricks-sdk-go#1542).
Calls `resolveHostMetadata()` during config `resolve()` to populate
`accountId`, `workspaceId`, and `discoveryUrl` from the host's
`/.well-known/databricks-config` endpoint. Failures are logged at debug
level and do not block initialization.
**Why:** Previously, host metadata was only resolved on explicit call.
Now it's resolved automatically during config init, so OIDC endpoints,
account IDs, and workspace IDs are populated from the authoritative
discovery endpoint.
**Changes:**
- `DatabricksConfig.innerResolve()`: calls `tryResolveHostMetadata()`
after HTTP client init
- `tryResolveHostMetadata()`: catches `Throwable` (not just Exception)
to handle mock assertion errors in tests
- `clone()`: skips static fields (needed for new Logger)
- Tests: FixtureServer-based tests updated to add
`/.well-known/databricks-config` fixture
`NO_CHANGELOG=true`
## Test plan
- [x] `DatabricksConfigTest`: 45+ tests pass
- [x] All 1086 tests pass1 parent 8182b4b commit 47ea8a7
File tree
2 files changed
+149
-24
lines changed- databricks-sdk-java/src
- main/java/com/databricks/sdk/core
- test/java/com/databricks/sdk/core
2 files changed
+149
-24
lines changedLines changed: 52 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
226 | 232 | | |
227 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
228 | 253 | | |
229 | 254 | | |
230 | 255 | | |
| |||
832 | 857 | | |
833 | 858 | | |
834 | 859 | | |
835 | | - | |
836 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
837 | 866 | | |
838 | 867 | | |
839 | 868 | | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | 869 | | |
844 | 870 | | |
845 | 871 | | |
846 | 872 | | |
847 | 873 | | |
848 | 874 | | |
849 | 875 | | |
| 876 | + | |
850 | 877 | | |
851 | 878 | | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | 879 | | |
| 880 | + | |
857 | 881 | | |
858 | 882 | | |
859 | 883 | | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
865 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
866 | 900 | | |
867 | 901 | | |
868 | 902 | | |
| |||
962 | 996 | | |
963 | 997 | | |
964 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
965 | 1003 | | |
966 | 1004 | | |
967 | 1005 | | |
| |||
Lines changed: 97 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| |||
514 | 516 | | |
515 | 517 | | |
516 | 518 | | |
517 | | - | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
518 | 523 | | |
519 | 524 | | |
520 | 525 | | |
| |||
541 | 546 | | |
542 | 547 | | |
543 | 548 | | |
544 | | - | |
| 549 | + | |
| 550 | + | |
545 | 551 | | |
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
549 | 555 | | |
550 | 556 | | |
551 | | - | |
552 | | - | |
553 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
554 | 561 | | |
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
558 | | - | |
| 565 | + | |
559 | 566 | | |
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
563 | 570 | | |
564 | | - | |
565 | | - | |
566 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
567 | 574 | | |
568 | 575 | | |
569 | 576 | | |
| |||
579 | 586 | | |
580 | 587 | | |
581 | 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 | + | |
582 | 669 | | |
583 | 670 | | |
584 | 671 | | |
| |||
0 commit comments