pulumi/pkg/backend/display
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
..
internal/terminal Prepare golangci-lint upgrade (#17065) 2024-08-28 07:57:38 +00:00
testdata Add API support for rendering a rich diff for Copilot (#17084) 2024-08-29 01:20:21 +00:00
wasm [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
diff.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
diff_test.go Fix rendering of output events in rendering update diffs (#17029) 2024-08-27 18:37:03 +00:00
display.go Include all engine events in the event log (#17101) 2024-08-30 10:31:19 +00:00
display_test.go Include all engine events in the event log (#17101) 2024-08-30 10:31:19 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
events.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
events_test.go Don't omit an empty detailedDiff (#15213) 2024-01-23 00:00:14 +00:00
json.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
jsonmessage.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
object_diff.go Fix mangled diffs of strings containing url-encoded chars (#16147) 2024-05-08 08:23:40 +00:00
object_diff_test.go Fix a panic in diff display when parsing YAML strings (#14710) 2023-12-02 01:24:13 +00:00
options.go Support PULUMI_SHOW_COPILOT_LINK to enable 'explainFailure' link (#17109) 2024-08-29 20:43:29 +00:00
progress.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
progress_bar.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
progress_bar_test.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
progress_test.go Support PULUMI_SHOW_COPILOT_LINK to enable 'explainFailure' link (#17109) 2024-08-29 20:43:29 +00:00
query.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
rows.go Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00
sigint_unix.go [cli] Reimplement the interactive renderer 2022-11-07 22:02:44 -08:00
sigint_windows.go [cli] Reimplement the interactive renderer 2022-11-07 22:02:44 -08:00
tableutil.go [color] Use graphemes to measure strings. 2022-11-09 08:23:00 -08:00
tree.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00
tree_test.go Clean up display rewinding and wrapping (#17007) 2024-08-19 15:30:48 +00:00
watch.go Use events to report downloads as system messages (#17019) 2024-09-03 12:12:04 +00:00