canonical / canonical/checkbox
field 'requires', expression did not reference any resources too strict
- Dominant language
- Python
- Stars
- 52
- Forks
- 81
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 69
Description
### Enhancement Proposal
Say you have a resource `foo`:
```yaml
var: foo
var: bar
```
and a templated unit:
```yaml
unit: template
template-resource: foo
id: foo/{var}
requires:
"{var}" != "bar"
```
This will result in a validation error:
```
error: units/foo.pxu:5: job 'foo/FUNCTION', field 'requires', expression did not reference any resources
```
So you need to invent an expression to `and` with it. But it's a perfectly valid expression, IMO.
Contributor guide
Research direction
Start by locating the validation logic for the `requires` field and reproduce the YAML example from the issue. Determine why an expression without a resource reference is rejected; done means the shown expression is accepted without an invented condition and a regression test covers the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100