summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-05-17 13:58:10 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-05-17 13:59:44 +0200
commitddbd9629b3188c9f08d023829683c40ab9e1448b (patch)
tree8ebcf47cb5d54b1f2e843bf760a8f9f260a8fb26
parentf9a2d04b50c566ff762b3f450b444cf6c6757715 (diff)
Revert "Update dependency: indicatif 0.15 -> 0.16"
This reverts the dependency update because indicatif 0.16 introduced a reachable `unreachable!()` statement in their sourcecode that we actually hit if we `--hide-bars`. This reverts commit 6ceccb679d9c2d19389c6c6eef792d8db9086f31. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--Cargo.toml2
-rw-r--r--src/commands/endpoint.rs6
-rw-r--r--src/commands/source.rs14
-rw-r--r--src/commands/util.rs2
-rw-r--r--src/endpoint/scheduler.rs8
-rw-r--r--src/orchestrator/orchestrator.rs14
6 files changed, 23 insertions, 23 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 8dc8e26..1a23555 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -44,7 +44,7 @@ git2 = "0.13"
handlebars = { version = "3", features = ["no_logging"] }
human-panic = "1"
humantime = "2.1"
-indicatif = "0.16"
+indicatif = "0.15"
indoc = "1"
itertools = "0.10"
lazy_static = "1.4"
diff --git a/src/commands/endpoint.rs b/src/commands/endpoint.rs
index 4de51d2..e69dc56 100644
--- a/src/commands/endpoint.rs
+++ b/src/commands/endpoint.rs
@@ -75,7 +75,7 @@ async fn ping(endpoint_names: Vec<EndpointName>,
.map(|endpoint| {
let bar = multibar.add(progress_generator.bar());
bar.set_length(n_pings);
- bar.set_message(format!("Pinging {}", endpoint.name()));
+ bar.set_message(&format!("Pinging {}", endpoint.name()));
async move {
for i in 1..(n_pings + 1) {
@@ -83,14 +83,14 @@ async fn ping(endpoint_names: Vec<EndpointName>,
let r = endpoint.ping().await;
bar.inc(1);
if let Err(e) = r {
- bar.finish_with_message(format!("Pinging {} failed", endpoint.name()));
+ bar.finish_with_message(&format!("Pinging {} failed", endpoint.name()));
return Err(e)
}
tokio::time::sleep(tokio::time::Duration::from_secs(sleep)).await;
}
- bar.finish_with_message(format!("Pinging {} successful", endpoint.name()));
+ bar.finish_with_message(&format!("Pinging {} successful", endpoint.name()));
Ok(())
}
})
diff --git a/src/commands/source.rs b/src/commands/source.rs
index cd33921..2e4ee2b 100644
--- a/src/commands/source.rs
+++ b/src/commands/source.rs
@@ -245,7 +245,7 @@ pub async fn download(
.map(|p| {
sc.sources_for(p).into_iter().map(|source| {
let bar = multi.add(progressbars.spinner());
- bar.set_message(format!("Downloading {}", source.url()));
+ bar.set_message(&format!("Downloading {}", source.url()));
async move {
let source_path_exists = source.path().exists();
if !source_path_exists && source.download_manually() {
@@ -273,7 +273,7 @@ pub async fn download(
let response = match reqwest::get(source.url().as_ref()).await {
Ok(resp) => resp,
Err(e) => {
- bar.finish_with_message(format!("Failed: {}", source.url()));
+ bar.finish_with_message(&format!("Failed: {}", source.url()));
return Err(e).with_context(|| anyhow!("Downloading '{}'", source.url()))
}
};
@@ -291,9 +291,9 @@ pub async fn download(
bar.inc(bytes.len() as u64);
if let Some(len) = response.content_length() {
- bar.set_message(format!("Downloading {} ({}/{} bytes)", source.url(), bytes_written, len));
+ bar.set_message(&format!("Downloading {} ({}/{} bytes)", source.url(), bytes_written, len));
} else {
- bar.set_message(format!("Downloading {} ({} bytes)", source.url(), bytes_written));
+ bar.set_message(&format!("Downloading {} ({} bytes)", source.url(), bytes_written));
}
}
@@ -305,17 +305,17 @@ pub async fn download(
if source_path_exists /* && force is implied by 'if' above*/ {
if let Err(e) = source.remove_file().await {
- bar.finish_with_message(format!("Failed to remove existing file: {}", source.path().display()));
+ bar.finish_with_message(&format!("Failed to remove existing file: {}", source.path().display()));
return Err(e)
}
}
if let Err(e) = perform_download(&source, &bar).await {
- bar.finish_with_message(format!("Failed: {}", source.url()));
+ bar.finish_with_message(&format!("Failed: {}", source.url()));
Err(e)
} else {
- bar.finish_with_message(format!("Finished: {}", source.url()));
+ bar.finish_with_message(&format!("Finished: {}", source.url()));
Ok(())
}
}
diff --git a/src/commands/util.rs b/src/commands/util.rs
index e892875..95efda2 100644
--- a/src/commands/util.rs
+++ b/src/commands/util.rs
@@ -108,7 +108,7 @@ where
bar.finish_with_message("Linting errored");
return Err(anyhow!("Linting was not successful"));
} else {
- bar.finish_with_message(format!(
+ bar.finish_with_message(&format!(
"Finished linting {} package scripts",
lint_results.len()
));
diff --git a/src/endpoint/scheduler.rs b/src/endpoint/scheduler.rs
index 8b65bb2..8ec8323 100644
--- a/src/endpoint/scheduler.rs
+++ b/src/endpoint/scheduler.rs
@@ -374,14 +374,14 @@ impl<'a> LogReceiver<'a> {
}
LogItem::CurrentPhase(ref phasename) => {
trace!("Setting bar phase to {}", phasename);
- self.bar.set_message(format!(
+ self.bar.set_message(&format!(
"[{}/{} {} {} {}]: Phase: {}",
self.endpoint_name, self.container_id_chrs, self.job_id, self.package_name, self.package_version, phasename
));
}
LogItem::State(Ok(())) => {
trace!("Setting bar state to Ok");
- self.bar.set_message(format!(
+ self.bar.set_message(&format!(
"[{}/{} {} {} {}]: State Ok",
self.endpoint_name, self.container_id_chrs, self.job_id, self.package_name, self.package_version
));
@@ -389,7 +389,7 @@ impl<'a> LogReceiver<'a> {
}
LogItem::State(Err(ref e)) => {
trace!("Setting bar state to Err: {}", e);
- self.bar.set_message(format!(
+ self.bar.set_message(&format!(
"[{}/{} {} {} {}]: State Err: {}",
self.endpoint_name, self.container_id_chrs, self.job_id, self.package_name, self.package_version, e
));
@@ -414,7 +414,7 @@ impl<'a> LogReceiver<'a> {
self.endpoint_name, self.container_id_chrs, self.job_id, self.package_name, self.package_version
),
};
- self.bar.finish_with_message(finish_msg);
+ self.bar.finish_with_message(&finish_msg);
if let Some(mut lf) = logfile {
let _ = lf.flush().await?;
diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs
index b118ed1..ff46a00 100644
--- a/src/orchestrator/orchestrator.rs
+++ b/src/orchestrator/orchestrator.rs
@@ -459,7 +459,7 @@ struct JobTask<'a> {
impl<'a> Drop for JobTask<'a> {
fn drop(&mut self) {
if !self.bar.is_finished() {
- self.bar.finish_with_message(format!("[{} {} {}] Stopped, error on other task",
+ self.bar.finish_with_message(&format!("[{} {} {}] Stopped, error on other task",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version()));
@@ -470,7 +470,7 @@ impl<'a> Drop for JobTask<'a> {
impl<'a> JobTask<'a> {
fn new(receiver: Receiver<JobResult>, prep: TaskPreparation<'a>, sender: Vec<Sender<JobResult>>) -> Self {
let bar = prep.bar.clone();
- bar.set_message(format!("[{} {} {}]: Booting",
+ bar.set_message(&format!("[{} {} {}]: Booting",
prep.jobdef.job.uuid(),
prep.jobdef.job.package().name(),
prep.jobdef.job.package().version()
@@ -522,7 +522,7 @@ impl<'a> JobTask<'a> {
while !all_dependencies_are_in(&self.jobdef.dependencies, &received_dependencies) {
// Update the status bar message
self.bar.set_message({
- format!("[{} {} {}]: Waiting ({}/{})...",
+ &format!("[{} {} {}]: Waiting ({}/{})...",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version(),
@@ -545,7 +545,7 @@ impl<'a> JobTask<'a> {
self.sender[0].send(Err(received_errors)).await;
// ... and stop operation, because the whole tree will fail anyways.
- self.bar.finish_with_message(format!("[{} {} {}] Stopping, errors from child received",
+ self.bar.finish_with_message(&format!("[{} {} {}] Stopping, errors from child received",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version()));
@@ -645,7 +645,7 @@ impl<'a> JobTask<'a> {
self.jobdef.job.package().version())
})?;
}
- self.bar.finish_with_message(format!("[{} {} {}] Reusing artifact",
+ self.bar.finish_with_message(&format!("[{} {} {}] Reusing artifact",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version()));
@@ -664,7 +664,7 @@ impl<'a> JobTask<'a> {
.cloned()
.collect::<Vec<ArtifactPath>>();
trace!("[{}]: Dependency artifacts = {:?}", self.jobdef.job.uuid(), dependency_artifacts);
- self.bar.set_message(format!("[{} {} {}]: Preparing...",
+ self.bar.set_message(&format!("[{} {} {}]: Preparing...",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version()
@@ -679,7 +679,7 @@ impl<'a> JobTask<'a> {
self.git_commit_env,
dependency_artifacts)?;
- self.bar.set_message(format!("[{} {} {}]: Scheduling...",
+ self.bar.set_message(&format!("[{} {} {}]: Scheduling...",
self.jobdef.job.uuid(),
self.jobdef.job.package().name(),
self.jobdef.job.package().version()