Add file paths to error messages informing about invalid placeholders
- Dominant language
- Go
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Where project consists of multiple files, sometimes it's hard to find file with invalid placeholder within.
#### Steps to reproduce the issue
Create project.yaml with invalid placeholder and run `build` command:
```yaml
apiVersion: g2a-cli/v2.0
kind: Project
name: example-project
variables:
variable: 'variable defined in {{ .Projetc.Name }} project'
```
#### What's the expected result?
```
Loading file: /Users/qzb/Workspace/g2a-com/klio-lifecycle/examples/simple/project.yaml
File "/Users/qzb/Workspace/g2a-com/klio-lifecycle/examples/simple/project.yaml" contains invalid document: 1 error occurred:
* Value for {{.projetc.name}} placeholder is not specified, available placeholders:
.project.vars.variable, .project.dir, .project.name
```
#### What's the actual result?
```
Loading file: /Users/qzb/Workspace/g2a-com/klio-lifecycle/examples/simple/project.yaml
Value for {{.projetc.name}} placeholder is not specified, available placeholders:
.project.vars.variable, .project.dir, .project.name
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the build command and the invalid-placeholder error path using the project.yaml example from the issue. Run the reproduction, then trace how the file is loaded and how the placeholder error is formatted. Done means the invalid-document message identifies the source file and retains the available-placeholder details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100