Skip to content

Commit cce1dbf

Browse files
committed
feat(upload): add allow_empty in upload metadata
1 parent a1f36fc commit cce1dbf

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/run/uploader/interfaces.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::instruments::InstrumentName;
55
use crate::run::check_system::SystemInfo;
66
use crate::run_environment::{RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunPart};
77

8-
pub const LATEST_UPLOAD_METADATA_VERSION: u32 = 7;
8+
pub const LATEST_UPLOAD_METADATA_VERSION: u32 = 8;
99

1010
#[derive(Deserialize, Serialize, Debug)]
1111
#[serde(rename_all = "camelCase")]
@@ -19,6 +19,7 @@ pub struct UploadMetadata {
1919
pub run_environment: RunEnvironment,
2020
pub run_part: Option<RunPart>,
2121
pub commit_hash: String,
22+
pub allow_empty: bool,
2223
#[serde(flatten)]
2324
pub run_environment_metadata: RunEnvironmentMetadata,
2425
}

src/run/uploader/upload_metadata.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ mod tests {
4343
},
4444
run_environment: RunEnvironment::GithubActions,
4545
commit_hash: "5bd77cb0da72bef094893ed45fb793ff16ecfbe3".into(),
46+
allow_empty: false,
4647
run_environment_metadata: RunEnvironmentMetadata {
4748
ref_: "refs/pull/29/merge".into(),
4849
head_ref: Some("chore/native-action-runner".into()),
@@ -77,7 +78,7 @@ mod tests {
7778
hash,
7879
// Caution: when changing this value, we need to ensure that
7980
// the related backend snapshot remains the same
80-
@"7275243b4457a8fa70215c084210bea7518a3994b863e4437fa33c5ae2bd219e"
81+
@"11f363bd959389e57c79f6fc7d5c965d168c7b2f3cb2b566b647588b23322013"
8182
);
8283
assert_json_snapshot!(upload_metadata);
8384
}

src/run_environment/local/provider.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ impl RunEnvironmentProvider for LocalProvider {
226226
tokenless: config.token.is_none(),
227227
repository_provider,
228228
commit_hash: run_environment_metadata.ref_.clone(),
229+
allow_empty: config.allow_empty,
229230
run_environment_metadata,
230231
profile_md5: profile_archive.hash.clone(),
231232
profile_encoding: profile_archive.content.encoding(),

src/run_environment/provider.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pub trait RunEnvironmentProvider {
123123
profile_md5: profile_archive.hash.clone(),
124124
profile_encoding: profile_archive.content.encoding(),
125125
commit_hash,
126+
allow_empty: config.allow_empty,
126127
runner: Runner {
127128
name: "codspeed-runner".into(),
128129
version: crate::VERSION.into(),

0 commit comments

Comments
 (0)