diff --git a/src/api/data_types/chunking/build.rs b/src/api/data_types/chunking/build.rs index 072f2136ab..a7b176dea5 100644 --- a/src/api/data_types/chunking/build.rs +++ b/src/api/data_types/chunking/build.rs @@ -11,6 +11,8 @@ pub struct ChunkedBuildRequest<'a> { pub build_configuration: Option<&'a str>, #[serde(skip_serializing_if = "Option::is_none")] pub release_notes: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub date_built: Option<&'a str>, #[serde(flatten)] pub vcs_info: &'a VcsInfo<'a>, } diff --git a/src/commands/build/upload.rs b/src/commands/build/upload.rs index 9b605a9a86..8cc1291891 100644 --- a/src/commands/build/upload.rs +++ b/src/commands/build/upload.rs @@ -106,6 +106,11 @@ pub fn make_command(command: Command) -> Command { .long("release-notes") .help("The release notes to use for the upload.") ) + .arg( + Arg::new("date_built") + .long("date-built") + .help("The date and time when the build was created (ISO 8601 format with timezone, e.g., '2025-11-26T10:30:00Z')") + ) } pub fn execute(matches: &ArgMatches) -> Result<()> { @@ -280,6 +285,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { let build_configuration = matches.get_one("build_configuration").map(String::as_str); let release_notes = matches.get_one("release_notes").map(String::as_str); + let date_built = matches.get_one("date_built").map(String::as_str); let api = Api::current(); let authenticated_api = api.authenticated()?; @@ -350,6 +356,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { &project, build_configuration, release_notes, + date_built, &vcs_info, ) { Ok(artifact_url) => { @@ -513,6 +520,7 @@ fn upload_file( project: &str, build_configuration: Option<&str>, release_notes: Option<&str>, + date_built: Option<&str>, vcs_info: &VcsInfo<'_>, ) -> Result { const SELF_HOSTED_ERROR_HINT: &str = "If you are using a self-hosted Sentry server, \ @@ -575,6 +583,7 @@ fn upload_file( chunks: &checksums, build_configuration, release_notes, + date_built, vcs_info, }, )?; diff --git a/tests/integration/_cases/build/build-upload-help-macos.trycmd b/tests/integration/_cases/build/build-upload-help-macos.trycmd index 0411e4dc2a..79165f531a 100644 --- a/tests/integration/_cases/build/build-upload-help-macos.trycmd +++ b/tests/integration/_cases/build/build-upload-help-macos.trycmd @@ -53,6 +53,9 @@ Options: be used. --release-notes The release notes to use for the upload. + --date-built + The date and time when the build was created (ISO 8601 format with timezone, e.g., + '2025-11-26T10:30:00Z') -h, --help Print help