carvel-dev / carvel-dev/ytt

Provide a way to either render output to stderr and/or include custom output to `--debug`

Open
#497 1 comment 2 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
Go
Stars
1.9k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem/challenge you have**
Something blows up in some Starlark code in my template; but it's hard to get to the root cause because I can't see the values of expressions at runtime.

**Describe the solution you'd like**
The ability to include trace output during a `ytt` run. Even better if I could leave such tracing and be able to toggle it on and off from the command-line (e.g. include in `--debug` or introduce a flag `--trace`)

**Anything else you would like to add:**
The current workaround is to use `assert.fail()` in spots close to where the error occurs and include the desired context that way.

This idea has come up multiple times (in fact, hard to believe there isn't already an issue about this). Most recently in this Slack conversation: https://kubernetes.slack.com/archives/CH8KCCKA5/p1632938666479600
---

To do:
- [ ] enumerate use-cases; describe a number of scenarios where runtime information/data/state would be useful.
- [ ] explore whether the generalized solution for addressing those use-cases would be best as an enhancement to `--debug` or a separate mechanism (e.g. another flag)
- [ ] explore how complex/custom Starlark values (structs, yamlfragments, ...) would be presented.
- [ ] explore what security concerns might be present.

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Research direction

Start with the issue's use-case checklist and inspect how ytt's --debug option and command-line flags expose runtime information during a Starlark evaluation. Document scenarios, output for complex Starlark values, and security concerns before choosing between extending --debug and adding a separate tracing mechanism. Done means the scope and proposed interface are agreed, rather than merely implementing one output format.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.