@checkstack/dependency-frontend 0.5.5 → 0.5.7

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,65 @@
1
1
  # @checkstack/dependency-frontend
2
2
 
3
+ ## 0.5.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 0b6f01b: feat(dependency): contribute dependency warnings to the backend system.issues aggregator
8
+
9
+ The dependency plugin now registers a `system.issues` contributor (sourceId
10
+ `dependency`) from its backend `init`, so the AI assistant surfaces upstream
11
+ dependency problems alongside incidents, SLOs, health checks, and anomalies.
12
+
13
+ The contributor enforces its own `dependency.read` access gate (returning an
14
+ empty map - never throwing - when the principal lacks access; service users are
15
+ trusted), then evaluates dependency warnings for every system that participates
16
+ in a dependency edge by reading the shared, durable `dependencies` table. The
17
+ answer is therefore identical on every pod. Only systems with an actual warning
18
+ appear in the result.
19
+
20
+ The row->signal mapping (source/tone/label/detail/href/accessRule/iconName) is
21
+ extracted into a new pure `deriveDependencySignals` deriver in
22
+ `@checkstack/dependency-common`, shared by both the backend contributor and the
23
+ frontend `DependencySignalsFiller` so the two surfaces stay in lockstep. The
24
+ frontend filler now delegates to that deriver with unchanged behavior.
25
+
26
+ - Updated dependencies [0b6f01b]
27
+ - Updated dependencies [0b6f01b]
28
+ - @checkstack/dependency-common@1.3.0
29
+ - @checkstack/healthcheck-common@1.6.0
30
+ - @checkstack/dashboard-frontend@0.8.6
31
+
32
+ ## 0.5.6
33
+
34
+ ### Patch Changes
35
+
36
+ - f9cfdae: fix(dependency): gate the dependency map behind its own non-public access rule
37
+
38
+ Anonymous users could see the "Dependency Map" nav entry and open the page
39
+ (which then rendered empty) because the map was gated by `dependency.read`,
40
+ which is public so that dependency _warning_ badges stay visible on the
41
+ catalog and dashboard.
42
+
43
+ The full topology map is now gated by a dedicated `dependency.map` access
44
+ rule that is granted to authenticated users by default but is NOT public, so
45
+ anonymous visitors no longer see the nav entry or reach the page. The
46
+ `getAllDependencies`, `getNodePositions`, and `saveNodePositions` endpoints
47
+ move to this rule too, and the dashboard dependency signal now renders as
48
+ plain text (not a map link) for users without map access. Per-system
49
+ dependency warnings stay on the public `dependency.read` rule, so warning
50
+ badges/alerts/signals remain visible to everyone as before.
51
+
52
+ Admins can still grant `dependency.map` to the anonymous role to make the
53
+ map public again.
54
+
55
+ Note: the default-rule sync is add-only, so on existing deployments the
56
+ anonymous role keeps any rules already granted. Since `dependency.map` is a
57
+ brand-new rule the anonymous role never had it, so the map is hidden from
58
+ anonymous users immediately after upgrade with no admin action required.
59
+
60
+ - Updated dependencies [f9cfdae]
61
+ - @checkstack/dependency-common@1.2.5
62
+
3
63
  ## 0.5.5
4
64
 
