Skip to content

Commit c10bf76

Browse files
committed
fix(upload): simplify run_part_id computation
1 parent f3fcd31 commit c10bf76

2 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/run/run_index_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl RunIndexState {
3636
.join(".codspeed")
3737
.join("run-state")
3838
.join(run_id)
39-
.join(format!("{}.json", &run_part_id_hash[..16]));
39+
.join(format!("{run_part_id_hash}.json"));
4040

4141
Self { state_file_path }
4242
}

src/run_environment/provider.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,20 @@ pub trait RunEnvironmentProvider {
100100
// Apply run index suffix to run_part if applicable.
101101
// This differentiates multiple uploads within the same CI job execution
102102
// (e.g., running both simulation and memory benchmarks in the same job).
103-
let run_part = match self.get_run_provider_run_part() {
104-
Some(run_part) => {
105-
let run_index_state = RunIndexState::new(
106-
&run_environment_metadata.repository_root_path,
107-
&run_part.run_id,
108-
&run_part.run_part_id,
109-
);
110-
match run_index_state.get_and_increment() {
111-
Ok(run_index) => Some(run_part.with_run_index(run_index)),
112-
Err(e) => {
113-
warn!("Failed to track run index: {e}. Continuing with index 0.");
114-
Some(run_part.with_run_index(0))
115-
}
103+
let run_part = self.get_run_provider_run_part().map(|run_part| {
104+
let run_index_state = RunIndexState::new(
105+
&run_environment_metadata.repository_root_path,
106+
&run_part.run_id,
107+
&run_part.run_part_id,
108+
);
109+
match run_index_state.get_and_increment() {
110+
Ok(run_index) => run_part.with_run_index(run_index),
111+
Err(e) => {
112+
warn!("Failed to track run index: {e}. Continuing with index 0.");
113+
run_part.with_run_index(0)
116114
}
117115
}
118-
None => None,
119-
};
116+
});
120117

121118
Ok(UploadMetadata {
122119
version: Some(LATEST_UPLOAD_METADATA_VERSION),

0 commit comments

Comments
 (0)