Skip to content

Keep CLI options set in code out of the saved options asset - #2927

Open
bitsandfoxes wants to merge 2 commits into
test/skip-android-2021-throw-framefrom
fix/cli-options-configure-copy
Open

bitsandfoxes wants to merge 2 commits into
test/skip-android-2021-throw-framefrom
fix/cli-options-configure-copy

Conversation

@bitsandfoxes

Copy link
Copy Markdown
Contributor

A SentryCliOptionsConfiguration can set CLI options in code during a build, for example an auth token read from SENTRY_AUTH_TOKEN so it never lands in the project. SentryScriptableObject.LoadCliOptions ran Configure on the loaded SentryCliOptions asset itself. That is the same instance the Sentry window edits, and the window marks it dirty and saves it when it loses focus, so the token set in code got written into SentryCliOptions.asset and could end up committed.

LoadCliOptions now runs the configuration on a copy of the asset (Object.Instantiate) and returns the copy. The iOS, Android and native build post-processors only read the returned options, so they get the configured values as before, and the asset on disk keeps only what was set in the window.

An asset that already holds a token saved this way keeps it; remove it in the window or the asset file.

Test: LoadCliOptions_ConfigurationSetsAuth_DoesNotChangeSavedAsset in SentryScriptableObjectTests checks that the returned options carry the configured auth token and that the asset doesn't. It fails without the fix.

🤖 Generated with Claude Code

@bitsandfoxes
bitsandfoxes force-pushed the fix/cli-options-configure-copy branch from 12c2c93 to 3cf5b98 Compare November 4, 2026 15:47
@bitsandfoxes
bitsandfoxes changed the base branch from main to test/skip-android-2021-throw-frame November 4, 2026 15:58
@bitsandfoxes
bitsandfoxes requested review from a team, jpnurmi, limbonaut and tustanivsky November 4, 2026 15:59
@bitsandfoxes
bitsandfoxes marked this pull request as ready for review November 4, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants