@checkstack/healthcheck-backend 0.10.7 → 0.12.0
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 +70 -0
- package/package.json +8 -8
- package/src/queue-executor.ts +15 -0
- package/src/router.test.ts +14 -0
- package/src/router.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @checkstack/healthcheck-backend
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 54a5f80: ### Health Check Editor Redesign — IDE-Style Experience
|
|
8
|
+
|
|
9
|
+
Replaces the modal-based health check editor with a full-page, IDE-style experience:
|
|
10
|
+
|
|
11
|
+
- **Strategy Picker Page**: New `/config/create` page with categorized strategy discovery, search filtering, and grouped card grid layout
|
|
12
|
+
- **IDE Editor Page**: New `/config/:configId/edit` page with a split-view layout — explorer tree on the left, editor panel on the right
|
|
13
|
+
- **Strategy Categories**: Introduces `StrategyCategory` enum with 16 categories (Networking, Database, Infrastructure, etc.) — all 13 strategy plugins now declare their category
|
|
14
|
+
- **New RPC Endpoint**: Added `getConfiguration` (singular by ID) for efficient single-resource fetching on the edit page
|
|
15
|
+
- **Explorer Tree**: Left-hand navigation with General, Check Items (collectors), and Access Control sections, with real-time validation indicators
|
|
16
|
+
- **Validation Status Bar**: Bottom bar showing aggregated validation issues with clickable navigation
|
|
17
|
+
- **Unsaved Changes Guard**: Browser `beforeunload` protection when the form is dirty
|
|
18
|
+
- **Responsive Design**: Split-view on desktop, stacked layout on mobile
|
|
19
|
+
- **Deleted**: Legacy `HealthCheckEditor.tsx` modal component
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [54a5f80]
|
|
24
|
+
- @checkstack/healthcheck-common@0.10.0
|
|
25
|
+
- @checkstack/backend-api@0.11.0
|
|
26
|
+
- @checkstack/catalog-backend@0.2.22
|
|
27
|
+
- @checkstack/command-backend@0.1.17
|
|
28
|
+
- @checkstack/integration-backend@0.1.17
|
|
29
|
+
- @checkstack/queue-api@0.2.11
|
|
30
|
+
|
|
31
|
+
## 0.11.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- 1f191cf: Add SYSTEM_STATUS_CHANGED signal and dependency-driven notification improvements
|
|
36
|
+
|
|
37
|
+
**healthcheck-common:**
|
|
38
|
+
|
|
39
|
+
- New `SYSTEM_STATUS_CHANGED` signal that fires only on system-level health status transitions (healthy ↔ degraded ↔ unhealthy), providing a low-noise alternative to `HEALTH_CHECK_RUN_COMPLETED` for coarse-grained reactivity
|
|
40
|
+
|
|
41
|
+
**healthcheck-backend:**
|
|
42
|
+
|
|
43
|
+
- Broadcast `SYSTEM_STATUS_CHANGED` signal at both status transition code paths in the queue executor
|
|
44
|
+
|
|
45
|
+
**healthcheck-frontend:**
|
|
46
|
+
|
|
47
|
+
- Switch `SystemHealthBadge` from `HEALTH_CHECK_RUN_COMPLETED` to `SYSTEM_STATUS_CHANGED` to reduce unnecessary refetch noise
|
|
48
|
+
|
|
49
|
+
**dashboard-frontend:**
|
|
50
|
+
|
|
51
|
+
- Switch `SystemBadgeDataProvider` from `HEALTH_CHECK_RUN_COMPLETED` to `SYSTEM_STATUS_CHANGED` for more efficient badge updates
|
|
52
|
+
|
|
53
|
+
**maintenance-frontend:**
|
|
54
|
+
|
|
55
|
+
- Clarify that notification suppression toggle also applies to downstream dependency-driven notifications
|
|
56
|
+
|
|
57
|
+
**incident-frontend:**
|
|
58
|
+
|
|
59
|
+
- Clarify that notification suppression toggle also applies to downstream dependency-driven notifications
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies [1f191cf]
|
|
64
|
+
- Updated dependencies [3f36a64]
|
|
65
|
+
- @checkstack/healthcheck-common@0.9.0
|
|
66
|
+
- @checkstack/catalog-common@1.3.0
|
|
67
|
+
- @checkstack/backend-api@0.10.1
|
|
68
|
+
- @checkstack/catalog-backend@0.2.21
|
|
69
|
+
- @checkstack/command-backend@0.1.16
|
|
70
|
+
- @checkstack/integration-backend@0.1.16
|
|
71
|
+
- @checkstack/queue-api@0.2.10
|
|
72
|
+
|
|
3
73
|
## 0.10.7
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/healthcheck-backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"checkstack": {
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"lint:code": "eslint . --max-warnings 0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@checkstack/backend-api": "0.
|
|
17
|
-
"@checkstack/catalog-backend": "0.2.
|
|
18
|
-
"@checkstack/catalog-common": "1.2.
|
|
19
|
-
"@checkstack/command-backend": "0.1.
|
|
16
|
+
"@checkstack/backend-api": "0.10.0",
|
|
17
|
+
"@checkstack/catalog-backend": "0.2.20",
|
|
18
|
+
"@checkstack/catalog-common": "1.2.11",
|
|
19
|
+
"@checkstack/command-backend": "0.1.15",
|
|
20
20
|
"@checkstack/common": "0.6.4",
|
|
21
21
|
"@checkstack/healthcheck-common": "0.8.4",
|
|
22
22
|
"@checkstack/incident-common": "0.4.6",
|
|
23
|
-
"@checkstack/integration-backend": "0.1.
|
|
23
|
+
"@checkstack/integration-backend": "0.1.15",
|
|
24
24
|
"@checkstack/maintenance-common": "0.4.8",
|
|
25
|
-
"@checkstack/queue-api": "0.2.
|
|
25
|
+
"@checkstack/queue-api": "0.2.9",
|
|
26
26
|
"@checkstack/signal-common": "0.1.8",
|
|
27
27
|
"@hono/zod-validator": "^0.7.6",
|
|
28
28
|
"drizzle-orm": "^0.45.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@checkstack/drizzle-helper": "0.0.4",
|
|
36
36
|
"@checkstack/scripts": "0.1.2",
|
|
37
|
-
"@checkstack/test-utils-backend": "0.1.
|
|
37
|
+
"@checkstack/test-utils-backend": "0.1.15",
|
|
38
38
|
"@checkstack/tsconfig": "0.0.4",
|
|
39
39
|
"@types/bun": "^1.0.0",
|
|
40
40
|
"@types/tdigest": "^0.1.5",
|
package/src/queue-executor.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { eq, and, max } from "drizzle-orm";
|
|
|
20
20
|
import { type SignalService } from "@checkstack/signal-common";
|
|
21
21
|
import {
|
|
22
22
|
HEALTH_CHECK_RUN_COMPLETED,
|
|
23
|
+
SYSTEM_STATUS_CHANGED,
|
|
23
24
|
type HealthCheckStatus,
|
|
24
25
|
stripEphemeralFields,
|
|
25
26
|
} from "@checkstack/healthcheck-common";
|
|
@@ -600,6 +601,13 @@ async function executeHealthCheckJob(props: {
|
|
|
600
601
|
logger,
|
|
601
602
|
});
|
|
602
603
|
|
|
604
|
+
// Broadcast system-level status change signal for frontend reactivity
|
|
605
|
+
await signalService.broadcast(SYSTEM_STATUS_CHANGED, {
|
|
606
|
+
systemId,
|
|
607
|
+
previousStatus: previousStatus as HealthCheckStatus,
|
|
608
|
+
newStatus: newState.status,
|
|
609
|
+
});
|
|
610
|
+
|
|
603
611
|
// Emit integration hooks for external integrations
|
|
604
612
|
const emitHook = getEmitHook();
|
|
605
613
|
if (emitHook) {
|
|
@@ -707,6 +715,13 @@ async function executeHealthCheckJob(props: {
|
|
|
707
715
|
logger,
|
|
708
716
|
});
|
|
709
717
|
|
|
718
|
+
// Broadcast system-level status change signal for frontend reactivity
|
|
719
|
+
await signalService.broadcast(SYSTEM_STATUS_CHANGED, {
|
|
720
|
+
systemId,
|
|
721
|
+
previousStatus: previousStatus as HealthCheckStatus,
|
|
722
|
+
newStatus: newState.status,
|
|
723
|
+
});
|
|
724
|
+
|
|
710
725
|
// Emit integration hooks for external integrations
|
|
711
726
|
const emitHook = getEmitHook();
|
|
712
727
|
if (emitHook) {
|
package/src/router.test.ts
CHANGED
|
@@ -66,6 +66,7 @@ describe("HealthCheck Router", () => {
|
|
|
66
66
|
id: "http",
|
|
67
67
|
displayName: "HTTP",
|
|
68
68
|
description: "Check HTTP",
|
|
69
|
+
category: "networking",
|
|
69
70
|
config: {
|
|
70
71
|
version: 1,
|
|
71
72
|
schema: z.object({}),
|
|
@@ -97,6 +98,19 @@ describe("HealthCheck Router", () => {
|
|
|
97
98
|
expect(Array.isArray(result.configurations)).toBe(true);
|
|
98
99
|
});
|
|
99
100
|
|
|
101
|
+
it("getConfiguration returns undefined for non-existent config", async () => {
|
|
102
|
+
const context = createMockRpcContext({
|
|
103
|
+
user: mockUser,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const result = await call(
|
|
107
|
+
router.getConfiguration,
|
|
108
|
+
{ id: "non-existent" },
|
|
109
|
+
{ context },
|
|
110
|
+
);
|
|
111
|
+
expect(result).toBeUndefined();
|
|
112
|
+
});
|
|
113
|
+
|
|
100
114
|
it("getCollectors returns collectors for strategy", async () => {
|
|
101
115
|
const mockCollector = {
|
|
102
116
|
qualifiedId: "collector-hardware.cpu",
|
package/src/router.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type CollectorRegistry,
|
|
9
9
|
} from "@checkstack/backend-api";
|
|
10
10
|
import { healthCheckContract } from "@checkstack/healthcheck-common";
|
|
11
|
+
import type { StrategyCategory } from "@checkstack/healthcheck-common";
|
|
11
12
|
import { HealthCheckService } from "./service";
|
|
12
13
|
import * as schema from "./schema";
|
|
13
14
|
import { toJsonSchemaWithChartMeta } from "./schema-utils";
|
|
@@ -37,6 +38,7 @@ export const createHealthCheckRouter = (
|
|
|
37
38
|
id: r.qualifiedId, // Return fully qualified ID
|
|
38
39
|
displayName: r.strategy.displayName,
|
|
39
40
|
description: r.strategy.description,
|
|
41
|
+
category: (r.strategy.category ?? "other") as StrategyCategory,
|
|
40
42
|
configSchema: toJsonSchema(r.strategy.config.schema),
|
|
41
43
|
resultSchema: r.strategy.result
|
|
42
44
|
? toJsonSchemaWithChartMeta(r.strategy.result.schema)
|
|
@@ -87,6 +89,10 @@ export const createHealthCheckRouter = (
|
|
|
87
89
|
return { configurations: await service.getConfigurations() };
|
|
88
90
|
}),
|
|
89
91
|
|
|
92
|
+
getConfiguration: os.getConfiguration.handler(async ({ input }) => {
|
|
93
|
+
return service.getConfiguration(input.id);
|
|
94
|
+
}),
|
|
95
|
+
|
|
90
96
|
createConfiguration: os.createConfiguration.handler(async ({ input }) => {
|
|
91
97
|
return service.createConfiguration(input);
|
|
92
98
|
}),
|