Skip to content

feat(workbench): generate architecture graph on backend via GetArchitectureGraph RPC - #918

Merged
kyasbal merged 4 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qptwxoprtowk
Aug 27, 2026
Merged

kyasbal merged 4 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qptwxoprtowk

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Migrates Kubernetes architecture graph computation from client-side TypeScript to the backend Go Workbench service via a new Connect-RPC GetArchitectureGraph.

Key Changes

  • Backend (pkg/server/workbench/architecturegraph, proto/api/v1/architecture_graph.proto):
    • Implements GetArchitectureGraph RPC on WorkbenchService.
    • Introduces architecturegraph.Builder to resolve cluster topology (Nodes, Pods, Services, PodOwners, and Top-Level Owners) along with directional edges at a specified timestamp.
    • Supports timeline bitset filtering to only include resources matching active timeline filters.
    • Handles virtual nodes for pods referencing unobserved nodes and resolves node bindings.
    • Extracts reusable sparsebitset package from workbench.
  • Frontend (web/src/app/):
    • Adds WorkbenchClientService.getArchitectureGraph() using Connect-RPC.
    • Updates GraphConverterService to consume protobuf graph responses instead of traversing raw manifests in the browser.
    • Integrates GraphSmartComponent with Angular Signals (resource()) and active timeline filter bitset.
    • Cleans up legacy client-side manifest traversal code and unused files (k8s-types.ts, task-yielder.ts, condition-positive-map.ts).

Testing

  • make test-go
  • make test-web
  • make lint-go
  • make lint-web
  • make build-storybook
  • make pre-commit

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new GetArchitectureGraph RPC to the WorkbenchService to offload the computation of the Kubernetes architecture graph from the frontend to the backend. On the backend, a new graph builder has been implemented to construct the topology (nodes, pods, services, workload controllers, and their relationships) at a specific timestamp using the active timeline filter. On the frontend, the GraphDataConverterService was refactored to GraphConverterService to fetch this pre-computed graph from the backend, allowing the removal of heavy frontend-side parsing logic, K8s resource types, and the TaskYielder utility. There are no review comments, so no further feedback is provided.

@kyasbal kyasbal added the type:feature New feature or request label Aug 27, 2026
- Fix timeline bitset empty filtering logic to exclude all resources when empty
- Unify slice sorting using generic sortedValuesByID helper
- Clean up container parsing and edge generation in architecturegraph builder
- Remove unused files: condition-positive-map.ts, k8s-types.ts, task-yielder.ts
- Rename GraphDataConverterService to GraphConverterService
- Use PodConnectionGraphData and eliminate redundant dummy node fallback
- Rename internal owner references and remove unused ownerUids
@kyasbal
kyasbal force-pushed the push-qptwxoprtowk branch from 49c40f6 to 5fdc3e5 Compare August 27, 2026 05:58
@kyasbal
kyasbal marked this pull request as ready for review August 27, 2026 06:32
@kyasbal
kyasbal merged commit 2a10308 into GoogleCloudPlatform:main Aug 27, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-qptwxoprtowk branch August 27, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or request

1 participant