Commit 53e2657
authored
Reshade httphost (#964)
FYI @dadoonet, relating to #958
As httpcore is a transitive dependency that we don't want to conflict with user's libs, we unfortunately need to:
* roll back #959, where we disabled the shading of this module. As is, we're at risk of internal breakage when transitive deps clash.
* in turn, stop exposing `HttpHost` in our public API. We should take a general stance of keeping our public APIs free of transitive deps (especially shaded ones)
The API method in ElasticsearchContainer will thus change, from:
```java
public HttpHost getHost()
```
to:
```java
public String getHttpHostAddress()
```
Usage in turn changes from:
```java
RestClient client = RestClient.builder(container.getHost()).build();
```
to the slightly more verbose but equivalent:
```java
RestClient client = RestClient.builder(HttpHost.create(container.getHttpHostAddress())).build();
```
@bsideup, @kiview and I have discussed at length and concluded that this is the only approach that we're comfortable with - despite the fact that this raises an unfortunate breaking change in the API of the Elasticsearch module, which we reluctantly have to do.
We are sorry that we did not catch this particular issue at PR stage - we're going to upgrade our static analysis to guard against inadvertent leakage of shaded dependencies. In the longer term we also, obviously, wish to reduce the weight of our dependency chain, both unshaded and shaded, so that this does not happen again.
We intend for this change to go out as 1.10.1.
I hope this is OK with you @dadoonet - our apologies again for not catching this before release.1 parent a5ce244 commit 53e2657
File tree
4 files changed
+6
-5
lines changed- core
- modules/elasticsearch/src
- main/java/org/testcontainers/elasticsearch
- test/java/org/testcontainers/elasticsearch
4 files changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
60 | | - | |
| 58 | + | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
0 commit comments