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

include name from original project if the compiler doesn't return it #610

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

tgummerer
Copy link
Contributor

@tgummerer tgummerer commented Aug 9, 2024

The pulumi-yaml runtime expects the compiler to return a complete yaml project, including the name attribute. The compiler might not return this however, even when it returns a valid yaml program otherwise.

This leads to issues down the line, as the rest of the runtime expects the name to be set in the template, and might panic if it isn't. We do however have the name from the original Pulumi.yaml, so we can fill that in for the user, even if the compiler doesn't return it in the template.

Fixes #609

@tgummerer tgummerer requested a review from a team as a code owner August 9, 2024 10:20
@tgummerer tgummerer force-pushed the tg/better-error-on-compiler-incompleteness branch 2 times, most recently from e6375ac to 3863ced Compare August 9, 2024 10:40
@tgummerer tgummerer changed the title improve the error message when the compiler returns an invalid project @tgummerer include name from original project if the compiler doesn't return it Aug 9, 2024
@tgummerer tgummerer changed the title @tgummerer include name from original project if the compiler doesn't return it include name from original project if the compiler doesn't return it Aug 9, 2024
@tgummerer tgummerer requested a review from lunaris August 9, 2024 10:41
@tgummerer tgummerer force-pushed the tg/better-error-on-compiler-incompleteness branch from 3863ced to 16b896e Compare August 9, 2024 10:53
The pulumi-yaml runtime expects the compiler to return a complete yaml
project, including the `name` attribute. The compiler might not return
this however, even when it returns a valid yaml program otherwise.

This leads to issues down the line, as the rest of the runtime expects
the name to be set in the template, and might panic if it isn't.  We
do however have the name from the original Pulumi.yaml, so we can fill
that in for the user, even if the compiler doesn't return it in the
template.
@tgummerer tgummerer force-pushed the tg/better-error-on-compiler-incompleteness branch from 16b896e to c921f64 Compare August 9, 2024 11:52
@tgummerer tgummerer merged commit 0caddca into main Aug 9, 2024
5 checks passed
@tgummerer tgummerer deleted the tg/better-error-on-compiler-incompleteness branch August 9, 2024 12:27
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.

panic when using runtime.options.compiler
2 participants