pulumi/pkg/backend
Will Jones 6ff74d2c6f
Use events to report downloads as system messages (#17019)
When running a Pulumi operation such as a preview or an update, Pulumi
will detect if plugins (e.g. an AWS provider) are missing and download
and install them appropriately. Presently the user experience when this
happens isn't great (see e.g.
https://github.com/pulumi/pulumi/issues/14250), making it hard for the
user to see what is happening/what is taking so long when required
plugins are large.

This commit attempts to rectify this by continuing the work in
https://github.com/pulumi/pulumi/pull/16094 that tracks download
progress using engine events. In doing so, we are able to render
multiple downloads as part of the existing "system messages" panel in
the Pulumi output, and provide a clean view of what is going on when
downloads must occur before program execution. Moreover, we generalise
that PR to handle any engine process, enabling us to play a similar
trick with plugin installations (which can also take a while).

To preserve existing behaviour, we introduce a new class for these
events which we call "ephemeral", meaning that they are not persisted or
rendered in contexts such as diffs, for instance. Specifically,
ephemeral events are *not* sent to HTTP backends (i.e. the service), so
this commit should not require any changes to the service before merging
and releasing.

Fixes #14250
Closes #16094
Closes #16937 



https://github.com/user-attachments/assets/f0fac5e9-b3c8-4ea7-9cb7-075fc4b625d9


https://github.com/user-attachments/assets/7a761aa9-10ad-4f66-afa3-e4550b4553a5
2024-09-03 12:12:04 +00:00
..
display Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
diy Switch back to `os/user` to get the current user (#17125) 2024-08-31 18:54:35 +00:00
filestate Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
httpstate Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
state [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
apply.go Fix rendering of output events in rendering update diffs (#17029) 2024-08-27 18:37:03 +00:00
apply_test.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
backend.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
backend_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
cancellation_scope.go Make `engine.NewEvent` type safe (#14590) 2023-11-16 16:54:03 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
errors.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
inmemoryPersister.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
mock.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
policypack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
query.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
snapshot.go [snapshot] Elide writes for RRO with no changes (#15976) 2024-04-18 22:09:08 +00:00
snapshot_test.go Remove `Step.Apply`'s `preview` parameter (#16367) 2024-06-14 10:19:13 +00:00
stack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
updates.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
watch.go Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00