Open mvdan opened 2 hours ago
Note that this is a problem with the existing default evaluator, not evalv3, so it is not related to any evalv3 regressions or behavior changes.
cc @rogpeppe @myitcv @mpvl
The best approach here might be to surface sub-schemas to the top level without going through matchN
, for example:
#NormalJob: #Workflow.#normalJob
#ReusableWorkflowCallJob: #Workflow.#reusableWorkflowCallJob
Ideally we surface #Step
or #NormalJobStep
in a similar way without resorting to hacks to work around optional fields or lists.
The testscript above should pass. Yet it fails:
Note in particular how
#Step
is equal to_
, which Marcel correctly pointed out.We have this bit of extra CUE published as part of the curated module:
This appears to have been broken ever since JSON Schema started using
matchN
; since validators only return either top or bottom, and they return top when unused, trying to get a sub-schema through a validator results in top as well, given the use of& {steps: _}
and so on above.It seems to me like we need to find a way to fix the
#Job
and#Step
definitions above to work correctly, as well as adding some tests that they actually work as expected. If they suddenly become top, we need tests which expect failures like the one in this report.