Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output full path in errors for a given file #895

Open
blakebarnett opened this issue Feb 22, 2024 · 3 comments
Open

Output full path in errors for a given file #895

blakebarnett opened this issue Feb 22, 2024 · 3 comments
Assignees
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@blakebarnett
Copy link

Currently if you have a nested directory structure for YTT files, whenever there's an error it currently only outputs whatever filename it was parsing when the error occurred. If you have multiple files with the same or similar name across many directories it can be confusing/frustrating to track it down.

It would be extremely helpful to include the relative full path to the file or an option to enable that behavior.


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.

@blakebarnett blakebarnett added carvel triage This issue has not yet been triaged for relevance enhancement This issue is a feature request labels Feb 22, 2024
@prembhaskal
Copy link
Member

Is it possible to share the config to quickly reproduce the error?

@prembhaskal prembhaskal self-assigned this Feb 27, 2024
@blakebarnett
Copy link
Author

blakebarnett commented Feb 27, 2024

There's no specific error. It's more about what the output is when there is any error parsing files.

Here's a contrived (but realistic) layout:

envs
├── development
│   ├── overlays.yaml
│   └── values.yaml
├── integration
│   ├── overlays.yaml
│   └── values.yaml
└── production
    ├── overlays.yaml
    └── values.yaml
apps
├── example
│   ├── base-values.yaml
│   ├── development
│   │   ├── image-tag.yaml
│   │   └── values.yaml
│   ├── integration
│   │   ├── image-tag.yaml
│   │   └── values.yaml
│   └── production
│       ├── image-tag.yaml
│       └── values.yaml
└── grpc-example
    ├── base-overlays.yaml
    ├── base-values.yaml
    ├── development
    │   ├── image-tag.yaml
    │   └── values.yaml
    ├── integration
    │   ├── image-tag.yaml
    │   └── values.yaml
    ├── production
    │   ├── image-tag.yaml
    │   └── values.yaml

Here's an example error:

❯ ytt -f envs/development/values.yaml -f apps/example/development/values.yaml
ytt: Error: Unmarshaling YAML template 'values.yaml': yaml: line 3: mapping values are not allowed in this context

Which makes figuring out which values.yaml it's referring to here annoying. We're currently getting around this by naming files excessively descriptively like env-development-values.yaml and so on, but it gets very odd looking as the structure is more nested and/or the files need ever more descriptive names. This also affects the --files-inspect option:

❯ ytt -f envs/development/values.yaml -f apps/example/development/values.yaml --files-inspect
- values.yaml
- values.yaml

@renuy renuy added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been triaged for relevance labels Mar 5, 2024
@renuy
Copy link

renuy commented Mar 5, 2024

@blakebarnett ,
Thanks for bringing this up.
Feel free to raise a PR for this, and we can prioritize the review for the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
Status: Unprioritized
Development

No branches or pull requests

3 participants