Skip to content

Commit a3f9ac2

Browse files
ref: Exclude mobile-app command from release builds
`sentry-cli mobile-app` is still under development. As a result, it makes sense to exclude it from release builds. This change enables us to still run lints and tests in CI against the `moblie-app` command, but keeps it out of the release build for now. Once the command is ready, we can get rid of the feature flag.
1 parent 1c774c4 commit a3f9ac2

File tree

11 files changed

+39
-7
lines changed

11 files changed

+39
-7
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-24.04, macos-14, windows-2022]
21-
22-
name: Lint (${{ matrix.os }})
21+
feature-args: ['', '-Funstable-mobile-app']
22+
include:
23+
- feature-args: ''
24+
feature-suffix: ''
25+
- feature-args: '-Funstable-mobile-app'
26+
feature-suffix: ', mobile-app'
27+
28+
name: Lint (${{ matrix.os }}${{ matrix.feature-suffix }})
2329
runs-on: ${{ matrix.os }}
2430
steps:
2531
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
@@ -33,7 +39,7 @@ jobs:
3339
run: cargo fmt --all -- --check
3440

3541
- name: Run Clippy
36-
run: cargo clippy --workspace --tests
42+
run: cargo clippy --workspace --tests ${{ matrix.feature-args }}
3743

3844
lint:
3945
needs: lint-each-os
@@ -52,8 +58,14 @@ jobs:
5258
fail-fast: false
5359
matrix:
5460
os: [ubuntu-24.04, macos-14, windows-2022]
55-
56-
name: Test (${{ matrix.os }})
61+
feature-args: ['', '-Funstable-mobile-app']
62+
include:
63+
- feature-args: ''
64+
feature-suffix: ''
65+
- feature-args: '-Funstable-mobile-app'
66+
feature-suffix: ', mobile-app'
67+
68+
name: Test (${{ matrix.os }}${{ matrix.feature-suffix }})
5769
runs-on: ${{ matrix.os }}
5870

5971
steps:
@@ -64,7 +76,7 @@ jobs:
6476
key: ${{ github.job }}
6577

6678
- name: Run Cargo Tests
67-
run: cargo test --all
79+
run: cargo test --all ${{ matrix.feature-args }}
6880

6981
test_node:
7082
strategy:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ yarn-error.log
1111
/sentry-cli
1212
/sentry-cli.exe
1313

14-
.vscode/
14+
.vscode/*
15+
!.vscode/settings.json

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rust-analyzer.cargo.features": ["unstable-mobile-app"],
3+
"rust-analyzer.cargo.noDefaultFeatures": false
4+
}

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rust-version = "1.86"
1111
[dependencies]
1212
anylog = "0.6.3"
1313
anyhow = { version = "1.0.69", features = ["backtrace"] }
14+
apple-catalog-parsing = { path = "apple-catalog-parsing", optional = true }
1415
backoff = "0.4.0"
1516
brotli2 = "0.3.2"
1617
bytecount = "0.6.3"
@@ -93,6 +94,10 @@ default = []
9394
managed = []
9495
with_crash_reporting = []
9596

97+
# Feature flag for the mobile-app command, as it is still under development.
98+
# CI tests run against this flag, but we don't include it in release builds.
99+
unstable-mobile-app = ["apple-catalog-parsing"]
100+
96101
[workspace.lints.clippy]
97102
allow-attributes = "warn"
98103
unnecessary-wraps = "warn"

src/api/data_types/chunking/mobile_app.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg(feature = "unstable-mobile-app")]
12
use serde::{Deserialize, Serialize};
23
use sha1_smol::Digest;
34

src/api/data_types/chunking/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ pub use self::compression::ChunkCompression;
1414
pub use self::dif::{AssembleDifsRequest, AssembleDifsResponse, ChunkedDifRequest};
1515
pub use self::file_state::ChunkedFileState;
1616
pub use self::hash_algorithm::ChunkHashAlgorithm;
17+
#[cfg(feature = "unstable-mobile-app")]
1718
pub use self::mobile_app::{AssembleMobileAppResponse, ChunkedMobileAppRequest};
1819
pub use self::upload::{ChunkServerOptions, ChunkUploadCapability};

src/api/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,7 @@ impl<'a> AuthenticatedApi<'a> {
10181018
.convert_rnf(ApiErrorKind::ReleaseNotFound)
10191019
}
10201020

1021+
#[cfg(feature = "unstable-mobile-app")]
10211022
pub fn assemble_mobile_app(
10221023
&self,
10231024
org: &str,

src/commands/mobile_app/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "unstable-mobile-app")]
2+
13
use anyhow::Result;
24
use clap::{ArgMatches, Command};
35

src/commands/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ macro_rules! each_subcommand {
3131
$mac!(info);
3232
$mac!(issues);
3333
$mac!(login);
34+
#[cfg(feature = "unstable-mobile-app")]
3435
$mac!(mobile_app);
3536
$mac!(monitors);
3637
$mac!(organizations);

src/utils/mobile_app/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "unstable-mobile-app")]
2+
13
#[cfg(target_os = "macos")]
24
mod apple;
35
mod validation;

0 commit comments

Comments
 (0)