pulumi/changelog/pending
Julien 95e3d8fe26
Avoid calling invokes with dependencies on unknown resources (#18152)
Nodejs implementation of #18133

DependsOn for resources is an ordering constraint for register resource
calls. If a resource R1 depends on a resource R2, the register resource
call for R2 will happen after R1. This is ensured by awaiting the URN
for each resource dependency before calling register resource.

For invokes, this causes a problem when running under preview. During
preview, register resource immediately returns with the URN, however
this does not tell us if the resource "exists".

Instead of waiting for the dependency's URN, we wait for the ID. This
tells us that whether a physical resource exists (if the state is in
sync), and we can avoid calling the invoke when it is unknown.

The following example fails without this change:
```typescript
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const config = new pulumi.Config()
const billingAccountId = config.require("billing-account")

const billingAccount = gcp.organizations.getBillingAccountOutput({
    billingAccount: billingAccountId
})

const project = new gcp.organizations.Project("project", {
    billingAccount: billingAccount.id,
    name: "project-nodejs",
    autoCreateNetwork: false,
    deletionPolicy: "DELETE",
})

export const zones = gcp.compute.getZonesOutput({
    project: project.projectId,
    region: "us-central1"
}, {
    dependsOn: [project],
})
```
2025-01-07 09:55:27 +00:00
..
20241127--sdk-go--implement-deferred-output-for-the-go-sdk-and-program-gen.yaml [sdk/program-gen] Implementing DeferredOutput for Go SDK and program-gen (#17885) 2025-01-04 18:47:30 +00:00
20241218--engine--enable-pulumi-pulumi-getresource-to-hydrate-read-resources.yaml Enable `pulumi:pulumi:getResource` to hydrate `Read` resources (#18070) 2024-12-22 20:13:43 +00:00
20241219--cli-package--pulumi-convert-now-supports-bridging-to-terraform-providers-automatically.yaml Automatically bridge eligible dependencies on pulumi convert from terraform (#17992) 2024-12-23 13:35:55 +00:00
20241219--sdk-python--switch-to-pyproject-toml-uv.yaml Switch to pyproject.toml + uv (#18081) 2024-12-27 13:53:42 +00:00
20241220--auto-go--return-error-if-no-inline-program-specified.yaml Fix infinite looping of calls of pulumi program when missing inline program (#18086) 2024-12-23 01:38:21 +00:00
20241220--cli-new--provide-a-better-error-message-when-pulumi-new-ai-generates-a-program-with-errors.yaml return a meaningful error when getting a zip template fails (#18091) 2024-12-23 09:10:49 +00:00
20241220--cli-new--provide-a-more-meaningful-message-for-the-language-flag.yaml return a more meaningful message for new --language (#18092) 2024-12-23 09:18:29 +00:00
20241222--auto-go--support-clear-pending-creates-to-go-automation-api-previewrefresh-and-refresh.yaml Support `--clear-pending-creates` for `refresh` command in Go Automation API. (#18101) 2024-12-23 04:20:26 +00:00
20241223--cli-engine--clarify-the-usage-string-for-the-expect-no-changes-flag.yaml clarify usage string for --expect-no-changes (#18105) 2024-12-23 15:43:35 +00:00
20241223--sdk-go--fix-panic-when-diffing-computed-property-values.yaml property diff: avoid panic'ing when computed values are present (#18104) 2024-12-23 12:05:04 +00:00
20241223--sdk-nodejs--fix-source-maps-when-using-jest.yaml Fix source maps when using jest (#18108) 2024-12-24 10:25:28 +00:00
20241223--sdk-python--fix-reading-pulumi-plugin-json-when-using-the-uv-toolchain.yaml Fix reading pulumi-plugin.json when using the uv toolchain (#18107) 2024-12-24 11:36:01 +00:00
20241224--programgen--allow-for-case-insensitive-terraform-convert-source.yaml [convert] Allow for case-insensitive terraform convert source (#18111) 2024-12-24 12:20:59 +00:00
20241224--programgen-go--fix-importing-module-names-in-go-programs-that-arent-lower-case.yaml [programgen/go] Fix importing module names that aren't lower-case (#18113) 2024-12-25 16:04:40 +00:00
20241227--sdk-python--fix-listpackages-when-using-uv.yaml Fix ListPackages when using uv (#18121) 2024-12-30 09:10:59 +00:00
20241227--sdk-python--move-mypy-configuration-into-pyproject-toml.yaml Move mypy configuration into pyproject.toml (#18118) 2024-12-30 11:13:44 +00:00
20241227--sdk-python--move-pyright-configuration-into-pyproject-toml.yaml Move pyright configuration into pyproject.toml (#18116) 2024-12-27 18:17:34 +00:00
20241227--sdk-python--move-ruff-configuration-into-pyproject-toml.yaml Move ruff configuration into pyproject.toml (#18117) 2024-12-27 22:38:00 +00:00
20241230--auto-go--interrupt-programs-gracefully-when-the-context-is-canceled.yaml auto/go: interrupt programs gracefully on context cancel (#18124) 2025-01-02 11:38:28 +00:00
20241230--sdk-python--fix-dynamic-providers-when-using-poetry-or-uv.yaml Fix dynamic providers when using Poetry or uv (#18126) 2025-01-02 17:33:48 +00:00
20241230--sdk-python--fix-prerelease-version.yaml Fix prerelease version (#18125) 2024-12-30 13:35:18 +00:00
20250102--programgen-java--bump-java-sdk-dependency-version-so-that-package-gen-sdk-emits-buildable-code.yaml Bump Java SDK version to v0.20+ (#18130) 2025-01-02 04:45:13 +00:00
20250102--sdk-go--avoid-calling-invokes-with-dependencies-on-unknwon-resources.yaml Avoid calling invokes with dependencies on unknown resources (#18133) 2025-01-06 08:46:33 +00:00
20250103--sdk-python--avoid-calling-invokes-with-dependencies-on-unknown-resources.yaml Avoid calling invokes with dependencies on unknown resources (#18141) 2025-01-06 13:39:35 +00:00
20250103--sdkgen-java--only-use-grpc-to-communicate-with-the-java-host.yaml Only use gRPC to communicate with the Java host (#18138) 2025-01-03 16:48:13 +00:00
20250106--cli--fix-testpackageaddgoparameterized-to-utilize-version-path.yaml re enable TestPackageAddGoParameterized test and alter path to contain version (#18150) 2025-01-06 11:21:38 +00:00
20250106--sdk-nodejs--avoid-calling-invokes-with-dependencies-on-unknown-resources.yaml Avoid calling invokes with dependencies on unknown resources (#18152) 2025-01-07 09:55:27 +00:00