Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nested UDF calls during import migration #12575

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Handle nested UDF calls during import migration #12575

merged 1 commit into from
Nov 28, 2023

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Nov 27, 2023

Resolves #12542

The logic that replaces references in imported types, variables, and functions is not currently handling UDF calls within UDF calls, e.g.,

func foo(input string) => input

@export()
func bar(input string) => foo(foo(input))

In the definition of bar, the outer foo call would be migrated (i.e., it would refer to a UDF in a closure namespace (_1.foo)), but the inner foo call would not (i.e., it would refer to a UDF in the __bicep namespace). The compiled expression would end up looking something like "[_1.foo(__bicep.foo(parameters('input')))]", which will fail to evaluate at runtime.

Microsoft Reviewers: Open in CodeFlow

…ace calls nested within function arguments, too.
Copy link
Contributor

github-actions bot commented Nov 27, 2023

Test this change out locally with the following install scripts (Action run 7012778224)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 7012778224
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 7012778224"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 7012778224
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 7012778224"

@jeskew jeskew enabled auto-merge (squash) November 27, 2023 16:18
Copy link
Contributor

Test Results

     132 files  +    1       132 suites  +1   4h 10m 14s ⏱️ - 42m 2s
10 846 tests +    1  10 846 ✔️ +    2  0 💤 ±0  0  - 1 
52 307 runs  +117  52 307 ✔️ +118  0 💤 ±0  0  - 1 

Results for commit a28f59c. ± Comparison against base commit 5c2e287.

@jeskew jeskew requested a review from a team November 27, 2023 18:29
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.

When using an imported user-defined functions that calls other udf and uses ternary ifs, deployment fails
3 participants