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

Support instance functions on resource-typed params #11031

Merged
merged 2 commits into from
Jun 23, 2023
Merged

Support instance functions on resource-typed params #11031

merged 2 commits into from
Jun 23, 2023

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Jun 20, 2023

Resolves #10994

Although instance functions on resource-typed outputs and parameters currently raise no diagnostics, they are not proposed as completions and lead to an unhandled exception when the syntax is converted to the Bicep IR.

This PR fixes up resource-typed params and outputs instance function support with three changes:

  • The IR conversion for InstanceFunctionCallSyntax is updated to support all resources, not just those of type DeclaredResourceMetadata.
  • A check is added to EmitLimitationCalculator to raise an error diagnostic when an instance function is called on a resource-typed module output, as list*(reference(...).outputs. ...) is blocked by ARM's dependency graph processor. (The getSecret() function doesn't result in nested runtime functions and so is permitted.)
  • The language server completion provider is updated to suggest known resource functions on resource-typed params and outputs.
Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew requested a review from a team June 20, 2023 15:52
@github-actions
Copy link
Contributor

Test Results (win-x64)

       33 files  ±0         33 suites  ±0   34m 13s ⏱️ -26s
10 082 tests +4  10 082 ✔️ +4  0 💤 ±0  0 ±0 
12 297 runs  +4  12 297 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit 33e6ec9. ± Comparison against base commit a347ebb.

@github-actions
Copy link
Contributor

Test Results (linux-musl-x64)

       33 files  ±0         33 suites  ±0   32m 14s ⏱️ - 1m 2s
10 070 tests +4  10 070 ✔️ +4  0 💤 ±0  0 ±0 
12 286 runs  +4  12 286 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit 33e6ec9. ± Comparison against base commit a347ebb.

@github-actions
Copy link
Contributor

Test Results (linux-x64)

       33 files  ±0         33 suites  ±0   31m 15s ⏱️ + 3m 5s
10 070 tests +4  10 070 ✔️ +4  0 💤 ±0  0 ±0 
12 286 runs  +4  12 286 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit 33e6ec9. ± Comparison against base commit a347ebb.

@github-actions
Copy link
Contributor

Test Results (osx-x64)

       33 files  ±0         33 suites  ±0   1h 34m 5s ⏱️ - 7m 56s
10 074 tests +4  10 074 ✔️ +4  0 💤 ±0  0 ±0 
12 290 runs  +4  12 290 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit 33e6ec9. ± Comparison against base commit a347ebb.

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

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

:shipit:

@jeskew jeskew merged commit f8da7da into main Jun 23, 2023
@jeskew jeskew deleted the jeskew/10994 branch June 23, 2023 02:14
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.

Instance functions on resource typed params and outputs crash the build and are not proposed as completions
2 participants