Skip to content

feat: support multikind casting manifest - #178

Merged
therealpandey merged 9 commits into
mainfrom
feat/config/multidocument
Aug 14, 2026
Merged

feat: support multikind casting manifest#178
therealpandey merged 9 commits into
mainfrom
feat/config/multidocument

Conversation

@Nageshbansal

@Nageshbansal Nageshbansal commented Aug 11, 2026

Copy link
Copy Markdown
Member

Features

  • A casting.yaml can now hold more than one document, one per kind, so an installation and a collection agent live in the same file:
apiVersion: v1alpha1
kind: Installation
metadata:
  name: signoz
spec:
  deployment:
    mode: docker
    flavor: compose
---
apiVersion: v1alpha1
kind: CollectionAgent
metadata:
  name: signoz-agent
spec:
  deployment:
    mode: docker
    flavor: compose
  • Documents run in cast order (Infrastructure, Installation, CollectionAgent) no matter how the file orders them, and casting.yaml.lock records them in that order
  • Each document keeps its own spec and pours into its own directory
  • gauge checks the whole file's tools at once: a tool shared by two documents is checked once, and every missing tool is reported together
  • forge writes the lock and the pours only after every document forges, so a failing document leaves the previous generation untouched
  • A document without kind still reads as an Installation, so existing casting files keep working
  • A duplicate document is rejected, naming the one already declared:
invalid casting file casting.yaml: document 2: Installation is already declared as "signoz": a casting file holds one Installation

There is no casting registered for Infrastructure yet, so a file carrying one is read and ordered but cannot be forged on this branch.

Refactors

  • v1alpha1.Kinds() now returns the kinds in cast order
  • The config interface and the gauge, forge and cast commands take a list of castings instead of a single one
  • Multi-document YAML is read and written through one helper, so errors can point at a document by its position in the file

Tests

  • Loader: dispatch by kind, cast order from a file written in reverse, duplicate kinds, error positions, empty and comment-only documents
  • Lock: a file of several documents round-trips in cast order
  • Reading and writing multi-document YAML streams

Related: https://github.com/SigNoz/platform-pod/issues/2527

@Nageshbansal Nageshbansal changed the title Feat/config/multidocument feat: support multikind casting manifest Aug 11, 2026
@Nageshbansal
Nageshbansal marked this pull request as ready for review August 13, 2026 08:55
@Nageshbansal
Nageshbansal changed the base branch from feat/runner to main August 13, 2026 08:55
A casting file held one document. sigs.k8s.io/yaml takes the first document of
a stream and reports no error for the rest, so a second document was silently
dropped.

A file now holds one document per kind. The loader splits the stream, resolves
each document against its own Kind, and hands the pipeline the whole set in
cast order: a substrate before the workloads that run on it. One
casting.yaml.lock records the resolved set, separated by ---, and it is what
cast reads.

One ordered table of loaders carries everything a Kind needs, and its two
readers are methods on it: resolve for a declared document, read for one the
lock already resolved. Collecting the set by kind makes both invariants
structural, so a duplicate is caught as it is inserted and walking the table
emits the set in cast order.

kind is now required. The schema already said so; only the loader's fallback to
Installation kept it optional, and a file with several documents cannot default
one of them.

YAMLStream reads a stream as the documents it holds, yielding those that
declare something with the position a reader counts in the file. Splitting is
lexical, which is what lets an error name the document that is malformed, and
YAMLMaterial reads its documents through the same splitter.

Plan builds one planner per document, and gauge, forge and cast run against
that set: a command reads the casting file once and plans once. Gauge reports a
tool once however many documents ask for it, and the ledger posts an event per
document, tied together by a run id so an invocation still counts as one run.
@Nageshbansal
Nageshbansal force-pushed the feat/config/multidocument branch from 99e7bd0 to 453ad1f Compare August 13, 2026 10:36
@therealpandey
therealpandey merged commit 6480868 into main Aug 14, 2026
10 checks passed
@therealpandey
therealpandey deleted the feat/config/multidocument branch August 14, 2026 11:16
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