-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Validate that resources don't use urn or id as output properties #14637
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
Changelog[uncommitted] (2023-11-22)Bug Fixes
|
Frassle
force-pushed
the
fraser/urnid
branch
2 times, most recently
from
November 22, 2023 10:45
423ad11
to
4cb665b
Compare
Zaid-Ajaj
reviewed
Nov 22, 2023
Frassle
force-pushed
the
fraser/urnid
branch
from
November 22, 2023 14:30
4cb665b
to
d59d025
Compare
Zaid-Ajaj
approved these changes
Nov 22, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 22, 2023
Frassle
force-pushed
the
fraser/urnid
branch
from
November 22, 2023 23:12
d59d025
to
ffd59b7
Compare
Frassle
force-pushed
the
fraser/urnid
branch
from
November 22, 2023 23:13
ffd59b7
to
7a1ff54
Compare
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 23, 2023
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 30, 2023
### Features - [cli/config] Include config values from ESC in `pulumi config` [#14560](#14560) - [cli/config] Add commands for managing stack environments [#14628](#14628) - [cli/config] Add a command to create an ESC environment from stack config [#14634](#14634) - [sdk/go] add optional display name and tag fields to project templates [#14587](#14587) - [cli/plugin] Load policy packs in parallel on startup to reduce startup time [#14495](#14495) - [sdkgen/{go,nodejs,python}] Resource methods with plain: true outputs can now return plain values without an Output wrapper. In particular, this feature enables resource methods to serve as explicit provider factories by returning preconfigured explicit providers. [#13592](#13592) ### Bug Fixes - [auto/go] Fix a datarace in cloning git repos. [#14643](#14643) - [auto/go] Fixes event stream lag on windows runtime [#14659](#14659) - [engine] Engine now correctly handles any resource name. [#14107](#14107) - [engine] Fix a panic in cancellation. [#14612](#14612) - [engine] Fix root directory passed to langauge plugins when starting pulumi in a subfolder. [#14684](#14684) - [sdkgen] Schemas now validate that 'urn' and 'id' are not used as resource output properties. [#14637](#14637) - [sdkgen] Fixes marshalling the "plain" flag from object or resource properties [#14648](#14648) - [programgen/nodejs] Fix generated readFile function so that it includes the encoding and returns a string [#14633](#14633) - [sdkgen/{dotnet,go,nodejs,python}] No longer writing out name and project from alias definitions into SDKs, only type [#14625](#14625) - [sdk/go] Fix optional handling on nested props [#14629](#14629) - [sdkgen/go] Fixes plain and optional properties for generated types for Go SDKs using generics [#14616](#14616) - [sdkgen/go] Generate non-plain type variants for types used as inputs inside unions [#14679](#14679) - [sdk/python] Introduces RuntimeError when we detect a cycle upon adding dependencies to the graph. Additionally adds "PULUMI_ERROR_ON_DEPENDENCY_CYCLES" as a new environment variable to control this behavior. Set to `False` to return to the previous behavior, which could potentially re-introduce infinite hangs for some programs. [#14597](#14597)
pawelprazak
added a commit
to VirtusLab/besom
that referenced
this pull request
Dec 3, 2023
port upstream changes: pulumi/pulumi#14637
pawelprazak
added a commit
to VirtusLab/besom
that referenced
this pull request
Dec 4, 2023
port upstream changes: pulumi/pulumi#14637
This was referenced Dec 4, 2023
blampe
added a commit
to pulumi/pulumi-go-provider
that referenced
this pull request
Dec 15, 2023
Guards were added in pulumi/pulumi#14637 to prevent resources from defining their own "urn" and "id" properties. I ran into this because I mistakenly defined an ID property on my output state, and didn't realize until much later when trying generate the schema.
This was referenced Jan 2, 2024
3 tasks
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.
Description
Fixes #14631.
This adds a couple of new tests to codegen. Firstly to check that if you use "urn" or "id" as a resource output property we fail schema binding. This is because these clash with the urn and id fields that every resource already has to have.
Secondly a schema gen test that checks that urn and id do work in other places, i.e. resource inputs, nested types, etc.
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change