Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
10468: Update pulumictl to 0.0.42 r=Frassle a=Frassle



13265: Fix isInstance methods on generated provider types in the nodejs sdks r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #12584

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


13316: Test duplicate outputs r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Regression test to cover #9411

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
  • Loading branch information
bors[bot] and Frassle committed Jun 29, 2023
4 parents af1cbee + 2b61e37 + 84d4cc6 + 04ce92c commit 3e6f23b
Show file tree
Hide file tree
Showing 56 changed files with 164 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Expand Up @@ -6,7 +6,7 @@ RUN version=1.42.1 \
&& golangci-lint version

# Install pulumictl
RUN version=0.0.25 \
RUN version=0.0.42 \
&& curl -fsSLO https://github.com/pulumi/pulumictl/releases/download/v$version/pulumictl-v$version-linux-amd64.tar.gz \
&& tar -xzf pulumictl-v$version-linux-amd64.tar.gz --directory /usr/local/bin --no-same-owner pulumictl \
&& rm -f pulumictl-v$version-linux-amd64.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-run-test.yml
Expand Up @@ -203,7 +203,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
with:
repo: pulumi/pulumictl
tag: v0.0.32
tag: v0.0.42
cache: enable
- name: Install gotestsum
uses: jaxxstorm/action-install-gh-release@v1.7.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -175,7 +175,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
with:
repo: pulumi/pulumictl
tag: v0.0.32
tag: v0.0.42
cache: enable
- name: Repository Dispatch
run: ${{ matrix.job.run-command }}
Expand Down
2 changes: 1 addition & 1 deletion .gitpod/Dockerfile
Expand Up @@ -8,7 +8,7 @@ ENV PATH="$HOME/.pulumi:$HOME/.pulumi/bin:$PATH"
RUN mkdir -p /home/gitpod/dotnet && \
curl -fsSL https://download.visualstudio.microsoft.com/download/pr/f65a8eb0-4537-4e69-8ff3-1a80a80d9341/cc0ca9ff8b9634f3d9780ec5915c1c66/dotnet-sdk-3.1.201-linux-x64.tar.gz \
| tar xz -C /home/gitpod/dotnet && \
wget -qO- https://github.com/pulumi/pulumictl/releases/download/v0.0.28/pulumictl-v0.0.28-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/local/bin
wget -qO- https://github.com/pulumi/pulumictl/releases/download/v0.0.42/pulumictl-v0.0.42-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/local/bin


ENV DOTNET_ROOT=/home/gitpod/dotnet
Expand Down
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: sdkgen/nodejs
description: Fix isInstance methods for generated provider types.
12 changes: 11 additions & 1 deletion pkg/codegen/nodejs/gen.go
Expand Up @@ -692,7 +692,17 @@ func (mod *modContext) genResource(w io.Writer, r *schema.Resource) (resourceFil
fmt.Fprintf(w, " if (obj === undefined || obj === null) {\n")
fmt.Fprintf(w, " return false;\n")
fmt.Fprintf(w, " }\n")
fmt.Fprintf(w, " return obj['__pulumiType'] === %s.__pulumiType;\n", name)

typeExpression := fmt.Sprintf("%s.__pulumiType", name)
if r.IsProvider {
// We pass __pulumiType to the ProviderResource constructor as the "type" for this provider, the
// ProviderResource constructor in the SDK then prefixes "pulumi:providers:" to that token and passes that
// down to the CustomResource constructor, which then assigns that type token to the newly constructed
// objects __pulumiType field. As such we also need to prefix "pulumi:providers:" when doing the equality
// check here.
typeExpression = "\"pulumi:providers:\" + " + typeExpression
}
fmt.Fprintf(w, " return obj['__pulumiType'] === %s;\n", typeExpression)
fmt.Fprintf(w, " }\n")
fmt.Fprintf(w, "\n")

Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -21,7 +21,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -21,7 +21,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -19,7 +19,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down
Expand Up @@ -16,7 +16,7 @@ export class Provider extends pulumi.ProviderResource {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Provider.__pulumiType;
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
}


Expand Down

0 comments on commit 3e6f23b

Please sign in to comment.