5
65
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/dependency-frontend",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "main": "src/index.tsx",
@@ -15,12 +15,12 @@
15
15
  "dependencies": {
16
16
  "@checkstack/catalog-common": "2.3.4",
17
17
  "@checkstack/common": "0.15.0",
18
- "@checkstack/dashboard-frontend": "0.8.5",
19
- "@checkstack/dependency-common": "1.2.4",
18
+ "@checkstack/dashboard-frontend": "0.8.6",
19
+ "@checkstack/dependency-common": "1.3.0",
20
20
  "@checkstack/frontend-api": "0.9.0",
21
21
  "@checkstack/gitops-common": "0.6.3",
22
22
  "@checkstack/gitops-frontend": "0.5.5",
23
- "@checkstack/healthcheck-common": "1.5.4",
23
+ "@checkstack/healthcheck-common": "1.6.0",
24
24
  "@checkstack/signal-frontend": "0.2.4",
25
25
  "@checkstack/ui": "1.15.1",
26
26
  "@xyflow/react": "^12.11.0",
@@ -1,39 +1,24 @@
1
1
  import React, { useEffect, useMemo } from "react";
2
2
  import { usePluginClient, type SlotContext } from "@checkstack/frontend-api";
3
- import { resolveRoute } from "@checkstack/common";
4
3
  import {
5
4
  SystemSignalsSlot,
6
- type SystemSignal,
7
5
  type SystemSignalsMap,
8
6
  } from "@checkstack/catalog-common";
9
7
  import {
10
8
  DependencyApi,
11
- dependencyRoutes,
12
- dependencyAccess,
13
- type DerivedState,
9
+ deriveDependencySignals,
10
+ DEPENDENCY_SIGNAL_SOURCE_ID,
14
11
  } from "@checkstack/dependency-common";
15
12
 
16
13
  type Props = SlotContext<typeof SystemSignalsSlot>;
17
14
 
18
- const SOURCE_ID = "dependency";
19
-
20
- const stateToTone: Record<DerivedState, SystemSignal["tone"]> = {
21
- down: "error",
22
- degraded: "warn",
23
- info: "info",
24
- };
25
-
26
- const stateToLabel: Record<DerivedState, string> = {
27
- down: "Upstream down",
28
- degraded: "Upstream degraded",
29
- info: "Dependency info",
30
- };
31
-
32
15
  /**
33
16
  * Reports upstream dependency problems as dashboard signals. Bulk-fetches
34
17
  * derived warnings for all overview systems and emits one signal per affected
35
18
  * system, deep-linking to the dependency map. Headless filler for
36
- * {@link SystemSignalsSlot}.
19
+ * {@link SystemSignalsSlot}. The row->signal mapping is delegated to the shared
20
+ * {@link deriveDependencySignals} deriver so the frontend and the backend
21
+ * `system.issues` contributor stay in lockstep.
37
22
  */
38
23
  export const DependencySignalsFiller: React.FC<Props> = ({
39
24
  systemIds,
@@ -47,34 +32,21 @@ export const DependencySignalsFiller: React.FC<Props> = ({
47
32
  );
48
33
 
49
34
  const signals = useMemo<SystemSignalsMap>(() => {
50
- const result: SystemSignalsMap = {};
51
- if (!data) return result;
35
+ if (!data) return {};
52
36
 
37
+ // Scope the warnings to the systems this filler is responsible for before
38
+ // deriving, so the emitted map matches the slot's requested systemIds.
39
+ const scopedWarnings: typeof data.warnings = {};
53
40
  for (const systemId of systemIds) {
54
41
  const warning = data.warnings[systemId];
55
- if (!warning) continue;
56
-
57
- const upstreamCount = warning.affectedUpstreams.length;
58
- const signal: SystemSignal = {
59
- source: SOURCE_ID,
60
- tone: stateToTone[warning.derivedState],
61
- label: stateToLabel[warning.derivedState],
62
- detail:
63
- upstreamCount > 0
64
- ? `${upstreamCount} upstream ${upstreamCount === 1 ? "system" : "systems"} affected`
65
- : undefined,
66
- href: resolveRoute(dependencyRoutes.routes.map),
67
- // The dependency map is gated; render as text for users without access.
68
- accessRule: dependencyAccess.dependency.read,
69
- iconName: "GitBranch",
70
- };
71
- result[systemId] = [signal];
42
+ if (warning) scopedWarnings[systemId] = warning;
72
43
  }
73
- return result;
44
+
45
+ return deriveDependencySignals({ warnings: scopedWarnings });
74
46
  }, [data, systemIds]);
75
47
 
76
48
  useEffect(() => {
77
- onSignals(SOURCE_ID, signals);
49
+ onSignals(DEPENDENCY_SIGNAL_SOURCE_ID, signals);
78
50
  }, [signals, onSignals]);
79
51
 
80
52
  return null;
package/src/index.tsx CHANGED
@@ -32,7 +32,7 @@ export default createFrontendPlugin({
32
32
  default: m.DependencyMapPage,
33
33
  })),
34
34
  title: "Dependency Map",
35
- accessRule: dependencyAccess.dependency.read,
35
+ accessRule: dependencyAccess.map,
36
36
  nav: { group: "Workspace", icon: GitBranch },
37
37
  },
38
38
  ],