worker: separate display metadata
This commit is contained in:
@@ -192,6 +192,8 @@ pub struct WorkspaceApiRef {
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CreateWorkerRequest {
|
||||
pub profile: ProfileSelector,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<String>,
|
||||
pub profile_source: ProfileSourceArchiveSource,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub config_bundle: Option<ConfigBundleRef>,
|
||||
@@ -228,6 +230,8 @@ pub struct WorkerSummary {
|
||||
pub status: WorkerStatus,
|
||||
pub execution: WorkerExecutionStatus,
|
||||
pub profile: ProfileSelector,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<String>,
|
||||
pub profile_source: ProfileSourceArchiveRef,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub config_bundle: Option<ConfigBundleRef>,
|
||||
@@ -242,6 +246,8 @@ pub struct WorkerDetail {
|
||||
pub status: WorkerStatus,
|
||||
pub execution: WorkerExecutionStatus,
|
||||
pub profile: ProfileSelector,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub display_name: Option<String>,
|
||||
pub profile_source: ProfileSourceArchiveRef,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub config_bundle: Option<ConfigBundleRef>,
|
||||
|
||||
@@ -887,6 +887,7 @@ mod tests {
|
||||
let bundle = test_bundle(profile.clone());
|
||||
CreateWorkerRequest {
|
||||
profile,
|
||||
display_name: None,
|
||||
profile_source: crate::catalog::ProfileSourceArchiveSource::Http {
|
||||
location: crate::catalog::ProfileSourceArchiveHttpRef {
|
||||
url: "http://127.0.0.1/profile-source.tar".to_string(),
|
||||
@@ -1210,6 +1211,7 @@ mod ws_tests {
|
||||
let bundle = ws_test_bundle(ProfileSelector::RuntimeDefault);
|
||||
CreateWorkerRequest {
|
||||
profile: ProfileSelector::RuntimeDefault,
|
||||
display_name: None,
|
||||
profile_source: crate::catalog::ProfileSourceArchiveSource::Http {
|
||||
location: crate::catalog::ProfileSourceArchiveHttpRef {
|
||||
url: "http://127.0.0.1/profile-source.tar".to_string(),
|
||||
|
||||
@@ -1860,6 +1860,7 @@ impl WorkerRecord {
|
||||
.clone()
|
||||
.with_restore_dry_check(restore_dry_check),
|
||||
profile: self.request.profile.clone(),
|
||||
display_name: self.request.display_name.clone(),
|
||||
profile_source: self.request.profile_source.reference(),
|
||||
config_bundle: self.request.config_bundle.clone(),
|
||||
last_event_id: self.last_event_id,
|
||||
@@ -1873,6 +1874,7 @@ impl WorkerRecord {
|
||||
status: self.status,
|
||||
execution: self.execution.clone(),
|
||||
profile: self.request.profile.clone(),
|
||||
display_name: self.request.display_name.clone(),
|
||||
profile_source: self.request.profile_source.reference(),
|
||||
config_bundle: self.request.config_bundle.clone(),
|
||||
last_event_id: self.last_event_id,
|
||||
@@ -2008,6 +2010,7 @@ mod tests {
|
||||
let bundle = test_bundle_for_profile(profile.clone());
|
||||
CreateWorkerRequest {
|
||||
profile,
|
||||
display_name: None,
|
||||
profile_source: crate::catalog::ProfileSourceArchiveSource::Http {
|
||||
location: crate::catalog::ProfileSourceArchiveHttpRef {
|
||||
url: "http://127.0.0.1/profile-source.tar".to_string(),
|
||||
|
||||
@@ -1559,6 +1559,7 @@ mod tests {
|
||||
let bundle = test_bundle();
|
||||
CreateWorkerRequest {
|
||||
profile: ProfileSelector::RuntimeDefault,
|
||||
display_name: None,
|
||||
profile_source: crate::catalog::ProfileSourceArchiveSource::Embedded {
|
||||
archive: bundle.profile_source_archive.clone().unwrap(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user