docs: add ADR-004 for hydrated recipe query command#435
Conversation
Clarify that embedded metadata is inaccessible until bundle time, and that recipe output contains references not resolved values.
There was a problem hiding this comment.
Clean ADR — well-motivated, good alternatives analysis, and the dot-path syntax is a pragmatic choice.
A few observations (non-blocking):
Low:
-
Hydration of all components on every query is acknowledged as a future concern. Worth noting that
GetValuesForComponentreads from the embedded FS — if values files are large (some Helm charts have 500+ line values), hydrating 15-30 components could add noticeable latency. A--componentfilter that short-circuits hydration to a single component would be a natural v1.1 optimization. -
Error UX for typos. If a user queries
components.gpu-opertor.values.driver.version(typo), they getErrCodeNotFound. Consider including the list of valid keys at the level where the path diverges (e.g., "key 'gpu-opertor' not found; available: cert-manager, gpu-operator, ..."). This is a small UX win for a read-only introspection tool. -
Reference links use relative paths (
../../pkg/cli/recipe.go) which won't resolve on GitHub's rendered markdown. Use paths from repo root (e.g.,pkg/cli/recipe.go) or full GitHub URLs. -
--selector ''(empty string) returns the entire hydrated tree. Worth documenting thataicr query --selector ''is equivalent to "dump everything" and could produce large output. Consider making--selectorrequired with no default, and offering--selector .as the explicit "all" syntax (consistent withjq).
|
Review findings:
|
|
Responding to the review: On point 2 (hydration cost): All recipe data — registry, overlays, component values — is embedded in the binary and read from an in-memory On point 3 (error UX for typos): Reasonable idea but out of scope for the ADR. The implementation can improve error messages without changing the design contract. On point 4 (relative paths): These are standard ADR reference links that work fine in local browsing and IDEs. GitHub renders them correctly from the file's directory context. No change needed. On point 5 ( |
|
Responding to the comment: On point 1 (empty selector contract): The implementation supports both On point 2 (Alternative #3 workaround): The sentence you're referencing says "Users who need advanced filtering can pipe |
Summary
aicr querycommand that resolves a recipe from criteria (same flags asrecipe) and extracts a specific hydrated value by dot-path selectorrecipeoutput contains value references but no way to inspect the fully merged configurationcomponents.gpu-operator.values.driver.version) is consistent with Helm--setandyqTest plan
RecipeResult+GetValuesForComponentoutput