@@ -902,6 +902,8 @@ async fn artifact_detail(
|
||||
.platform_client
|
||||
.list_release_pipelines(&session.access_token, &org, &project),
|
||||
);
|
||||
// Fetch artifact spec after we have the artifact_id (needs artifact_result first).
|
||||
|
||||
let artifact = artifact_result.map_err(|e| match e {
|
||||
forage_core::platform::PlatformError::NotFound(_) => error_page(
|
||||
&state,
|
||||
@@ -913,6 +915,14 @@ async fn artifact_detail(
|
||||
internal_error(&state, "failed to fetch artifact", &other)
|
||||
}
|
||||
})?;
|
||||
|
||||
// Fetch artifact spec now that we have the artifact_id.
|
||||
let artifact_spec = state
|
||||
.platform_client
|
||||
.get_artifact_spec(&session.access_token, &artifact.artifact_id)
|
||||
.await
|
||||
.unwrap_or_default();
|
||||
|
||||
let projects = warn_default("list_projects", projects);
|
||||
let dest_states = dest_states.unwrap_or_default();
|
||||
let release_intents = release_intents.unwrap_or_default();
|
||||
@@ -1034,6 +1044,7 @@ async fn artifact_detail(
|
||||
context! { name => d.name, environment => d.environment }
|
||||
}).collect::<Vec<_>>(),
|
||||
has_release_intents => release_intents.iter().any(|ri| ri.artifact_id == artifact.artifact_id),
|
||||
artifact_spec => if artifact_spec.is_empty() { None::<String> } else { Some(artifact_spec) },
|
||||
},
|
||||
)
|
||||
.map_err(|e| {
|
||||
|
||||
Reference in New Issue
Block a user