@checkstack/healthcheck-jenkins-backend 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @checkstack/healthcheck-jenkins-backend
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0ebbe56]
8
+ - @checkstack/backend-api@0.8.1
9
+ - @checkstack/common@0.6.3
10
+ - @checkstack/healthcheck-common@0.8.3
11
+
12
+ ## 0.3.1
13
+
14
+ ### Patch Changes
15
+
16
+ - 869b4ab: ## Health Check Execution Improvements
17
+
18
+ ### Breaking Changes (backend-api)
19
+
20
+ - `HealthCheckStrategy.createClient()` now accepts `unknown` instead of `TConfig` due to TypeScript contravariance constraints. Implementations should use `this.config.validate(config)` to narrow the type.
21
+
22
+ ### Features
23
+
24
+ - **Platform-level hard timeout**: The executor now wraps the entire health check execution (connection + all collectors) in a single timeout, ensuring checks never hang indefinitely.
25
+ - **Parallel collector execution**: Collectors now run in parallel using `Promise.allSettled()`, improving performance while ensuring all collectors complete regardless of individual failures.
26
+ - **Base strategy config schema**: All strategy configs now extend `baseStrategyConfigSchema` which provides a standardized `timeout` field with sensible defaults (30s, min 100ms).
27
+
28
+ ### Fixes
29
+
30
+ - Fixed HTTP and Jenkins strategies clearing timeouts before reading the full response body.
31
+ - Simplified registry type signatures by using default type parameters.
32
+
33
+ - Updated dependencies [869b4ab]
34
+ - @checkstack/backend-api@0.8.0
35
+
3
36
  ## 0.3.0
4
37
 
5
38
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-jenkins-backend",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -10,9 +10,9 @@
10
10
  "test": "bun test"
11
11
  },
12
12
  "dependencies": {
13
- "@checkstack/backend-api": "0.5.2",
14
- "@checkstack/common": "0.6.1",
15
- "@checkstack/healthcheck-common": "0.8.1"
13
+ "@checkstack/backend-api": "0.8.0",
14
+ "@checkstack/common": "0.6.2",
15
+ "@checkstack/healthcheck-common": "0.8.2"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/bun": "^1.0.0",
package/src/strategy.ts CHANGED
@@ -11,9 +11,9 @@ import {
11
11
  mergeCounter,
12
12
  z,
13
13
  configString,
14
- configNumber,
15
14
  type ConnectedClient,
16
15
  type InferAggregatedResult,
16
+ baseStrategyConfigSchema,
17
17
  } from "@checkstack/backend-api";
18
18
  import {
19
19
  healthResultNumber,
@@ -35,7 +35,7 @@ import type {
35
35
  * Jenkins health check configuration schema.
36
36
  * Provides connectivity settings for the Jenkins API.
37
37
  */
38
- export const jenkinsConfigSchema = z.object({
38
+ export const jenkinsConfigSchema = baseStrategyConfigSchema.extend({
39
39
  baseUrl: z
40
40
  .string()
41
41
  .url()
@@ -46,11 +46,6 @@ export const jenkinsConfigSchema = z.object({
46
46
  apiToken: configString({ "x-secret": true }).describe(
47
47
  "Jenkins API token (generate from User > Configure > API Token)",
48
48
  ),
49
- timeout: configNumber({})
50
- .int()
51
- .min(1000)
52
- .default(30_000)
53
- .describe("Request timeout in milliseconds"),
54
49
  });
55
50
 
56
51
  export type JenkinsConfig = z.infer<typeof jenkinsConfigSchema>;
@@ -164,12 +159,11 @@ export class JenkinsHealthCheckStrategy implements HealthCheckStrategy<
164
159
  signal: controller.signal,
165
160
  });
166
161
 
167
- clearTimeout(timeoutId);
168
-
169
162
  // Get Jenkins version from header
170
163
  const jenkinsVersion = response.headers.get("X-Jenkins") || undefined;
171
164
 
172
165
  if (!response.ok) {
166
+ clearTimeout(timeoutId);
173
167
  return {
174
168
  statusCode: response.status,
175
169
  data: undefined,
@@ -178,8 +172,11 @@ export class JenkinsHealthCheckStrategy implements HealthCheckStrategy<
178
172
  };
179
173
  }
180
174
 
175
+ // Read body BEFORE clearing timeout - body streaming can also hang
181
176
  const data = await response.json();
182
177
 
178
+ clearTimeout(timeoutId);
179
+
183
180
  return {
184
181
  statusCode: response.status,
185
182
  data,