Skip to content

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

Merged
bitsandfoxes merged 5 commits into
mainfrom
fix/cli-options-configure-copy-main
Nov 11, 2026
Merged

bitsandfoxes merged 5 commits into
mainfrom
fix/cli-options-configure-copy-main

Conversation

@bitsandfoxes

Copy link
Copy Markdown
Contributor

This lands the change from #2927 on main. #2927 was merged into a stale base branch instead of main, so its fix isn't on main yet.

LoadCliOptions runs the user's SentryCliOptionsConfiguration on the SentryCliOptions asset itself. That's the same instance the Sentry window edits, and the window saves it when it loses focus. So a value set in code, such as an auth token read from SENTRY_AUTH_TOKEN, ends up written into SentryCliOptions.asset and can be committed to the project.

LoadCliOptions now runs the configuration on a copy made with Object.Instantiate, so the asset keeps only what was entered in the window.

Tests: LoadCliOptions_ConfigurationSetsAuth_DoesNotChangeSavedAsset fails without the fix. LoadCliOptions_OptionsAssetDoesNotExist_ReturnsNull covers the missing-asset path.

🤖 Generated with Claude Code

@bitsandfoxes
bitsandfoxes marked this pull request as ready for review November 11, 2026 09:58
@bitsandfoxes
bitsandfoxes requested a review from a team November 11, 2026 09:58
@bitsandfoxes
bitsandfoxes merged commit dc06a2b into main Nov 11, 2026
13 of 24 checks passed
@bitsandfoxes
bitsandfoxes deleted the fix/cli-options-configure-copy-main branch November 11, 2026 11:05
@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Keep CLI options set in code out of the saved options asset ([#2938](https://github.com/getsentry/sentry-unity/pull/2938))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 288bb13

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.

5 participants