Skip to content

feat: speak inventory v1alpha2 property-graph model#10

Merged
ecv merged 1 commit into
mainfrom
feat/v1alpha2-graph
Jun 12, 2026
Merged

feat: speak inventory v1alpha2 property-graph model#10
ecv merged 1 commit into
mainfrom
feat/v1alpha2-graph

Conversation

@ecv

@ecv ecv commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

Reworks the plugin to speak the v1alpha2 property-graph API shipped in milo-os/inventory v0.1.0, replacing the v1alpha1 typed commands. Implements #9.

v1alpha2 collapses the ~13 typed CRDs into generic Node + Edge (each with an attribute bag) under group graph.inventory.miloapis.com, with NodeType/EdgeType as the schema registry. Relationships that were typed fields (a site's region, a node's cluster) are now edges.

Command surface (replaces providers/regions/sites/clusters/nodes)

Command Description
get <TYPE> List nodes of an asset class; columns from the NodeType schema (union fallback)
get edges [--type/--from/--to] List relationships
types Browse the NodeType/EdgeType registry
neighbors NODE [--edge/--direction] Graph traversal over edges
tree [--edge/--root-type] Containment hierarchy from edges (default located-in, rooted at Region); cycle-guarded
summary Counts per node type and edge type
apply -f Graph kinds (NodeType, EdgeType, Node, Edge), dependency-ordered

Verification

  • Unit tests rewritten for the graph model (tree, summary, edge filtering, neighbors, NodeType-driven vs fallback columns, apply parse/order/reject) — go test ./... green.
  • Against prod: confirmed graph.inventory.miloapis.com/v1alpha2 is served (plugin reaches it; the call returns forbidden, not not-found). Full read verification is blocked on RBAC — my principal has no grant on the graph group yet (the v1alpha2 equivalent of the v1alpha1 inventory roles). That's an IAM/infra task, not plugin code.

Notes

  • Drops the v1alpha1 typed commands entirely (per decision to migrate, not coexist). v0.1.0 still serves v1alpha1 server-side if rollback is needed.
  • Follow-up (separate): grant read/write RBAC on graph.inventory.miloapis.com so the plugin (and the loader) can operate end-to-end.

milo-os/inventory v0.1.0 ships a v1alpha2 API that collapses the typed
per-kind CRDs into a property graph: generic Node + Edge (each with an
attribute bag) under group graph.inventory.miloapis.com, with NodeType /
EdgeType as the schema registry. Rework the plugin to speak it, replacing
the v1alpha1 typed commands.

Implements #9.

Key changes:
- Bump go.miloapis.com/inventory to v0.1.0; client + apply use the
  v1alpha2 scheme (graph.inventory.miloapis.com)
- get <TYPE>: list nodes of an asset class with columns derived from the
  matching NodeType's attribute schema (falls back to the union of
  attribute keys present when no NodeType is registered)
- get edges [--type/--from/--to]: list relationships
- types: browse the NodeType/EdgeType registry
- neighbors NODE [--edge/--direction]: graph traversal over edges
- tree [--edge/--root-type]: containment hierarchy rebuilt from edges
  (default located-in, rooted at Region), with cycle guard
- summary: counts per node type and per edge type
- apply: graph kinds (NodeType, EdgeType, Node, Edge) in dependency order
  (types, then nodes, then edges); unsupported kinds rejected up front
- Remove the v1alpha1 typed list commands (providers/regions/sites/
  clusters/nodes)
@ecv ecv requested a review from a team as a code owner June 12, 2026 19:00
@ecv

ecv commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

IAM next, then reworking the importer.

@ecv ecv merged commit 0a77b16 into main Jun 12, 2026
2 checks passed
@ecv ecv deleted the feat/v1alpha2-graph branch June 12, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants