Skip to content

Commit adea0bc

Browse files
authored
Merge pull request #244 from reportportal/develop
Release 5.5.5
2 parents c16e3fe + 7cf69cc commit adea0bc

File tree

6 files changed

+187
-82
lines changed

6 files changed

+187
-82
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### Changed
2+
- HTTP retries delay calculation to use exponential backoff strategy with jitter.
3+
- HTTP retries condition to retry on axios timeout errors.
4+
- http/https agents now use `keep-alive` by default.
15

26
## [5.5.4] - 2025-11-13
37
### Fixed

README.md

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,31 @@ rpClient.checkConnect().then(() => {
119119
| headers | Optional | {} | The object with custom headers for internal http client. |
120120
| debug | Optional | false | This flag allows seeing the logs of the client. Useful for debugging. |
121121
| isLaunchMergeRequired | Optional | false | Allows client to merge launches into one at the end of the run via saving their UUIDs to the temp files at filesystem. At the end of the run launches can be merged using `mergeLaunches` method. Temp file format: `rplaunch-${launch_uuid}.tmp`. |
122-
| restClientConfig | Optional | Not set | `axios` like http client [config](https://github.com/axios/axios#request-config). Supports `proxy` and `noProxy` for proxy configuration (see [Proxy configuration](#proxy-configuration)), `agent` property for [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client options, `timeout`, `debug: true` for debugging, and `retry` property (number or [`axios-retry`](https://github.com/softonic/axios-retry#options) config) for automatic retries. |
122+
| restClientConfig | Optional | Not set | Check the details in the [HTTP client config](#http-client-options). |
123123
| launchUuidPrint | Optional | false | Whether to print the current launch UUID. |
124124
| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`. |
125125
| token | Deprecated | Not set | Use `apiKey` or `oauth` instead. |
126126

127-
## Asynchronous reporting
127+
### HTTP client options
128128

129-
The client supports an asynchronous reporting (via the ReportPortal asynchronous API).
130-
If you want the client to report through the asynchronous API, change `v1` to `v2` in the `endpoint` address.
129+
`axios` like http client [config](https://github.com/axios/axios#request-config).
131130

132-
## API
133-
134-
Each method (except checkConnect) returns an object in a specific format:
135-
```javascript
136-
{
137-
tempId: '4ds43fs', // generated by the client id for further work with the created item
138-
promise: Promise // An object indicating the completion of an operation
139-
}
140-
```
141-
The client works synchronously, so it is not necessary to wait for the end of the previous requests to send following ones.
142-
143-
### Timeout (30000ms) on axios requests
131+
#### Timeout (30000ms) on axios requests
144132

145133
There is a timeout on axios requests. If for instance the server your making a request to is taking too long to load, then axios timeout will work and you will see the error 'Error: timeout of 30000ms exceeded'.
146134

147135
You can simply change this timeout by adding a `timeout` property to `restClientConfig` with your desired numeric value (in _ms_) or *0* to disable it.
148136

149-
### Retry configuration
137+
#### Debug
138+
139+
Use `debug: true` for debugging.
140+
141+
#### Agent
142+
143+
Use `agent` property to provide [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) agent options.
144+
Use this property in case the direct `httpAgent/httpsAgent` instance property cannot be used due to config serializations.
145+
146+
#### Retry configuration
150147

151148
The client retries failed HTTP calls up to 6 times with an exponential backoff (starting at 200 ms and capping at 5 s) and resets the axios timeout before each retry. Provide a `retry` option in `restClientConfig` to change that behaviour. The value can be either a number (overriding just the retry count) or a full [`axios-retry` configuration object](https://github.com/softonic/axios-retry#options):
152149

@@ -166,13 +163,13 @@ const client = new RPClient({
166163

167164
Setting `retry: 0` disables automatic retries.
168165

169-
### Proxy configuration
166+
#### Proxy configuration
170167

171168
The client supports comprehensive proxy configuration for both HTTP and HTTPS requests, including ReportPortal API calls and OAuth token requests. Proxy settings can be configured via `restClientConfig` or environment variables.
172169

173-
#### Basic proxy configuration
170+
##### Basic proxy configuration
174171

175-
##### Via configuration object
172+
###### Via configuration object
176173

177174
```javascript
178175
const RPClient = require('@reportportal/client-javascript');
@@ -197,7 +194,7 @@ const rpClient = new RPClient({
197194
});
198195
```
199196

200-
##### Via proxy URL string
197+
###### Via proxy URL string
201198

202199
```javascript
203200
const rpClient = new RPClient({
@@ -208,7 +205,7 @@ const rpClient = new RPClient({
208205
});
209206
```
210207

211-
##### Via environment variables
208+
###### Via environment variables
212209

213210
The client automatically detects and uses proxy environment variables:
214211

@@ -218,7 +215,7 @@ export HTTP_PROXY=http://127.0.0.1:8080
218215
export NO_PROXY=localhost,127.0.0.1,.local
219216
```
220217

221-
#### Bypassing proxy for specific domains (noProxy)
218+
##### Bypassing proxy for specific domains (noProxy)
222219

223220
Use the `noProxy` option to exclude specific domains from being proxied. This is useful when some services are accessible directly while others require a proxy.
224221

@@ -245,7 +242,7 @@ const rpClient = new RPClient({
245242

246243
**Priority:** Configuration `noProxy` takes precedence over `NO_PROXY` environment variable.
247244

248-
#### Proxy with OAuth authentication
245+
##### Proxy with OAuth authentication
249246

250247
When using OAuth authentication, the proxy configuration is automatically applied to both:
251248
- OAuth token endpoint requests
@@ -273,17 +270,17 @@ const rpClient = new RPClient({
273270
});
274271
```
275272

276-
#### Advanced proxy scenarios
273+
##### Advanced proxy scenarios
277274

278-
##### Disable proxy explicitly
275+
###### Disable proxy explicitly
279276

280277
```javascript
281278
restClientConfig: {
282279
proxy: false // Disable proxy even if environment variables are set
283280
}
284281
```
285282

286-
##### Debug proxy configuration
283+
###### Debug proxy configuration
287284

288285
Enable debug mode to see detailed proxy decision logs:
289286

@@ -308,7 +305,7 @@ Debug output example:
308305
Proxy URL: https://127.0.0.1:8080
309306
```
310307

311-
#### Proxy configuration options
308+
##### Proxy configuration options
312309

313310
| Option | Type | Description |
314311
|---------------------|------------------------------|-------------------------------------------------------------------------------------------------|
@@ -321,14 +318,30 @@ Debug output example:
321318
| `proxy.auth.password` | `string` | Proxy password |
322319
| `noProxy` | `string` | Comma-separated list of domains to bypass proxy |
323320

324-
#### How proxy handling works
321+
##### How proxy handling works
325322

326323
1. **Per-request proxy decision:** Each request (API or OAuth) determines its proxy configuration based on the target URL
327324
2. **noProxy checking:** URLs matching `noProxy` patterns bypass the proxy and connect directly
328325
3. **Default agents for bypassed URLs:** When a URL bypasses proxy, a default HTTP/HTTPS agent is used to prevent automatic proxy detection
329326
4. **Environment variable support:** `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are automatically detected and used if no explicit configuration is provided
330327
5. **Priority:** Explicit configuration takes precedence over environment variables
331328

329+
## Asynchronous reporting
330+
331+
The client supports an asynchronous reporting (via the ReportPortal asynchronous API).
332+
If you want the client to report through the asynchronous API, change `v1` to `v2` in the `endpoint` address.
333+
334+
## API
335+
336+
Each method (except checkConnect) returns an object in a specific format:
337+
```javascript
338+
{
339+
tempId: '4ds43fs', // generated by the client id for further work with the created item
340+
promise: Promise // An object indicating the completion of an operation
341+
}
342+
```
343+
The client works synchronously, so it is not necessary to wait for the end of the previous requests to send following ones.
344+
332345
### checkConnect
333346

334347
`checkConnect` - asynchronous method for verifying the correctness of the client connection

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5.4
1+
5.5.5-SNAPSHOT

0 commit comments

Comments
 (0)