Process results from the nix output stream.
This commit is contained in:
@@ -133,6 +133,8 @@ impl<'db> RunningBuild<'db> {
|
||||
missing_path: activity_start_copy_path.missing_path,
|
||||
source: activity_start_copy_path.source,
|
||||
destination: activity_start_copy_path.destination,
|
||||
done: 0,
|
||||
expected: 0,
|
||||
}),
|
||||
)?;
|
||||
}
|
||||
@@ -143,6 +145,8 @@ impl<'db> RunningBuild<'db> {
|
||||
Activity::FileTransfer(ActivityFileTransfer {
|
||||
state: ActivityState::default(),
|
||||
url: activity_start_file_transfer.url,
|
||||
done: 0,
|
||||
expected: 0,
|
||||
}),
|
||||
)?;
|
||||
}
|
||||
@@ -162,6 +166,10 @@ impl<'db> RunningBuild<'db> {
|
||||
Activity::CopyPaths(ActivityCopyPaths {
|
||||
state: ActivityState::default(),
|
||||
text: activity_start_copy_paths.text,
|
||||
done: 0,
|
||||
expected: 0,
|
||||
running: 0,
|
||||
failed: 0,
|
||||
}),
|
||||
)?;
|
||||
}
|
||||
@@ -171,6 +179,10 @@ impl<'db> RunningBuild<'db> {
|
||||
activity_start_builds.parent,
|
||||
Activity::Builds(ActivityBuilds {
|
||||
state: ActivityState::default(),
|
||||
done: 0,
|
||||
expected: 0,
|
||||
running: 0,
|
||||
failed: 0,
|
||||
}),
|
||||
)?;
|
||||
}
|
||||
@@ -186,6 +198,7 @@ impl<'db> RunningBuild<'db> {
|
||||
} else {
|
||||
None
|
||||
},
|
||||
phase: None,
|
||||
}),
|
||||
)?;
|
||||
}
|
||||
@@ -256,7 +269,7 @@ impl<'db> RunningBuild<'db> {
|
||||
)?;
|
||||
}
|
||||
};
|
||||
self.print_current_status();
|
||||
// self.print_current_status();
|
||||
}
|
||||
NixAction::Stop(stop_message) => {
|
||||
let activity = self
|
||||
@@ -264,55 +277,51 @@ impl<'db> RunningBuild<'db> {
|
||||
.get_activity_id(stop_message.id)
|
||||
.map(|activity_id| self.activity_tree.get_mut(&activity_id))?;
|
||||
activity.get_mut_activity().stop();
|
||||
self.print_current_status();
|
||||
// self.print_current_status();
|
||||
// println!("{}", serde_json::to_string(&message)?);
|
||||
}
|
||||
NixAction::Result(activity_result_message) => {
|
||||
match activity_result_message {
|
||||
ActivityResultMessage::FileLinked(activity_result_file_linked) => {
|
||||
// FileLinked
|
||||
// TODO: Haven't seen any of these.
|
||||
// warn!("Found FileLinked: {}", serde_json::to_string(&message)?);
|
||||
ActivityResultMessage::FileLinked(_activity_result_file_linked) => {}
|
||||
ActivityResultMessage::BuildLogLine(_activity_result_build_log_line) => {
|
||||
// These are the output from the actual build (as opposed to the output from nix).
|
||||
}
|
||||
ActivityResultMessage::BuildLogLine(activity_result_build_log_line) => {
|
||||
// BuildLogLine
|
||||
// The first field is a string containing the log line
|
||||
ActivityResultMessage::UntrustedPath(_activity_result_untrusted_path) => {}
|
||||
ActivityResultMessage::CorruptedPath(_activity_result_corrupted_path) => {}
|
||||
ActivityResultMessage::SetPhase(activity_result_set_phase) => {
|
||||
let activity_id = self
|
||||
.activity_tree
|
||||
.get_activity_id(activity_result_set_phase.id)?;
|
||||
let activity = self.activity_tree.get_mut(&activity_id);
|
||||
activity
|
||||
.get_mut_activity()
|
||||
.set_phase(Some(activity_result_set_phase.phase));
|
||||
}
|
||||
ActivityResultMessage::UntrustedPath(activity_result_untrusted_path) => {
|
||||
// UntrustedPath
|
||||
// TODO: Haven't seen any of these.
|
||||
// warn!("Found UntrustedPath: {}", serde_json::to_string(&message)?);
|
||||
ActivityResultMessage::Progress(activity_result_progress) => {
|
||||
let activity_id = self
|
||||
.activity_tree
|
||||
.get_activity_id(activity_result_progress.id)?;
|
||||
let activity = self.activity_tree.get_mut(&activity_id);
|
||||
activity.get_mut_activity().set_progress(
|
||||
activity_result_progress.done,
|
||||
activity_result_progress.expected,
|
||||
activity_result_progress.running,
|
||||
activity_result_progress.failed,
|
||||
);
|
||||
}
|
||||
ActivityResultMessage::CorruptedPath(activity_result_corrupted_path) => {
|
||||
// CorruptedPath
|
||||
// TODO: Haven't seen any of these.
|
||||
// warn!("Found CorruptedPath: {}", serde_json::to_string(&message)?);
|
||||
}
|
||||
ActivityResultMessage::SetPhase(activity_result_set_phase) => { // SetPhase
|
||||
// The first field is the phase name
|
||||
}
|
||||
ActivityResultMessage::Progress(activity_result_progress) => { // Progress
|
||||
// Fields numerator, denominator, running?, failed?
|
||||
}
|
||||
ActivityResultMessage::SetExpected(activity_result_set_expected) => { // SetExpected
|
||||
// Fields activity type?, expected?
|
||||
ActivityResultMessage::SetExpected(activity_result_set_expected) => {
|
||||
let activity_id = self
|
||||
.activity_tree
|
||||
.get_activity_id(activity_result_set_expected.id)?;
|
||||
let activity = self.activity_tree.get_mut(&activity_id);
|
||||
activity
|
||||
.get_mut_activity()
|
||||
.set_expected(activity_result_set_expected.expected);
|
||||
}
|
||||
ActivityResultMessage::PostBuildLogLine(
|
||||
activity_result_post_build_log_line,
|
||||
) => {
|
||||
// PostBuildLogLine
|
||||
// TODO: Haven't seen any of these.
|
||||
// warn!(
|
||||
// "Found PostBuildLogLine: {}",
|
||||
// serde_json::to_string(&message)?
|
||||
// );
|
||||
}
|
||||
ActivityResultMessage::FetchStatus(activity_result_fetch_status) => {
|
||||
// FetchStatus
|
||||
// TODO: Haven't seen any of these.
|
||||
// warn!("Found FetchStatus: {}", serde_json::to_string(&message)?);
|
||||
// println!("{}", serde_json::to_string(&message)?);
|
||||
}
|
||||
_activity_result_post_build_log_line,
|
||||
) => {}
|
||||
ActivityResultMessage::FetchStatus(_activity_result_fetch_status) => {}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user