Unverified Commit cbb858f0 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: emit env_diff span attribute for update (#90466)

it already existed for `.create()`, but not `.update()`
parent 782f1662
...@@ -608,8 +608,14 @@ impl ProjectContainer { ...@@ -608,8 +608,14 @@ impl ProjectContainer {
.await .await
} }
#[tracing::instrument(level = "info", name = "update project options", skip_all)]
pub async fn update(self: Vc<Self>, options: PartialProjectOptions) -> Result<()> { pub async fn update(self: Vc<Self>, options: PartialProjectOptions) -> Result<()> {
let span = tracing::info_span!(
"update project options",
project_name = %self.await?.name,
env_diff = Empty
);
let span_clone = span.clone();
async move {
let PartialProjectOptions { let PartialProjectOptions {
root_path, root_path,
project_path, project_path,
...@@ -692,6 +698,13 @@ impl ProjectContainer { ...@@ -692,6 +698,13 @@ impl ProjectContainer {
.read_strongly_consistent() .read_strongly_consistent()
.await?; .await?;
if let Some(old_options) = &*this.options_state.get_untracked() {
span.record(
"env_diff",
define_env_diff_report(&old_options.define_env, &new_options.define_env)
.as_str(),
);
}
this.options_state.set(Some(new_options)); this.options_state.set(Some(new_options));
let project = project_operation(resolved_self) let project = project_operation(resolved_self)
.resolve_strongly_consistent() .resolve_strongly_consistent()
...@@ -724,6 +737,9 @@ impl ProjectContainer { ...@@ -724,6 +737,9 @@ impl ProjectContainer {
Ok(()) Ok(())
} }
.instrument(span_clone)
.await
}
} }
#[turbo_tasks::value_impl] #[turbo_tasks::value_impl]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment