Skip to content

Fix: order a provider call without $params after the calls it reads - #149

Merged
briankane merged 2 commits into
kubevela:mainfrom
briankane:fix/cuex-legacy-call-dependencies
Oct 8, 2026
Merged

briankane merged 2 commits into
kubevela:mainfrom
briankane:fix/cuex-legacy-call-dependencies

Conversation

@briankane

@briankane briankane commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

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's request step, whose legacy op.#ConditionalWait reads req.$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 legacy op package declares NoExist: _|_ at the top level, and reading through it both lost the dependency and left the reread call bottom (explicit error (_|_ literal) in source).

paramsResolved is unchanged in behaviour: a call with no $params has 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

Special notes for your reviewer

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.40%. Comparing base (80dd365) to head (7a4e419).

Files with missing lines Patch % Lines
cue/cuex/compiler.go 90.00% 1 Missing ⚠️
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     
Flag Coverage Δ
unit-test 92.40% <90.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@briankane
briankane marked this pull request as ready for review October 7, 2026 08:30

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread cue/cuex/compiler.go Outdated
Comment thread cue/cuex/legacy_call_order_test.go Outdated
@briankane
briankane force-pushed the fix/cuex-legacy-call-dependencies branch 2 times, most recently from e6054c3 to 1f660fa Compare October 7, 2026 08:55

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread cue/cuex/legacy_call_order_test.go Outdated
Comment thread cue/cuex/legacy_call_order_test.go Outdated
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>
@briankane
briankane force-pushed the fix/cuex-legacy-call-dependencies branch from 1f660fa to f93eaf6 Compare October 7, 2026 09:04
@briankane
briankane merged commit 567282f into kubevela:main Oct 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuex: a provider call without $params runs before the calls it reads

2 participants