diff --git a/.cursor/rules/rust-development.mdc b/.cursor/rules/rust-development.mdc index b10650e43a..e6dae94567 100644 --- a/.cursor/rules/rust-development.mdc +++ b/.cursor/rules/rust-development.mdc @@ -50,7 +50,7 @@ cargo fmt ## Swift/Apple Integration - Swift code in `apple-catalog-parsing/` is used for parsing xarchive files -- Used by the `mobile-app upload` command for iOS app processing +- Used by the `build upload` command for iOS app processing - Built as a separate crate with FFI bindings to Rust - Only compiled on macOS targets - Tests run via `swift-test.yml` workflow in CI diff --git a/src/api/data_types/chunking/mobile_app.rs b/src/api/data_types/chunking/build.rs similarity index 93% rename from src/api/data_types/chunking/mobile_app.rs rename to src/api/data_types/chunking/build.rs index a068392c1f..25bac84033 100644 --- a/src/api/data_types/chunking/mobile_app.rs +++ b/src/api/data_types/chunking/build.rs @@ -4,7 +4,7 @@ use sha1_smol::Digest; use super::ChunkedFileState; #[derive(Debug, Serialize)] -pub struct ChunkedMobileAppRequest<'a> { +pub struct ChunkedBuildRequest<'a> { pub checksum: Digest, pub chunks: &'a [Digest], #[serde(skip_serializing_if = "Option::is_none")] @@ -30,7 +30,7 @@ pub struct ChunkedMobileAppRequest<'a> { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct AssembleMobileAppResponse { +pub struct AssembleBuildResponse { pub state: ChunkedFileState, pub missing_chunks: Vec, pub detail: Option, diff --git a/src/api/data_types/chunking/mod.rs b/src/api/data_types/chunking/mod.rs index c1c2267625..79aed0dac1 100644 --- a/src/api/data_types/chunking/mod.rs +++ b/src/api/data_types/chunking/mod.rs @@ -2,17 +2,17 @@ //! from the server. mod artifact; +mod build; mod compression; mod dif; mod file_state; mod hash_algorithm; -mod mobile_app; mod upload; pub use self::artifact::{AssembleArtifactsResponse, ChunkedArtifactRequest}; +pub use self::build::{AssembleBuildResponse, ChunkedBuildRequest}; pub use self::compression::ChunkCompression; pub use self::dif::{AssembleDifsRequest, AssembleDifsResponse, ChunkedDifRequest}; pub use self::file_state::ChunkedFileState; pub use self::hash_algorithm::ChunkHashAlgorithm; -pub use self::mobile_app::{AssembleMobileAppResponse, ChunkedMobileAppRequest}; pub use self::upload::{ChunkServerOptions, ChunkUploadCapability}; diff --git a/src/api/mod.rs b/src/api/mod.rs index defc62df5a..7c1dae0f62 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1030,7 +1030,7 @@ impl<'a> AuthenticatedApi<'a> { .convert_rnf(ApiErrorKind::ReleaseNotFound) } - pub fn assemble_mobile_app( + pub fn assemble_build( &self, org: &str, project: &str, @@ -1038,7 +1038,7 @@ impl<'a> AuthenticatedApi<'a> { chunks: &[Digest], build_configuration: Option<&str>, vcs_info: &VcsInfo<'_>, - ) -> ApiResult { + ) -> ApiResult { let url = format!( "/projects/{}/{}/files/preprodartifacts/assemble/", PathArg(org), @@ -1046,7 +1046,7 @@ impl<'a> AuthenticatedApi<'a> { ); self.request(Method::Post, &url)? - .with_json_body(&ChunkedMobileAppRequest { + .with_json_body(&ChunkedBuildRequest { checksum, chunks, build_configuration, diff --git a/src/commands/mobile_app/mod.rs b/src/commands/build/mod.rs similarity index 79% rename from src/commands/mobile_app/mod.rs rename to src/commands/build/mod.rs index 9cae9207a6..f198fcf3dd 100644 --- a/src/commands/mobile_app/mod.rs +++ b/src/commands/build/mod.rs @@ -14,14 +14,14 @@ macro_rules! each_subcommand { pub fn make_command(mut command: Command) -> Command { macro_rules! add_subcommand { ($name:ident) => {{ - command = command.subcommand(crate::commands::mobile_app::$name::make_command( + command = command.subcommand(crate::commands::build::$name::make_command( Command::new(stringify!($name).replace('_', "-")), )); }}; } command = command - .about("[EXPERIMENTAL] Manage mobile apps.") + .about("[EXPERIMENTAL] Manage builds.") .subcommand_required(true) .arg_required_else_help(true) .org_arg() @@ -34,7 +34,7 @@ pub fn make_command(mut command: Command) -> Command { pub fn execute(matches: &ArgMatches) -> Result<()> { log::warn!( - "EXPERIMENTAL: The mobile-app subcommand is experimental. \ + "EXPERIMENTAL: The build subcommand is experimental. \ The command is subject to breaking changes and may be removed \ without notice in any release." ); @@ -44,7 +44,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { if let Some(sub_matches) = matches.subcommand_matches(&stringify!($name).replace('_', "-")) { - return crate::commands::mobile_app::$name::execute(&sub_matches); + return crate::commands::build::$name::execute(&sub_matches); } }}; } diff --git a/src/commands/mobile_app/upload.rs b/src/commands/build/upload.rs similarity index 94% rename from src/commands/mobile_app/upload.rs rename to src/commands/build/upload.rs index 42168c9f7b..ee3b6b1bab 100644 --- a/src/commands/mobile_app/upload.rs +++ b/src/commands/build/upload.rs @@ -13,15 +13,13 @@ use zip::{DateTime, ZipWriter}; use crate::api::{Api, AuthenticatedApi, ChunkUploadCapability, ChunkedFileState, VcsInfo}; use crate::config::Config; use crate::utils::args::ArgExt as _; +#[cfg(all(target_os = "macos", target_arch = "aarch64"))] +use crate::utils::build::{handle_asset_catalogs, ipa_to_xcarchive, is_apple_app, is_ipa_file}; +use crate::utils::build::{is_aab_file, is_apk_file, is_zip_file, normalize_directory}; use crate::utils::chunks::{upload_chunks, Chunk}; use crate::utils::fs::get_sha1_checksums; use crate::utils::fs::TempDir; use crate::utils::fs::TempFile; -#[cfg(all(target_os = "macos", target_arch = "aarch64"))] -use crate::utils::mobile_app::{ - handle_asset_catalogs, ipa_to_xcarchive, is_apple_app, is_ipa_file, -}; -use crate::utils::mobile_app::{is_aab_file, is_apk_file, is_zip_file, normalize_directory}; use crate::utils::progress::ProgressBar; use crate::utils::vcs::{ self, get_provider_from_remote, get_repo_from_remote, git_repo_remote_url, @@ -29,12 +27,13 @@ use crate::utils::vcs::{ pub fn make_command(command: Command) -> Command { #[cfg(all(target_os = "macos", target_arch = "aarch64"))] - const HELP_TEXT: &str = "The path to the mobile app files to upload. Supported files include Apk, Aab, XCArchive, and IPA."; + const HELP_TEXT: &str = + "The path to the build to upload. Supported files include Apk, Aab, XCArchive, and IPA."; #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] const HELP_TEXT: &str = - "The path to the mobile app files to upload. Supported files include Apk, and Aab."; + "The path to the build to upload. Supported files include Apk, and Aab."; command - .about("[EXPERIMENTAL] Upload mobile app files to a project.") + .about("[EXPERIMENTAL] Upload builds to a project.") .org_arg() .project_arg(false) .arg( @@ -149,10 +148,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { let api = Api::current(); let authenticated_api = api.authenticated()?; - debug!( - "Starting mobile app upload for {} paths", - path_strings.len() - ); + debug!("Starting upload for {} paths", path_strings.len()); let mut normalized_zips = vec![]; for path_string in path_strings { @@ -166,7 +162,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { let byteview = ByteView::open(path)?; debug!("Loaded file with {} bytes", byteview.len()); - validate_is_mobile_app(path, &byteview)?; + validate_is_supported_build(path, &byteview)?; let normalized_zip = if path.is_file() { debug!("Normalizing file: {}", path.display()); @@ -285,8 +281,8 @@ fn handle_file(path: &Path, byteview: &ByteView) -> Result { }) } -fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> { - debug!("Validating mobile app format for: {}", path.display()); +fn validate_is_supported_build(path: &Path, bytes: &[u8]) -> Result<()> { + debug!("Validating build format for: {}", path.display()); #[cfg(all(target_os = "macos", target_arch = "aarch64"))] if is_apple_app(path) { @@ -325,7 +321,7 @@ fn validate_is_mobile_app(path: &Path, bytes: &[u8]) -> Result<()> { let format_list = "APK, or AAB"; Err(anyhow!( - "File is not a recognized mobile app format ({format_list}): {}", + "File is not a recognized supported build format ({format_list}): {}", path.display() )) } @@ -379,7 +375,7 @@ fn upload_file( vcs_info: &VcsInfo<'_>, ) -> Result { const SELF_HOSTED_ERROR_HINT: &str = "If you are using a self-hosted Sentry server, \ - update to the latest version of Sentry to use the mobile-app upload command."; + update to the latest version of Sentry to use the build upload command."; debug!( "Uploading file to organization: {}, project: {}, build_configuration: {}, vcs_info: {:?}", @@ -392,7 +388,7 @@ fn upload_file( let chunk_upload_options = api.get_chunk_upload_options(org)?.ok_or_else(|| { anyhow!( "The Sentry server lacks chunked uploading support, which \ - is required for mobile app uploads. {SELF_HOSTED_ERROR_HINT}" + is required for build uploads. {SELF_HOSTED_ERROR_HINT}" ) })?; @@ -433,7 +429,7 @@ fn upload_file( // n. state=error, artifact_url unset let result = loop { - let response = api.assemble_mobile_app( + let response = api.assemble_build( org, project, checksum, @@ -497,7 +493,7 @@ mod tests { #[cfg(all(target_os = "macos", target_arch = "aarch64"))] fn test_xcarchive_upload_includes_parsed_assets() -> Result<()> { // Test that XCArchive uploads include parsed asset catalogs - let xcarchive_path = Path::new("tests/integration/_fixtures/mobile_app/archive.xcarchive"); + let xcarchive_path = Path::new("tests/integration/_fixtures/build/archive.xcarchive"); // Process the XCArchive directory let result = handle_directory(xcarchive_path)?; @@ -529,7 +525,7 @@ mod tests { #[cfg(all(target_os = "macos", target_arch = "aarch64"))] fn test_ipa_upload_includes_parsed_assets() -> Result<()> { // Test that IPA uploads handle missing asset catalogs gracefully - let ipa_path = Path::new("tests/integration/_fixtures/mobile_app/ipa_with_asset.ipa"); + let ipa_path = Path::new("tests/integration/_fixtures/build/ipa_with_asset.ipa"); let byteview = ByteView::open(ipa_path)?; // Process the IPA file - this should work even without asset catalogs diff --git a/src/commands/mod.rs b/src/commands/mod.rs index d9a2b8f042..a149e66394 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -20,6 +20,7 @@ use crate::utils::update::run_sentrycli_update_nagger; use crate::utils::value_parsers::auth_token_parser; mod bash_hook; +mod build; mod dart_symbol_map; mod debug_files; mod deploys; @@ -30,7 +31,6 @@ mod info; mod issues; mod login; mod logs; -mod mobile_app; mod monitors; mod organizations; mod projects; @@ -52,6 +52,7 @@ mod upload_proguard; macro_rules! each_subcommand { ($mac:ident) => { $mac!(bash_hook); + $mac!(build); $mac!(debug_files); $mac!(deploys); $mac!(events); @@ -60,7 +61,6 @@ macro_rules! each_subcommand { $mac!(issues); $mac!(login); $mac!(logs); - $mac!(mobile_app); $mac!(monitors); $mac!(organizations); $mac!(projects); diff --git a/src/utils/mobile_app/apple.rs b/src/utils/build/apple.rs similarity index 100% rename from src/utils/mobile_app/apple.rs rename to src/utils/build/apple.rs diff --git a/src/utils/mobile_app/mod.rs b/src/utils/build/mod.rs similarity index 100% rename from src/utils/mobile_app/mod.rs rename to src/utils/build/mod.rs diff --git a/src/utils/mobile_app/normalize.rs b/src/utils/build/normalize.rs similarity index 100% rename from src/utils/mobile_app/normalize.rs rename to src/utils/build/normalize.rs diff --git a/src/utils/mobile_app/validation.rs b/src/utils/build/validation.rs similarity index 100% rename from src/utils/mobile_app/validation.rs rename to src/utils/build/validation.rs diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 226aeac9fb..11c76b9c45 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -3,6 +3,7 @@ pub mod android; pub mod appcenter; pub mod args; pub mod auth_token; +pub mod build; pub mod chunks; pub mod cordova; pub mod dif; @@ -15,7 +16,6 @@ pub mod fs; pub mod http; pub mod logging; pub mod metrics; -pub mod mobile_app; pub mod progress; pub mod proguard; pub mod releases; diff --git a/tests/integration/_cases/mobile_app/mobile_app-help.trycmd b/tests/integration/_cases/build/build-help.trycmd similarity index 82% rename from tests/integration/_cases/mobile_app/mobile_app-help.trycmd rename to tests/integration/_cases/build/build-help.trycmd index 57c7dac791..6834debc82 100644 --- a/tests/integration/_cases/mobile_app/mobile_app-help.trycmd +++ b/tests/integration/_cases/build/build-help.trycmd @@ -1,12 +1,12 @@ ``` -$ sentry-cli mobile-app --help +$ sentry-cli build --help ? success -[EXPERIMENTAL] Manage mobile apps. +[EXPERIMENTAL] Manage builds. -Usage: sentry-cli[EXE] mobile-app [OPTIONS] +Usage: sentry-cli[EXE] build [OPTIONS] Commands: - upload [EXPERIMENTAL] Upload mobile app files to a project. + upload [EXPERIMENTAL] Upload builds to a project. help Print this message or the help of the given subcommand(s) Options: @@ -22,4 +22,4 @@ Options: [aliases: silent] -h, --help Print help -``` \ No newline at end of file +``` diff --git a/tests/integration/_cases/build/build-upload-apk-all-uploaded.trycmd b/tests/integration/_cases/build/build-upload-apk-all-uploaded.trycmd new file mode 100644 index 0000000000..095710d2e5 --- /dev/null +++ b/tests/integration/_cases/build/build-upload-apk-all-uploaded.trycmd @@ -0,0 +1,8 @@ +``` +$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk +? success +[..]WARN[..]EXPERIMENTAL: The build subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. +Successfully uploaded 1 file to Sentry + - tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42) + +``` diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-apk-no-token.trycmd b/tests/integration/_cases/build/build-upload-apk-no-token.trycmd similarity index 51% rename from tests/integration/_cases/mobile_app/mobile_app-upload-apk-no-token.trycmd rename to tests/integration/_cases/build/build-upload-apk-no-token.trycmd index 1c425a6698..a29ebd4323 100644 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-apk-no-token.trycmd +++ b/tests/integration/_cases/build/build-upload-apk-no-token.trycmd @@ -1,7 +1,7 @@ ``` -$ sentry-cli mobile-app upload tests/integration/_fixtures/mobile_app/apk.apk +$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk ? failed -[..]WARN[..]EXPERIMENTAL: The mobile-app subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. +[..]WARN[..]EXPERIMENTAL: The build subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. error: Auth token is required for this request. Please run `sentry-cli login` and try again! Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. diff --git a/tests/integration/_cases/build/build-upload-apk.trycmd b/tests/integration/_cases/build/build-upload-apk.trycmd new file mode 100644 index 0000000000..97868f4ae6 --- /dev/null +++ b/tests/integration/_cases/build/build-upload-apk.trycmd @@ -0,0 +1,8 @@ +``` +$ sentry-cli build upload tests/integration/_fixtures/build/apk.apk --head-sha test_head_sha +? success +[..]WARN[..]EXPERIMENTAL: The build subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. +Successfully uploaded 1 file to Sentry + - tests/integration/_fixtures/build/apk.apk (http[..]/wat-org/preprod/wat-project/42) + +``` diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-help-not-macos.trycmd b/tests/integration/_cases/build/build-upload-help-macos.trycmd similarity index 89% rename from tests/integration/_cases/mobile_app/mobile_app-upload-help-not-macos.trycmd rename to tests/integration/_cases/build/build-upload-help-macos.trycmd index 92910a2b5b..122b7838d8 100644 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-help-not-macos.trycmd +++ b/tests/integration/_cases/build/build-upload-help-macos.trycmd @@ -1,11 +1,12 @@ ``` -$ sentry-cli mobile-app upload --help -[EXPERIMENTAL] Upload mobile app files to a project. +$ sentry-cli build upload --help +? success +[EXPERIMENTAL] Upload builds to a project. -Usage: sentry-cli[EXE] mobile-app upload [OPTIONS] ... +Usage: sentry-cli[EXE] build upload [OPTIONS] ... Arguments: - ... The path to the mobile app files to upload. Supported files include Apk, and Aab. + ... The path to the build to upload. Supported files include Apk, Aab, XCArchive, and IPA. Options: -o, --org diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-help-macos.trycmd b/tests/integration/_cases/build/build-upload-help-not-macos.trycmd similarity index 88% rename from tests/integration/_cases/mobile_app/mobile_app-upload-help-macos.trycmd rename to tests/integration/_cases/build/build-upload-help-not-macos.trycmd index 9d8ff4d33a..a69c78bb0c 100644 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-help-macos.trycmd +++ b/tests/integration/_cases/build/build-upload-help-not-macos.trycmd @@ -1,13 +1,11 @@ ``` -$ sentry-cli mobile-app upload --help -? success -[EXPERIMENTAL] Upload mobile app files to a project. +$ sentry-cli build upload --help +[EXPERIMENTAL] Upload builds to a project. -Usage: sentry-cli[EXE] mobile-app upload [OPTIONS] ... +Usage: sentry-cli[EXE] build upload [OPTIONS] ... Arguments: - ... The path to the mobile app files to upload. Supported files include Apk, Aab, - XCArchive, and IPA. + ... The path to the build to upload. Supported files include Apk, and Aab. Options: -o, --org diff --git a/tests/integration/_cases/build/build-upload-ipa.trycmd b/tests/integration/_cases/build/build-upload-ipa.trycmd new file mode 100644 index 0000000000..8d0bde6566 --- /dev/null +++ b/tests/integration/_cases/build/build-upload-ipa.trycmd @@ -0,0 +1,8 @@ +``` +$ sentry-cli build upload tests/integration/_fixtures/build/ipa.ipa --head-sha test_head_sha +? success +[..]WARN[..]EXPERIMENTAL: The build subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. +Successfully uploaded 1 file to Sentry + - tests/integration/_fixtures/build/ipa.ipa (http[..]/wat-org/preprod/wat-project/some-text-id) + +``` diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-no-path.trycmd b/tests/integration/_cases/build/build-upload-no-path.trycmd similarity index 60% rename from tests/integration/_cases/mobile_app/mobile_app-upload-no-path.trycmd rename to tests/integration/_cases/build/build-upload-no-path.trycmd index a6c00fd1ba..f955c60469 100644 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-no-path.trycmd +++ b/tests/integration/_cases/build/build-upload-no-path.trycmd @@ -1,10 +1,10 @@ ``` -$ sentry-cli mobile-app upload +$ sentry-cli build upload ? failed error: the following required arguments were not provided: ... -Usage: sentry-cli[EXE] mobile-app upload ... +Usage: sentry-cli[EXE] build upload ... For more information, try '--help'. diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-apk-all-uploaded.trycmd b/tests/integration/_cases/mobile_app/mobile_app-upload-apk-all-uploaded.trycmd deleted file mode 100644 index 0e309d7f1c..0000000000 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-apk-all-uploaded.trycmd +++ /dev/null @@ -1,8 +0,0 @@ -``` -$ sentry-cli mobile-app upload tests/integration/_fixtures/mobile_app/apk.apk -? success -[..]WARN[..]EXPERIMENTAL: The mobile-app subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. -Successfully uploaded 1 file to Sentry - - tests/integration/_fixtures/mobile_app/apk.apk (http[..]/wat-org/preprod/wat-project/42) - -``` diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-apk.trycmd b/tests/integration/_cases/mobile_app/mobile_app-upload-apk.trycmd deleted file mode 100644 index 1da11a9ee6..0000000000 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-apk.trycmd +++ /dev/null @@ -1,8 +0,0 @@ -``` -$ sentry-cli mobile-app upload tests/integration/_fixtures/mobile_app/apk.apk --head-sha test_head_sha -? success -[..]WARN[..]EXPERIMENTAL: The mobile-app subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. -Successfully uploaded 1 file to Sentry - - tests/integration/_fixtures/mobile_app/apk.apk (http[..]/wat-org/preprod/wat-project/42) - -``` diff --git a/tests/integration/_cases/mobile_app/mobile_app-upload-ipa.trycmd b/tests/integration/_cases/mobile_app/mobile_app-upload-ipa.trycmd deleted file mode 100644 index fb7a9d5590..0000000000 --- a/tests/integration/_cases/mobile_app/mobile_app-upload-ipa.trycmd +++ /dev/null @@ -1,8 +0,0 @@ -``` -$ sentry-cli mobile-app upload tests/integration/_fixtures/mobile_app/ipa.ipa --head-sha test_head_sha -? success -[..]WARN[..]EXPERIMENTAL: The mobile-app subcommand is experimental. The command is subject to breaking changes and may be removed without notice in any release. -Successfully uploaded 1 file to Sentry - - tests/integration/_fixtures/mobile_app/ipa.ipa (http[..]/wat-org/preprod/wat-project/some-text-id) - -``` diff --git a/tests/integration/_expected_requests/mobile_app/apk_chunk.bin b/tests/integration/_expected_requests/build/apk_chunk.bin similarity index 100% rename from tests/integration/_expected_requests/mobile_app/apk_chunk.bin rename to tests/integration/_expected_requests/build/apk_chunk.bin diff --git a/tests/integration/_fixtures/mobile_app/apk.apk b/tests/integration/_fixtures/build/apk.apk similarity index 100% rename from tests/integration/_fixtures/mobile_app/apk.apk rename to tests/integration/_fixtures/build/apk.apk diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Info.plist b/tests/integration/_fixtures/build/archive.xcarchive/Info.plist similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Info.plist rename to tests/integration/_fixtures/build/archive.xcarchive/Info.plist diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon60x60@2x.png b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon60x60@2x.png similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon60x60@2x.png rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon60x60@2x.png diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon76x76@2x~ipad.png b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon76x76@2x~ipad.png similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon76x76@2x~ipad.png rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/AppIcon76x76@2x~ipad.png diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Assets.car b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Assets.car similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Assets.car rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Assets.car diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/DemoApp b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/DemoApp similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/DemoApp rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/DemoApp diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/Info.plist b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/Info.plist similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/Info.plist rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/Info.plist diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/TestFmwk b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/TestFmwk similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/TestFmwk rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/TestFmwk diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/_CodeSignature/CodeResources b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/_CodeSignature/CodeResources similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/_CodeSignature/CodeResources rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestFmwk.framework/_CodeSignature/CodeResources diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/Info.plist b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/Info.plist similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/Info.plist rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/Info.plist diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/TestingFmwk b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/TestingFmwk similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/TestingFmwk rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/TestingFmwk diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/_CodeSignature/CodeResources b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/_CodeSignature/CodeResources similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/_CodeSignature/CodeResources rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Frameworks/TestingFmwk.framework/_CodeSignature/CodeResources diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Info.plist b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Info.plist similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/Info.plist rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/Info.plist diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/PkgInfo b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/PkgInfo similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/PkgInfo rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/PkgInfo diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/_CodeSignature/CodeResources b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/_CodeSignature/CodeResources similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/_CodeSignature/CodeResources rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/_CodeSignature/CodeResources diff --git a/tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/embedded.mobileprovision b/tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/embedded.mobileprovision similarity index 100% rename from tests/integration/_fixtures/mobile_app/archive.xcarchive/Products/Applications/DemoApp.app/embedded.mobileprovision rename to tests/integration/_fixtures/build/archive.xcarchive/Products/Applications/DemoApp.app/embedded.mobileprovision diff --git a/tests/integration/_fixtures/mobile_app/invalid.ipa b/tests/integration/_fixtures/build/invalid.ipa similarity index 100% rename from tests/integration/_fixtures/mobile_app/invalid.ipa rename to tests/integration/_fixtures/build/invalid.ipa diff --git a/tests/integration/_fixtures/mobile_app/invalid_aab.aab b/tests/integration/_fixtures/build/invalid_aab.aab similarity index 100% rename from tests/integration/_fixtures/mobile_app/invalid_aab.aab rename to tests/integration/_fixtures/build/invalid_aab.aab diff --git a/tests/integration/_fixtures/mobile_app/invalid_apk.apk b/tests/integration/_fixtures/build/invalid_apk.apk similarity index 100% rename from tests/integration/_fixtures/mobile_app/invalid_apk.apk rename to tests/integration/_fixtures/build/invalid_apk.apk diff --git a/tests/integration/_fixtures/mobile_app/invalid_xcarchive/Info.plist b/tests/integration/_fixtures/build/invalid_xcarchive/Info.plist similarity index 100% rename from tests/integration/_fixtures/mobile_app/invalid_xcarchive/Info.plist rename to tests/integration/_fixtures/build/invalid_xcarchive/Info.plist diff --git a/tests/integration/_fixtures/mobile_app/ipa.ipa b/tests/integration/_fixtures/build/ipa.ipa similarity index 100% rename from tests/integration/_fixtures/mobile_app/ipa.ipa rename to tests/integration/_fixtures/build/ipa.ipa diff --git a/tests/integration/_fixtures/mobile_app/ipa_with_asset.ipa b/tests/integration/_fixtures/build/ipa_with_asset.ipa similarity index 100% rename from tests/integration/_fixtures/mobile_app/ipa_with_asset.ipa rename to tests/integration/_fixtures/build/ipa_with_asset.ipa diff --git a/tests/integration/_responses/mobile_app/get-chunk-upload.json b/tests/integration/_responses/build/get-chunk-upload.json similarity index 100% rename from tests/integration/_responses/mobile_app/get-chunk-upload.json rename to tests/integration/_responses/build/get-chunk-upload.json diff --git a/tests/integration/_responses/organizations/get-organizations.json b/tests/integration/_responses/organizations/get-organizations.json index abc6d18d8c..0c7c7c62f5 100644 --- a/tests/integration/_responses/organizations/get-organizations.json +++ b/tests/integration/_responses/organizations/get-organizations.json @@ -68,7 +68,7 @@ "sso-saml2", "mobile-screenshots", "global-views", - "mobile-app", + "build", "grouping-title-ui", "performance-suspect-spans-view", "alert-filters", @@ -125,7 +125,7 @@ "metrics-extraction", "minute-resolution-sessions", "custom-event-title", - "mobile-app", + "build", "performance-suspect-spans-view", "symbol-sources", "unified-span-view", @@ -175,7 +175,7 @@ "metrics-extraction", "minute-resolution-sessions", "custom-event-title", - "mobile-app", + "build", "performance-suspect-spans-view", "symbol-sources", "unified-span-view", @@ -258,7 +258,7 @@ "mobile-screenshots", "global-views", "new-widget-builder-experience-modal-access", - "mobile-app", + "build", "grouping-title-ui", "performance-suspect-spans-view", "alert-filters", @@ -371,7 +371,7 @@ "dashboards-edit", "images-loaded-v2", "minute-resolution-sessions", - "mobile-app", + "build", "unified-span-view", "ondemand-budgets", "custom-symbol-sources", diff --git a/tests/integration/build/mod.rs b/tests/integration/build/mod.rs new file mode 100644 index 0000000000..f73e2c8f36 --- /dev/null +++ b/tests/integration/build/mod.rs @@ -0,0 +1,8 @@ +use crate::integration::TestManager; + +mod upload; + +#[test] +fn command_build_help() { + TestManager::new().register_trycmd_test("build/build-help.trycmd"); +} diff --git a/tests/integration/mobile_app/upload.rs b/tests/integration/build/upload.rs similarity index 80% rename from tests/integration/mobile_app/upload.rs rename to tests/integration/build/upload.rs index 7812b4b0e7..93d5ca9ddd 100644 --- a/tests/integration/mobile_app/upload.rs +++ b/tests/integration/build/upload.rs @@ -6,80 +6,80 @@ use std::{fs, str}; #[cfg(all(target_os = "macos", target_arch = "aarch64"))] #[test] -fn command_mobile_app_upload_help() { - TestManager::new().register_trycmd_test("mobile_app/mobile_app-upload-help-macos.trycmd"); +fn command_build_upload_help() { + TestManager::new().register_trycmd_test("build/build-upload-help-macos.trycmd"); } #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] #[test] -fn command_mobile_app_upload_help() { - TestManager::new().register_trycmd_test("mobile_app/mobile_app-upload-help-not-macos.trycmd"); +fn command_build_upload_help() { + TestManager::new().register_trycmd_test("build/build-upload-help-not-macos.trycmd"); } #[test] -fn command_mobile_app_upload_no_token() { - TestManager::new().register_trycmd_test("mobile_app/mobile_app-upload-apk-no-token.trycmd"); +fn command_build_upload_no_token() { + TestManager::new().register_trycmd_test("build/build-upload-apk-no-token.trycmd"); } #[test] -fn command_mobile_app_upload_no_path() { - TestManager::new().register_trycmd_test("mobile_app/mobile_app-upload-no-path.trycmd"); +fn command_build_upload_no_path() { + TestManager::new().register_trycmd_test("build/build-upload-no-path.trycmd"); } #[test] -fn command_mobile_app_upload_invalid_aab() { +fn command_build_upload_invalid_aab() { TestManager::new() .assert_cmd(vec![ - "mobile-app", + "build", "upload", - "tests/integration/_fixtures/mobile_app/invalid_aab.aab", + "tests/integration/_fixtures/build/invalid_aab.aab", ]) .with_default_token() .run_and_assert(AssertCommand::Failure); } #[test] -fn command_mobile_app_upload_invalid_apk() { +fn command_build_upload_invalid_apk() { TestManager::new() .assert_cmd(vec![ - "mobile-app", + "build", "upload", - "tests/integration/_fixtures/mobile_app/invalid_apk.apk", + "tests/integration/_fixtures/build/invalid_apk.apk", ]) .with_default_token() .run_and_assert(AssertCommand::Failure); } #[test] -fn command_mobile_app_upload_invalid_xcarchive() { +fn command_build_upload_invalid_xcarchive() { TestManager::new() .assert_cmd(vec![ - "mobile-app", + "build", "upload", - "tests/integration/_fixtures/mobile_app/invalid_xcarchive", + "tests/integration/_fixtures/build/invalid_xcarchive", ]) .with_default_token() .run_and_assert(AssertCommand::Failure); } #[test] -fn command_mobile_app_upload_invalid_ipa() { +fn command_build_upload_invalid_ipa() { TestManager::new() .assert_cmd(vec![ - "mobile-app", + "build", "upload", - "tests/integration/_fixtures/mobile_app/invalid.ipa", + "tests/integration/_fixtures/build/invalid.ipa", ]) .with_default_token() .run_and_assert(AssertCommand::Failure); } #[test] -fn command_mobile_app_upload_apk_all_uploaded() { +fn command_build_upload_apk_all_uploaded() { TestManager::new() .mock_endpoint( MockEndpointBuilder::new("GET", "/api/0/organizations/wat-org/chunk-upload/") - .with_response_file("mobile_app/get-chunk-upload.json"), + .with_response_file("build/get-chunk-upload.json"), ) .mock_endpoint( MockEndpointBuilder::new( @@ -88,7 +88,7 @@ fn command_mobile_app_upload_apk_all_uploaded() { ) .with_response_body(r#"{"state":"ok","missingChunks":[],"artifactUrl":"https://sentry.io/wat-org/preprod/wat-project/42"}"#), ) - .register_trycmd_test("mobile_app/mobile_app-upload-apk-all-uploaded.trycmd") + .register_trycmd_test("build/build-upload-apk-all-uploaded.trycmd") .with_default_token(); } @@ -108,16 +108,15 @@ static CONTENT_TYPE_REGEX: LazyLock = LazyLock::new(|| { /// It verifies that the Sentry CLI makes the expected API calls to the chunk upload endpoint /// and that the data sent to the chunk upload endpoint is exactly as expected. /// It also verifies that the correct calls are made to the assemble endpoint. -fn command_mobile_app_upload_apk_chunked() { +fn command_build_upload_apk_chunked() { let is_first_assemble_call = AtomicBool::new(true); - let expected_chunk_body = - fs::read("tests/integration/_expected_requests/mobile_app/apk_chunk.bin") - .expect("expected chunk body file should be present"); + let expected_chunk_body = fs::read("tests/integration/_expected_requests/build/apk_chunk.bin") + .expect("expected chunk body file should be present"); TestManager::new() .mock_endpoint( MockEndpointBuilder::new("GET", "/api/0/organizations/wat-org/chunk-upload/") - .with_response_file("mobile_app/get-chunk-upload.json"), + .with_response_file("build/get-chunk-upload.json"), ) .mock_endpoint( MockEndpointBuilder::new("POST", "/api/0/organizations/wat-org/chunk-upload/") @@ -176,7 +175,7 @@ fn command_mobile_app_upload_apk_chunked() { }) .expect(2), ) - .register_trycmd_test("mobile_app/mobile_app-upload-apk.trycmd") + .register_trycmd_test("build/build-upload-apk.trycmd") .with_default_token(); } @@ -186,13 +185,13 @@ fn command_mobile_app_upload_apk_chunked() { /// It verifies that the Sentry CLI makes the expected API calls to the chunk upload endpoint /// and that the data sent to the chunk upload endpoint is exactly as expected. /// It also verifies that the correct calls are made to the assemble endpoint. -fn command_mobile_app_upload_ipa_chunked() { +fn command_build_upload_ipa_chunked() { let is_first_assemble_call = AtomicBool::new(true); TestManager::new() .mock_endpoint( MockEndpointBuilder::new("GET", "/api/0/organizations/wat-org/chunk-upload/") - .with_response_file("mobile_app/get-chunk-upload.json"), + .with_response_file("build/get-chunk-upload.json"), ) .mock_endpoint( MockEndpointBuilder::new("POST", "/api/0/organizations/wat-org/chunk-upload/") @@ -230,6 +229,6 @@ fn command_mobile_app_upload_ipa_chunked() { }) .expect(2), ) - .register_trycmd_test("mobile_app/mobile_app-upload-ipa.trycmd") + .register_trycmd_test("build/build-upload-ipa.trycmd") .with_default_token(); } diff --git a/tests/integration/mobile_app/mod.rs b/tests/integration/mobile_app/mod.rs deleted file mode 100644 index fff27de69c..0000000000 --- a/tests/integration/mobile_app/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -use crate::integration::TestManager; - -mod upload; - -#[test] -fn command_mobile_app_help() { - TestManager::new().register_trycmd_test("mobile_app/mobile_app-help.trycmd"); -} diff --git a/tests/integration/mod.rs b/tests/integration/mod.rs index 124a288743..a3a0812ac2 100644 --- a/tests/integration/mod.rs +++ b/tests/integration/mod.rs @@ -1,4 +1,5 @@ mod bash_hook; +mod build; mod debug_files; mod deploys; mod events; @@ -8,7 +9,6 @@ mod invalid_env; mod issues; mod login; mod logs; -mod mobile_app; mod monitors; mod org_tokens; mod organizations;