argoproj / argoproj/argo-workflows
More helpful error messages for common schema errors, e.g. singular `input`, `parameter`, `argument`, `output`
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
# Summary
It would be nice if Argo could catch some common schema errors, such as accidentally using `input` instead of `inputs`.
Particularly for templating it can be hard to tell what went wrong
Follow-up to [this Slack thread](https://cloud-native.slack.com/archives/C01QW9QSSSK/p1707410257902809?thread_ts=1707408647.690259&cid=C01QW9QSSSK) where a user had:
```yaml
when: "{{= input.parameters.SYNC_ONLY != 'true' }}"
```
and was getting errors that didn't really help narrow down the problem -- similar to #10630:
```
message: 'Invalid ''when'' expression ''{{= input.parameters.SYNC_ONLY != ''true''}}'': Invalid token: ''{{='' (hint: try wrapping the affected expression in quotes ("))'
```
This could be considered a subissue of #10630 to be specifically more helpful for these common typos (and perhaps other common typos).
This type of detection could also be useful outside of templating -- for invalid YAML manifests for instance that accidentally use `input` instead of `inputs`.
## Use Cases
It could help quite greatly when debugging mistakes in Workflows, and would reduce support burden as well, given how common these can be.
1. For templating with expressions
1. For writing Workflow manifest YAML itself
---
**Message from the maintainers**:
Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.
Contributor guide
Research direction
Start by locating Argo's expression-template validation and Workflow manifest schema validation, using the `when` example and the singular `input` versus plural `inputs` typo as entry points. Define how diagnostics should identify these common mistakes in both templating and YAML manifests, then verify the proposed behavior with focused tests for each use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, yaml
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100