Skip to content

Commit

Permalink
Merge pull request #27 from ErichDonGubler/task-id-path-segment
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add task ID segment to local artifact path
  • Loading branch information
ErichDonGubler authored Jun 14, 2024
2 parents b64c060 + 00b581d commit d142577
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env_logger = "0.10.0"
format = "0.2.4"
futures = { version = "0.3.28", default-features = false, features = ["std"] }
indicatif = { version = "0.17.6", features = ["futures"] }
joinery = "3.1.0"
log = "0.4.20"
regex = "1.9.4"
reqwest = { version = "0.11.20", features = ["gzip", "json"] }
Expand Down
20 changes: 12 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use clap::Parser;
use format::lazy_format;
use futures::stream::StreamExt;
use indicatif::ProgressBar;
use joinery::JoinableIterator as _;
use regex::Regex;
use reqwest::{Client, StatusCode, Url};
use serde::Deserialize;
Expand Down Expand Up @@ -312,10 +313,6 @@ async fn get_artifacts_for_revision(client: &Client, options: &Options, revision
..
} = job;

let job_path = format!(
"{revision}/{platform}/{platform_option}/{job_group_symbol}/{job_type_symbol}"
);

let this_run_idx: u32;
{
let mut run_counts = run_counts.lock().unwrap();
Expand Down Expand Up @@ -362,10 +359,17 @@ async fn get_artifacts_for_revision(client: &Client, options: &Options, revision
}

let local_artifact_path = {
let mut path = out_dir.join(job_path);
path.push(&this_run_idx.to_string());
path.push(artifact_name);
path
let segments: &[&dyn std::fmt::Display] = &[
revision,
platform,
platform_option,
job_group_symbol,
job_type_symbol,
task_id,
&this_run_idx,
artifact_name,
];
out_dir.join(segments.iter().join_with('/').to_string())
};

if local_artifact_path.is_file() {
Expand Down

0 comments on commit d142577

Please sign in to comment.