@checkstack/backend 0.4.12 → 0.4.13

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,31 @@
1
1
  # @checkstack/backend
2
2
 
3
+ ## 0.4.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 869b4ab: ## Health Check Execution Improvements
8
+
9
+ ### Breaking Changes (backend-api)
10
+
11
+ - `HealthCheckStrategy.createClient()` now accepts `unknown` instead of `TConfig` due to TypeScript contravariance constraints. Implementations should use `this.config.validate(config)` to narrow the type.
12
+
13
+ ### Features
14
+
15
+ - **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.
16
+ - **Parallel collector execution**: Collectors now run in parallel using `Promise.allSettled()`, improving performance while ensuring all collectors complete regardless of individual failures.
17
+ - **Base strategy config schema**: All strategy configs now extend `baseStrategyConfigSchema` which provides a standardized `timeout` field with sensible defaults (30s, min 100ms).
18
+
19
+ ### Fixes
20
+
21
+ - Fixed HTTP and Jenkins strategies clearing timeouts before reading the full response body.
22
+ - Simplified registry type signatures by using default type parameters.
23
+
24
+ - Updated dependencies [869b4ab]
25
+ - @checkstack/backend-api@0.8.0
26
+ - @checkstack/queue-api@0.2.5
27
+ - @checkstack/signal-backend@0.1.11
28
+
3
29
  ## 0.4.12
4
30
 
5
31
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/backend",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "bun --env-file=../../.env --watch src/index.ts",
@@ -10,14 +10,14 @@
10
10
  "lint:code": "eslint . --max-warnings 0"
11
11
  },
12
12
  "dependencies": {
13
- "@checkstack/api-docs-common": "0.1.5",
14
- "@checkstack/auth-common": "0.5.4",
15
- "@checkstack/backend-api": "0.5.2",
16
- "@checkstack/common": "0.6.1",
13
+ "@checkstack/api-docs-common": "0.1.6",
14
+ "@checkstack/auth-common": "0.5.5",
15
+ "@checkstack/backend-api": "0.7.0",
16
+ "@checkstack/common": "0.6.2",
17
17
  "@checkstack/drizzle-helper": "0.0.3",
18
- "@checkstack/queue-api": "0.2.2",
19
- "@checkstack/signal-backend": "0.1.8",
20
- "@checkstack/signal-common": "0.1.5",
18
+ "@checkstack/queue-api": "0.2.4",
19
+ "@checkstack/signal-backend": "0.1.10",
20
+ "@checkstack/signal-common": "0.1.6",
21
21
  "@hono/zod-validator": "^0.7.6",
22
22
  "@orpc/client": "^1.13.2",
23
23
  "@orpc/openapi": "^1.13.2",
@@ -37,6 +37,6 @@
37
37
  "@types/bun": "latest",
38
38
  "@checkstack/tsconfig": "0.0.3",
39
39
  "@checkstack/scripts": "0.1.1",
40
- "@checkstack/test-utils-backend": "0.1.8"
40
+ "@checkstack/test-utils-backend": "0.1.10"
41
41
  }
42
42
  }
@@ -46,7 +46,7 @@ describe("HealthCheck Plugin Integration", () => {
46
46
  description: "A test strategy for integration testing",
47
47
  config: new Versioned({
48
48
  version: 1,
49
- schema: z.object({}),
49
+ schema: z.object({ timeout: z.number().default(30_000) }),
50
50
  }),
51
51
  result: new Versioned({
52
52
  version: 1,
@@ -30,7 +30,7 @@ describe("CoreHealthCheckRegistry", () => {
30
30
  description: "A test strategy",
31
31
  config: new Versioned({
32
32
  version: 1,
33
- schema: z.object({}),
33
+ schema: z.object({ timeout: z.number().default(30_000) }),
34
34
  }),
35
35
  result: new Versioned({
36
36
  version: 1,
@@ -52,7 +52,7 @@ describe("CoreHealthCheckRegistry", () => {
52
52
  description: "Another test strategy",
53
53
  config: new Versioned({
54
54
  version: 1,
55
- schema: z.object({}),
55
+ schema: z.object({ timeout: z.number().default(30_000) }),
56
56
  }),
57
57
  result: new Versioned({
58
58
  version: 1,
@@ -25,17 +25,21 @@ export class CoreHealthCheckRegistry {
25
25
  * Register a strategy with its owning plugin.
26
26
  * The strategy ID is stored as: ownerPluginId.strategyId
27
27
  */
28
- registerWithOwner(
29
- strategy: HealthCheckStrategy,
30
- ownerPlugin: PluginMetadata
28
+ registerWithOwner<S extends HealthCheckStrategy>(
29
+ strategy: S,
30
+ ownerPlugin: PluginMetadata,
31
31
  ): void {
32
32
  const qualifiedId = `${ownerPlugin.pluginId}.${strategy.id}`;
33
33
  if (this.strategies.has(qualifiedId)) {
34
34
  rootLogger.warn(
35
- `HealthCheckStrategy '${qualifiedId}' is already registered. Overwriting.`
35
+ `HealthCheckStrategy '${qualifiedId}' is already registered. Overwriting.`,
36
36
  );
37
37
  }
38
- this.strategies.set(qualifiedId, { strategy, ownerPlugin, qualifiedId });
38
+ this.strategies.set(qualifiedId, {
39
+ strategy: strategy as HealthCheckStrategy,
40
+ ownerPlugin,
41
+ qualifiedId,
42
+ });
39
43
  rootLogger.debug(`✅ Registered HealthCheckStrategy: ${qualifiedId}`);
40
44
  }
41
45
 
@@ -75,10 +79,10 @@ export class CoreHealthCheckRegistry {
75
79
  */
76
80
  export function createScopedHealthCheckRegistry(
77
81
  globalRegistry: CoreHealthCheckRegistry,
78
- ownerPlugin: PluginMetadata
82
+ ownerPlugin: PluginMetadata,
79
83
  ): HealthCheckRegistry {
80
84
  return {
81
- register(strategy: HealthCheckStrategy) {
85
+ register<S extends HealthCheckStrategy>(strategy: S) {
82
86
  globalRegistry.registerWithOwner(strategy, ownerPlugin);
83
87
  },
84
88
  getStrategy(id: string) {