-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add tests and fix for StackReference output type checking #600
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this pull request
Jul 11, 2024
Part of pulumi/pulumi-yaml#599. Pulumi YAML uses the schema defined here to type check outputs from the `pulumi:pulumi:StackReference` resource. This changes the type of `outputs` from `map[string]string` to `map[string]any`, permitting list, map, and numeric outputs to be used as inputs to other resources. To release this fix, we will need to release Pulumi twice and YAML once if we are to use our ordinary release process: 1. Merge this PR. 2. Release sdk and pkg dependencies with this update applied. 3. Merge pulumi/pulumi-yaml#600 4. Create and merge a PR to update Pulumi YAML's dependency on `github.com/pulumi/pkg/v3`, as YAML links to the schema loader and will read the updated schema here: https://github.com/pulumi/pulumi/blob/7f48ca370d12e6d7fee29b7e1b6f87c9f558351e/pkg/codegen/schema/loader.go#L136-L140 5. Release Pulumi YAML 6. Create and merge a PR to update the YAML language plugin shipped with Pulumi 7. Release Pulumi
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this pull request
Jul 11, 2024
Part of pulumi/pulumi-yaml#599. Pulumi YAML uses the schema defined here to type check outputs from the `pulumi:pulumi:StackReference` resource. This changes the type of `outputs` from `map[string]string` to `map[string]any`, permitting list, map, and numeric outputs to be used as inputs to other resources. To release this fix, we will need to release Pulumi twice and YAML once if we are to use our ordinary release process: 1. Merge this PR. 2. Release sdk and pkg dependencies with this update applied. 3. Merge pulumi/pulumi-yaml#600 4. Create and merge a PR to update Pulumi YAML's dependency on `github.com/pulumi/pkg/v3`, as YAML links to the schema loader and will read the updated schema here: https://github.com/pulumi/pulumi/blob/7f48ca370d12e6d7fee29b7e1b6f87c9f558351e/pkg/codegen/schema/loader.go#L136-L140 5. Release Pulumi YAML 6. Create and merge a PR to update the YAML language plugin shipped with Pulumi 7. Release Pulumi
Ensures that Pulumi YAML programs are able to use StackReference outputs as "any" typed values. Allows "any" values to be assigned to any value, expanding the set of valid programs. Blocked on: - pulumi/pulumi#16625 Using a Go workspace with that PR applied to Pulumi, the test suite passes.
AaronFriel
added
impact/no-changelog-required
This issue doesn't require a CHANGELOG update
and removed
impact/no-changelog-required
This issue doesn't require a CHANGELOG update
labels
Jul 11, 2024
Frassle
approved these changes
Jul 11, 2024
This PR has been shipped in release v1.9.1. |
github-merge-queue bot
pushed a commit
to pulumi/pulumi
that referenced
this pull request
Jul 11, 2024
iwahbe
reviewed
Jul 15, 2024
@@ -229,6 +229,10 @@ func (tc *typeCache) isAssignable(fromExpr ast.Expr, to schema.Type) *notAssigna | |||
return nil | |||
} | |||
|
|||
if from == schema.AnyType || to == schema.AnyType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing an implicit cast from any
to T
is unsound. I would have liked to have more discussion about introducing a checked cast instead of just weakening the type checker.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensures that Pulumi YAML programs are able to use StackReference outputs as "any" typed values. Allows "any" values to be assigned to any value, expanding the set of valid programs.
Blocked on:
Using a Go workspace with that PR applied to Pulumi, the test suite passes.