Skip to content

Commit 68fef91

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

5 files changed

Lines changed: 8 additions & 4 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
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:5967ad62545b7a2816a10a2c92436d84b14b9eb7f4a55d841d1f8c4f669945c6
3-
size 1349
2+
oid sha256:45dd370f89126d39831fa65a8a507c045e0e8eaa08a986c4493807b85c13fe91
3+
size 1372

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)