When a ~/.spin/config file has incorrect formatting, the error message provided is confusing
- Dominant language
- Go
- Stars
- 21
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
When having a mis-configured file at `~/.spin/config` the error message provided is missing information about where to fix this issue.
## Motivation
I was moving really fast and dumped in a `~/.spin/config` file that was not formatted correctly. When I moved on to use the `shore` CLI it was then I found out about this issue and I did not know what was the context for this error. Having a clear identification of where the issue is occurring would help.
The expected outcome would have the filename of what is being parsed to set the context of where the issue is located.
## Describe alternatives you've considered
Have not considered any alternatives.
## Additional context
Here is an example of the `~/.spin/config` I used:
```yaml
auth:
enabled: true
ignoreCertErrors: true
x509:
certPath: ~/.config/spinnaker/id_spin.cert
keyPath: ~/.config/spinnaker/id_spin.key
gate:
endpoint: [https://hostname.org:442](https://hostname.org:443/)
```
I got the following output:
```text
➜ shore save
WARN[0000] Save pipeline returned an error: error converting YAML to JSON: yaml: line 7: did not find expected key
error converting YAML to JSON: yaml: line 7: did not find expected key
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the `shore save` CLI path that parses `~/.spin/config` and produces the YAML-to-JSON error, then trace where that error is wrapped. Reproduce it with the malformed YAML shown in the issue. Done means the error identifies `~/.spin/config` and remains clear when the command fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, yaml
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100