Repository navigation
Fix: order a provider call without $params after the calls it reads - #149
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
==========================================
+ Coverage 92.37% 92.40% +0.02%
==========================================
Files 114 114
Lines 6653 6659 +6
==========================================
+ Hits 6146 6153 +7
+ Misses 507 506 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
e6054c3 to
1f660fa
Compare
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
The resolver found what a call depends on by following the references in its $params. A call written in the legacy style has no $params: its inputs are its own top-level fields. It was therefore taken to depend on nothing, ran in the first level, and read another call's output before that call had run. kubevela/workflow's request step, whose legacy op.#ConditionalWait reads req.$returns, waited for ever. A call's inputs are now its $params, or for a legacy call each of its top-level fields, hidden ones included. The fields rather than the call's own expression: that is the conjunction with the definition the call is made from, and following it reaches into the package the definition lives in. kubevela/workflow's legacy op package declares NoExist: _|_ at the top level, and reading through it lost the dependency and left the reread call bottom. The regression test's package declares one too, and each of its fixtures puts the reader before what it reads, so traversal order alone cannot pass it. Fixes kubevela#148 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vkPtmKeCEZo2EL7QWCMhH Signed-off-by: Brian Kane <briankane1@gmail.com>
1f660fa to
f93eaf6
Compare
Description of your changes
Fixes #148.
Since #141 the resolver found what a provider call depends on by following the references in its
$params. A call written in the legacy style has no$params: its inputs are its own top-level fields. It was taken to depend on nothing, ran in the first level, and read another call's output before that call had run. kubevela/workflow'srequeststep, whose legacyop.#ConditionalWaitreadsreq.$returns, waited forever.A call's inputs are now its
$params, or for a legacy call each of its top-level fields, hidden ones included. The fields rather than the call's own expression: that expression is the conjunction with the definition the call is made from, and following it reaches into the package the definition lives in. kubevela/workflow's legacyoppackage declaresNoExist: _|_at the top level, and reading through it both lost the dependency and left the reread call bottom (explicit error (_|_ literal) in source).paramsResolvedis unchanged in behaviour: a call with no$paramshas nothing to check there, since a legacy call's top-level fields hold its outputs as well as its inputs.How has this code been tested
TestLegacyCallWaitsForTheCallItReads: a legacy call reading a new-style call's$returns(workflow'srequest), and a legacy call reading another legacy call's output (workflow'sapply-job). A third case reads its input through a hidden field. Each fixture puts the reader before what it reads, so traversal order alone cannot pass it, and the test package declares a top-levelNoExist: _|_, as workflow's legacyoppackage does. Fails onmainand at cue/cuex: resolve a template's provider calls in batches, not one walk each #141; passes at fix: drop empty path and unrenderable value from function call errors #140 and with this change.pkgpackages pass, including cue/cuex: resolve a template's provider calls in batches, not one walk each #141's equivalence, corpus and fidelity suites.requeststep template through its task loader now succeeds (onmainit staysrunning/Wait), and its unit and envtest suites pass apart from the provider tests that also fail locally onmain(macOS port and patching issues).Special notes for your reviewer
requeststep fails until this lands.oppackage also declares a top-levelcontext: _, and with it removed the legacy wait does not run at all. It is not needed for this fix.