From c5e056bf3a3095be178048707b5ee16017215f00 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 15:51:08 +0200 Subject: [PATCH 01/10] Update dependencies --- Cargo.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bb8352..c74a47f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,18 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.12.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602d785912f476e480434627e8732e6766b760c045bbf897d9dfaa9f4fbd399c" +checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ "gimli", ] [[package]] -name = "adler32" -version = "1.1.0" +name = "adler" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" +checksum = "ccc9a9dd069569f212bc4330af9f17c4afb5e8ce185e83dbb14f1349dda18b10" [[package]] name = "aho-corasick" @@ -155,9 +155,9 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "backtrace" -version = "0.3.49" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05100821de9e028f12ae3d189176b41ee198341eb8f369956407fea2f5cc666c" +checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" dependencies = [ "addr2line", "cfg-if", @@ -721,9 +721,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" [[package]] name = "git2" @@ -1014,9 +1014,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.71" +version = "0.2.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" +checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701" [[package]] name = "libgit2-sys" @@ -1097,11 +1097,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.7" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" dependencies = [ - "adler32", + "adler", ] [[package]] From c2ffdd6f7ca3fc8a5056c9c8107dd621ba95be5c Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 16:15:58 +0200 Subject: [PATCH 02/10] Actually calculate patches from uncompressed data --- src/compression.rs | 13 +++++++++--- src/index.rs | 52 +++++++++++++++++++++++++++++++++------------- src/lib.rs | 2 +- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/src/compression.rs b/src/compression.rs index 7b3c29f..e7112ea 100644 --- a/src/compression.rs +++ b/src/compression.rs @@ -1,15 +1,22 @@ use erreur::{Context, Result}; -use std::{env, io::Write}; -use zstd::stream::write::Encoder as ZstdEncoder; +use std::{ + env, + io::{Read, Write}, +}; +use zstd::stream::{decode_all, write::Encoder as ZstdEncoder}; pub fn compress(w: W) -> Result> { ZstdEncoder::new(w, compression_level()).context("Can't instantiate ZSTD encoder") } +pub fn decompress(r: R) -> Result> { + decode_all(r).context("Can't read zstd compressed file") +} + const LEVEL_VAR: &str = "ARTEFACTA_COMPRESSION_LEVEL"; #[cfg(test)] -const DEFAULT_LEVEL: i32 = 10; +const DEFAULT_LEVEL: i32 = 14; #[cfg(not(test))] const DEFAULT_LEVEL: i32 = 1; diff --git a/src/index.rs b/src/index.rs index 6d3e153..14304a8 100644 --- a/src/index.rs +++ b/src/index.rs @@ -6,7 +6,7 @@ use erreur::{bail, ensure, Context, Help, Result}; use std::{ convert::TryFrom, fs::{self, File}, - io::{self, BufReader, Read}, + io::{self, BufReader, Cursor, Read}, path::Path, }; @@ -79,6 +79,11 @@ impl Index { Ok(bytes) } + fn file_size(size: u64) -> String { + use humansize::{file_size_opts as options, FileSize}; + size.file_size(options::BINARY).expect("never negative") + } + if self.get_patch(from.clone(), to.clone()).await.is_ok() { log::warn!( "asked to calculate patch from `{:?}` to `{:?}` but it's already present", @@ -100,25 +105,35 @@ impl Index { .await .context("get old build")?; let old_build = read_file(old_build).context("read old build")?; + let old_build = crate::decompress(Cursor::new(old_build))?; + let new_build = self.get_build(to.clone()).await.context("get new build")?; + let new_build_size = new_build.size; let new_build = read_file(new_build).context("read new build")?; + let new_build = crate::decompress(Cursor::new(new_build))?; let path_name = Patch::new(from.clone(), to.clone()); // TODO: Fix that arbitrary "+ zst" here and everywhere else let patch_path = local.join(path_name.to_string() + ".zst"); - log::info!("write patch {:?} to `{:?}`", path_name, patch_path); - - let mut patch = crate::compress(File::create(&patch_path)?)?; - bidiff::simple_diff_with_params( - &old_build, - &new_build, - &mut patch, - &bidiff::DiffParams { - sort_partitions: 4, - scan_chunk_size: Some(10_000_000), - }, - )?; - patch.finish()?; + log::debug!("write patch {:?} to `{:?}`", path_name, patch_path); + + let mut patch = + crate::compress(File::create(&patch_path).context("creating file to write patch to")?)?; + bidiff::simple_diff_with_params(&old_build, &new_build, &mut patch, &{ + const MB: u64 = 1_000_000; + bidiff::DiffParams { + sort_partitions: { + if new_build_size > (100 * MB) { + 4 + } else { + 1 + } + }, + scan_chunk_size: Some(100 * MB as usize), + } + }) + .context("calculating binary diff between builds")?; + patch.finish().context("finishing zstd file")?; let patch_size = patch_path .metadata() @@ -136,6 +151,15 @@ impl Index { size: patch_size, }; + log::info!( + "Calculated new patch from {} to {} of size {} -- that's {:.1}% of the new build's {}", + from, + to, + file_size(patch_size), + (patch_size as f64) / (new_build_size as f64) * 100_f64, + file_size(new_build_size), + ); + self.patch_graph .add_patch(&from, &to, entry, Location::Local)?; diff --git a/src/lib.rs b/src/lib.rs index 1f811b4..93710aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ mod storage; pub use storage::Storage; mod compression; -pub use compression::compress; +pub use compression::{compress, decompress}; #[cfg(test)] pub(crate) mod test_helpers; From b7d94100e8be4e6ca38e1f21cc71a998adf77ea8 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 16:25:54 +0200 Subject: [PATCH 03/10] Support fuzzier git tag matching --- src/git.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/git.rs b/src/git.rs index d9e26e0..4c1bb3c 100644 --- a/src/git.rs +++ b/src/git.rs @@ -38,7 +38,8 @@ pub fn find_tags_to_patch(current: &str, tags: &[String]) -> Result> } fn tag_to_slice(tag: &str) -> Vec { - tag.split(|c| c == '.' || c == '-') + tag.to_lowercase() + .split(|c| c == '.' || c == '-') .map(SmolStr::from) .collect() } @@ -156,3 +157,20 @@ fn tags_to_patch_from_4() { vec!["IL40.2.18".to_string(), "IL40.1.0".to_string()] ); } + +#[test] +fn tags_to_patch_from_fuzzy() { + let tags = vec![ + "IL40.0.1".to_string(), + "IL40.1.0".to_string(), + "IL40.2.17".to_string(), + "IL40.2.18".to_string(), + "IL40.x.0".to_string(), + ]; + let current_tag = "il40-2-19"; + let patch_these = find_tags_to_patch(current_tag, &tags).unwrap(); + assert_eq!( + patch_these, + vec!["IL40.2.18".to_string(), "IL40.1.0".to_string()] + ); +} From 30b0bd191ac3ce78a4bd9ed77c912628f6f85f95 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 16:42:19 +0200 Subject: [PATCH 04/10] Some more compression fixes --- src/apply_patch.rs | 4 ++-- src/index.rs | 6 +++--- src/packaging.rs | 2 +- src/test_helpers.rs | 2 +- tests/add.rs | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/apply_patch.rs b/src/apply_patch.rs index b33f77b..8571aed 100644 --- a/src/apply_patch.rs +++ b/src/apply_patch.rs @@ -34,10 +34,10 @@ mod tests { let dir = tempdir()?; let file1 = dir.path().join("1.tar.zst"); - let content1 = random_file(&file1)?; + let content1 = random_zstd_file(&file1)?; let file2 = dir.path().join("2.tar.zst"); - let content2 = random_file(&file2)?; + let content2 = random_zstd_file(&file2)?; let patch_1_2 = dir.path().join("1-2.patch.zst"); diff --git a/src/index.rs b/src/index.rs index 14304a8..a40b715 100644 --- a/src/index.rs +++ b/src/index.rs @@ -520,9 +520,9 @@ mod tests { let remote_dir = tempdir()?; // Add some builds - let _build1 = random_file(local_dir.path().join("build1.tar.zst"))?; - let _build2 = random_file(local_dir.path().join("build2.tar.zst"))?; - let _build3 = random_file(local_dir.path().join("build3.tar.zst"))?; + let _build1 = random_zstd_file(local_dir.path().join("build1.tar.zst"))?; + let _build2 = random_zstd_file(local_dir.path().join("build2.tar.zst"))?; + let _build3 = random_zstd_file(local_dir.path().join("build3.tar.zst"))?; let mut index = Index::new(local_dir.path(), remote_dir.path().try_into()?).await?; diff --git a/src/packaging.rs b/src/packaging.rs index 87cc3ac..e081c82 100644 --- a/src/packaging.rs +++ b/src/packaging.rs @@ -214,7 +214,7 @@ mod tests { // create some random files in random paths for f in &files { - random_file(&dir1.join(f)).expect("random_file"); + random_zstd_file(&dir1.join(f)).expect("random_file"); } // package this dir diff --git a/src/test_helpers.rs b/src/test_helpers.rs index f9d81d9..94cdeb2 100644 --- a/src/test_helpers.rs +++ b/src/test_helpers.rs @@ -16,7 +16,7 @@ pub fn tempdir() -> Result { assert_fs::TempDir::new().context("can't create temp dir") } -pub fn random_file(path: impl AsRef) -> Result> { +pub fn random_zstd_file(path: impl AsRef) -> Result> { let path = path.as_ref(); let mut rng = rand::thread_rng(); let mut raw_content = vec![0u8; 1024]; diff --git a/tests/add.rs b/tests/add.rs index 1659446..2ab0c8c 100644 --- a/tests/add.rs +++ b/tests/add.rs @@ -137,8 +137,8 @@ fn add_build_locally_and_calculate_a_patch() { let scratch = tempdir().unwrap(); let scratch = scratch.path(); - fs::write(local.join("build1.tar.zst"), b"foobar").unwrap(); - fs::write(scratch.join("build2.tar.zst"), b"foobarbaz").unwrap(); + crate::test_helpers::random_zstd_file(local.join("build1.tar.zst")).unwrap(); + crate::test_helpers::random_zstd_file(scratch.join("build2.tar.zst")).unwrap(); artefacta(local, remote) .arg("add") @@ -169,7 +169,7 @@ fn adding_file_that_does_not_exist() { let scratch = tempdir().unwrap(); let scratch = scratch.path(); - fs::write(scratch.join("right-name.tar.zst"), b"foobarbaz").unwrap(); + crate::test_helpers::random_zstd_file(scratch.join("right-name.tar.zst")).unwrap(); artefacta(local, remote) .arg("add") From 265c2305c47047a44ff88b006550d5b74b0713e3 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 16:43:14 +0200 Subject: [PATCH 05/10] Add `--prefix=$NAME` flag to `auto-patch` --- src/main.rs | 20 +++++++++++++++++--- tests/git.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3399111..b7b6920 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,6 +53,10 @@ enum Command { /// Version to created patches to #[structopt(env = "CI_COMMIT_REF_NAME")] current: Version, + /// Prefix for finding builds, used like "$prefix$tag". When setting + /// this, omit the prefix from the current flag. + #[structopt(long, default_value)] + prefix: String, }, /// Sync all new local files to remote store Sync, @@ -200,8 +204,17 @@ async fn main() -> Result<()> { Command::AutoPatch { repo_root: WorkingDir(repo_root), current, + prefix, } => { - index.get_build(current.clone()).await?; + let current_build = + Version::try_from(&format!("{}{}", prefix, current)).with_context(|| { + format!( + "given current version name is not valid with given prefix `{}`", + prefix + ) + })?; + log::debug!("current version incl. given prefix is {}", current_build); + index.get_build(current_build.clone()).await?; let repo = git2::Repository::discover(&repo_root) .with_context(|| format!("can't open repository at `{}`", repo_root.display())) @@ -228,11 +241,12 @@ async fn main() -> Result<()> { let mut failed = false; for tag in &to_patch { - if let Err(e) = get_and_patch(&mut index, tag, current.clone()).await { + let tag = format!("{}{}", prefix, tag); + if let Err(e) = get_and_patch(&mut index, &tag, current_build.clone()).await { log::error!("could not create patch from tag {}: {:?}", tag, e); failed = true; } else { - log::info!("create patch `{}` -> `{}`", tag, current); + log::info!("create patch `{}` -> `{}`", tag, current_build); } } if failed { diff --git a/tests/git.rs b/tests/git.rs index 273daf5..b0e871a 100644 --- a/tests/git.rs +++ b/tests/git.rs @@ -79,3 +79,50 @@ fn auto_patch_from_git_repo() { assert!(local.join("0.1.1-0.2.1.patch.zst").exists()); assert!(local.join("0.2.0-0.2.1.patch.zst").exists()); } + +#[test] +fn auto_patch_from_git_repo_with_prefix() { + let (local, remote) = init(); + let (local, remote) = (local.path(), remote.path()); + let repo = tempdir().unwrap(); + let repo = repo.path(); + + run("git init .", &repo); + run("git config user.email 'git-test@example.com'", &repo); + run("git config user.name 'Author Name'", &repo); + + run("mkdir src", &repo); + run("echo foo > src/wtf", &repo); + run("git add .", &repo); + run("git commit -m 'bump 0.1.0'", &repo); + run("git tag 0.1.0", &repo); + artefacta(local, remote) + .arg("add-package") + .arg("wtf-0.1.0") + .arg(repo.join("src")) + .succeeds(); + + run("echo bar > src/wtf", &repo); + run("git add .", &repo); + run("git commit -m 'bump 0.1.1'", &repo); + run("git tag 0.1.1", &repo); + artefacta(local, remote) + .arg("add-package") + .arg("wtf-0.1.1") + .arg(repo.join("src")) + .succeeds(); + artefacta(local, remote) + .arg("auto-patch") + .arg("--repo-root") + .arg(&repo) + .arg("--prefix=wtf-") + .arg("0.1.1") + .succeeds(); + + run("git tag -l", &repo); + ls(&local); + + assert!(local.join("wtf-0.1.0.tar.zst").exists()); + assert!(local.join("wtf-0.1.1.tar.zst").exists()); + assert!(local.join("wtf-0.1.0---wtf-0.1.1.patch.zst").exists()); +} From bf2781d04d50acf2e6fd2c6700ace6ff6c9ea9d8 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 17:34:56 +0200 Subject: [PATCH 06/10] Fuzzy find builds from tag names --- src/git.rs | 14 +++++++------- src/index.rs | 10 ++++++++++ src/index/graph.rs | 2 +- src/lib.rs | 2 ++ src/main.rs | 9 +-------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/git.rs b/src/git.rs index 4c1bb3c..5b0c1df 100644 --- a/src/git.rs +++ b/src/git.rs @@ -29,6 +29,13 @@ pub fn get_tags(repo: &git2::Repository) -> Result> { .collect() } +pub fn tag_to_slice(tag: &str) -> Vec { + tag.to_lowercase() + .split(|c| c == '.' || c == '-') + .map(SmolStr::from) + .collect() +} + /// assume versions are in format `….c.b.a` (or `…-c-b-a`) pub fn find_tags_to_patch(current: &str, tags: &[String]) -> Result> { fn dec(x: &SmolStr) -> Option { @@ -37,13 +44,6 @@ pub fn find_tags_to_patch(current: &str, tags: &[String]) -> Result> Some(SmolStr::from(prev.to_string())) } - fn tag_to_slice(tag: &str) -> Vec { - tag.to_lowercase() - .split(|c| c == '.' || c == '-') - .map(SmolStr::from) - .collect() - } - let parsed_tags = tags.iter().map(|tag| tag_to_slice(tag)).collect::>(); let current = tag_to_slice(current); diff --git a/src/index.rs b/src/index.rs index a40b715..a7872ff 100644 --- a/src/index.rs +++ b/src/index.rs @@ -350,6 +350,16 @@ impl Index { .context("fetch newly added local build") } + pub fn get_build_for_tag(&self, tag: &str) -> Result { + let parsed_tag = crate::git::tag_to_slice(tag); + self.patch_graph + .builds + .keys() + .find(|build| crate::git::tag_to_slice(build.as_str()) == parsed_tag) + .cloned() + .with_context(|| format!("no build found matching tag `{}`", tag)) + } + pub async fn add_local_build(&mut self, path: impl AsRef) -> Result { let entry = Entry::from_path(path.as_ref(), self.local.clone()) .context("local build file as entry")?; diff --git a/src/index/graph.rs b/src/index/graph.rs index 2ecc8ee..55fba21 100644 --- a/src/index/graph.rs +++ b/src/index/graph.rs @@ -14,7 +14,7 @@ use std::{collections::HashMap, convert::TryFrom, fs::ReadDir, io::Error as IoEr pub struct PatchGraph { graph: Graph, /// helper for looking up nodes in the graph - builds: HashMap>, + pub(crate) builds: HashMap>, /// helper for looking up edges in the graph patches: HashMap<(Version, Version), EdgeIndex>, } diff --git a/src/lib.rs b/src/lib.rs index 93710aa..8e61c71 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,5 +15,7 @@ pub use storage::Storage; mod compression; pub use compression::{compress, decompress}; +pub(crate) mod git; + #[cfg(test)] pub(crate) mod test_helpers; diff --git a/src/main.rs b/src/main.rs index b7b6920..fc92738 100644 --- a/src/main.rs +++ b/src/main.rs @@ -228,12 +228,6 @@ async fn main() -> Result<()> { .map(|tag| tag.name.clone()) .collect::>(); log::trace!("found these tags in repo: {:?}", tag_names); - ensure!( - tag_names.iter().any(|tag| tag.as_str() == current.as_str()), - "given version `{}` is not a tag in the repository (`{}`)", - current, - repo_root.display() - ); let to_patch = git::find_tags_to_patch(current.as_str(), &tag_names) .context("can't find version to create patches for")?; @@ -259,8 +253,7 @@ async fn main() -> Result<()> { tag: &str, to: Version, ) -> Result<()> { - let version = Version::try_from(tag) - .with_context(|| format!("cant' parse tag `{}` as version", tag))?; + let version = index.get_build_for_tag(tag)?; index.get_build(version.clone()).await?; index.calculate_patch(version.clone(), to.clone()).await?; Ok(()) From cbe5240431174ced5ea65c05e14b8796c8443493 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 17:48:43 +0200 Subject: [PATCH 07/10] Expose git module --- src/lib.rs | 2 +- src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8e61c71..eb1474c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ pub use storage::Storage; mod compression; pub use compression::{compress, decompress}; -pub(crate) mod git; +pub mod git; #[cfg(test)] pub(crate) mod test_helpers; diff --git a/src/main.rs b/src/main.rs index fc92738..17ebec4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,8 +7,7 @@ use std::{ }; use structopt::StructOpt; -use artefacta::{compress, package, paths, ArtefactIndex, Storage, Version}; -pub(crate) mod git; +use artefacta::{compress, git, package, paths, ArtefactIndex, Storage, Version}; /// Manage software builds in different versions across local and remote storage #[derive(Debug, StructOpt)] @@ -240,7 +239,7 @@ async fn main() -> Result<()> { log::error!("could not create patch from tag {}: {:?}", tag, e); failed = true; } else { - log::info!("create patch `{}` -> `{}`", tag, current_build); + log::info!("patch `{}` -> `{}`", tag, current_build); } } if failed { @@ -254,6 +253,7 @@ async fn main() -> Result<()> { to: Version, ) -> Result<()> { let version = index.get_build_for_tag(tag)?; + log::debug!("source version: picked {} from tag {}", version, tag); index.get_build(version.clone()).await?; index.calculate_patch(version.clone(), to.clone()).await?; Ok(()) From efcbc3ef3590a4cb1088b0a594702524da4a40f0 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 17:48:51 +0200 Subject: [PATCH 08/10] Info logging by default --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 17ebec4..a1d2eeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -314,7 +314,10 @@ fn setup_logging(verbose: bool) { if verbose { log.filter(None, log::LevelFilter::Info) .filter(Some("artefacta"), log::LevelFilter::Debug); - }; + } else { + log.filter(None, log::LevelFilter::Warn) + .filter(Some("artefacta"), log::LevelFilter::Info); + } if let Ok(s) = std::env::var("RUST_LOG") { log.parse_filters(&s); From 4edb0ad56295ff93223fdd7776da2fae0f3e4c4a Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 17:51:07 +0200 Subject: [PATCH 09/10] Say when we got something from S3 --- src/storage/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage/mod.rs b/src/storage/mod.rs index a5ae231..f1c3d1e 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -249,6 +249,8 @@ impl Storage { size.file_size(options::BINARY).expect("never negative") ) }); + + log::debug!("fetching `{}` from S3", key); let mut body = Vec::new(); stream .read_to_end(&mut body) @@ -256,7 +258,7 @@ impl Storage { .context("failed to read object content into buffer") .note("S3 has bad days just like the rest of us")?; - log::info!("read `{}`.", key); + log::info!("downloaded `{}` from S3", key); let entry = Entry { storage: self.clone(), From d33c7d8a53c598a9a385c594667c7c3646f59f49 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 8 Jul 2020 17:54:38 +0200 Subject: [PATCH 10/10] Bump version to 0.0.8 [ci skip] --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c74a47f..5e6ee03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,7 +53,7 @@ checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "artefacta" -version = "0.0.7" +version = "0.0.8" dependencies = [ "assert_cmd", "assert_fs", diff --git a/Cargo.toml b/Cargo.toml index e116946..134f7b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "artefacta" -version = "0.0.7" +version = "0.0.8" authors = ["Pascal Hertleif "] edition = "2018" license = "MIT OR Apache-2.0"