Skip to content

chant graph ignores build-time parameters, so it and chant build disagree about the same source #1359

Closed

Description

@lex00

chant graph discovers source without resolving buildParams, so params.* is empty and every declaration conditioned on a parameter takes its default. chant build on the same source, same flags, same environment emits something different.

Repro

kubemicrovm-ops declares a tier build parameter with an env: mapping and branches its Kubernetes plane on it.

$ KMV_TIER=prod-ha chant build src --lexicon k8s | grep '^kind:'
kind: Namespace
kind: Namespace
kind: MicroVMImage
kind: MicroVMNetwork
kind: MicroVMReplicaSet
kind: MicroVMClass

$ KMV_TIER=prod-ha chant graph src --format ir | jq -c '[.nodes[].id]|sort'
["artifactBucket","artifactBucketPolicy","buildRole","image","microvmPolicy",
 "networkConnectorPolicy","operatorNs","operatorRole","passBuildRolePolicy","vm","workloadNs"]

That is the minimal shape: a MicroVM and no class, connector or replica set. --param tier=prod-ha produces the same output, so it is not the env: mapping specifically — the graph resolves no build parameters at all.

Cause

runGraphView (and runStackGraph, and the declared-overlay discovery inside runGraphLive) call discover(projectPath) with no options. build.ts calls resolveCliBuildParams(config.buildParams, …) first and threads the provenance through. DiscoveryOptions already accepts buildParams; the graph handler just never passes it.

Why it matters beyond the graph

behold's tier lens is built on chant graph — .behold.json names the project's tier env var and behold threads the picked tier into the shell-out's environment. That plumbing is correct, and the lens still does nothing, because the command underneath ignores it. Filed there as behold#114 on the assumption it was behold's bug; it is not.

More generally, a graph that disagrees with the build is worse than no graph: it is a picture of source nobody will deploy.

Fix

Resolve build parameters in the graph handler the same way chant build does, and pass the provenance to every discover() call it makes. An unresolvable required parameter should stop the graph rather than emit a defaulted one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions