pulumi/pkg/engine
Zaid Ajaj 63fab35215
[engine/refresh] Skip acquiring program packages during refresh when running inline automation programs (#18283)
### Description

When https://github.com/pulumi/pulumi/pull/12196 was added to Pulumi CLI
v3.143.0+ it made it such that when performing a `refresh`, the CLI
would gather the dependencies of the program, compare them against the
dependencies from the state/snapshot and warn if there are mismatches.
To gather the dependencies of the program, the CLI would spin up a
language plugin and call `GetRequiredPackages()` to get the set of
dependencies. This usually works fine, however the PR does not account
for _inline_ automation API programs where the language host isn't
usually involved or needed to begin with.

This I believe is the root cause of
https://github.com/pulumi/pulumi-dotnet/issues/443: a user that runs
their standalone dotnet binaries with inline programs (in an environment
without `dotnet` in the PATH) now sees errors reported by the dotnet
language host that the `dotnet` executable is missing whereas previously
it wasn't needed.

Furthermore, although the "missing `dotnet`" errors are benign and don't
cause refresh to fail or stop executing, the issue suggested that the
language host plugin isn't gracefully shutting down, causing a panic
(see issue details).

This PR attempts to address the issue by:
- Skipping the gathering of program dependencies when we are running an
inline automation program
- ~Calling `defer lang.Close()` on the language host when acquiring the
program dependencies for a graceful shutdown~
2025-01-21 09:49:14 +00:00
..
lifecycletest Enable `pulumi:pulumi:getResource` to hydrate `Read` resources (#18070) 2024-12-22 20:13:43 +00:00
combinedManager.go Test SnapshotManager and Journal in engine tests (#15871) 2024-04-11 22:54:08 +00:00
debugging.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
deployment.go Support parameterized packages in `pulumi import` (#18038) 2025-01-13 18:11:42 +00:00
deployment_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
destroy.go Update the refresh/destroy warnings for parameterized packages (#18029) 2024-12-20 02:03:17 +00:00
detailedDiff.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
detailedDiff_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
engine.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
errors.go Centralise human-friendly error handling in the CLI (#17046) 2024-08-23 08:48:42 +00:00
events.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
events_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
eventsink.go turn on the golangci-lint exhaustive linter (#15028) 2024-01-17 16:50:41 +00:00
import.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
journal.go Introduce snapshot metadata (#17430) 2024-09-30 16:45:40 +00:00
plugin_host.go Bump gRPC dependencies and migrate `grpc.Dial` (#17701) 2024-11-06 18:36:10 +00:00
plugins.go Support parameterized packages in `pulumi import` (#18038) 2025-01-13 18:11:42 +00:00
plugins_test.go Support parameterized packages in `pulumi import` (#18038) 2025-01-13 18:11:42 +00:00
progress.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
progress_test.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
project.go Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
query.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
refresh.go [engine/refresh] Skip acquiring program packages during refresh when running inline automation programs (#18283) 2025-01-21 09:49:14 +00:00
snapshot.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
update.go [engine/refresh] Skip acquiring program packages during refresh when running inline automation programs (#18283) 2025-01-21 09:49:14 +00:00
update_test.go Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00