Skip to content

feat(options): Wire up sentry-options for dynamic config - #668

Merged
NicoHinderling merged 3 commits into
mainfrom
feat/sentry-options-integration
Sep 3, 2026
Merged

feat(options): Wire up sentry-options for dynamic config#668
NicoHinderling merged 3 commits into
mainfrom
feat/sentry-options-integration

Conversation

@NicoHinderling

Copy link
Copy Markdown
Contributor

Launchpad has had no dynamic configuration system — every runtime knob is a process-start environment variable, so changing one means a redeploy. This wires up sentry-options (Sentry's file/ConfigMap-backed options library) so launchpad can read values that are set live through sentry-options-automator, without shipping a new image.

The integration defines a launchpad namespace (sentry-options/schemas/launchpad/schema.json) with a single option to start, projects.skip. get_service_config() reads it and unions it with the existing PROJECT_IDS_TO_SKIP env var (deduped, order-preserving). The option defaults to an empty list, so this is a no-op until values are set in the automator — from then on the skip list becomes a dynamic control that no longer needs a redeploy. Env stays authoritative for whatever it already sets; the option is purely additive.

Reads are defensive by construction: a small launchpad/options.py helper caches an idempotent init() and every read falls back to the caller's default on any error, so a missing schema dir or a library hiccup can never break artifact processing. This matters because the actual read happens in the forkserver worker children; init runs lazily in whichever process reads first (plus explicit init_options() at the CLI group and run_worker startup for early validation). I verified the graceful-degradation path end-to-end — the CLI still runs cleanly even when the schema dir is absent.

Schemas are baked into the image at /etc/sentry-options and read via SENTRY_OPTIONS_DIR (set in the Dockerfile); tests and local dev point the same var at the in-repo sentry-options/ directory. The package ships py.typed, so ty needs no extra config. Schema validity is enforced by init() during the test suite, so a malformed schema fails CI.

Part of a three-repo change. Two follow-ups make the option actually settable in production: a sentry-options-automator PR registering launchpad in repos.json (pinned to this branch) and adding option-values/launchpad/, and an ops PR adding the options.sentry.io/{inject,namespace} injector annotations to the launchpad taskworker deployment. This PR is safe to merge on its own — with no values set anywhere, behavior is unchanged.

Testing: added unit coverage for the options helper (default, override, fallback) and for the env/option union in get_service_config; full unit suite (362) passes, along with lint, format, and types.

Launchpad had no dynamic configuration system: every runtime knob was a
process-start environment variable, so changing one required a redeploy.
This adds the sentry-options client (Sentry's file/ConfigMap-backed
options system) so values can be set live via sentry-options-automator.

The integration defines a `launchpad` namespace with a single option,
`projects.skip`, and reads it in get_service_config(), unioning it with
the existing PROJECT_IDS_TO_SKIP env var. The option defaults to an empty
list, so there is no behavior change until values are set in the
automator; from then on the skip list can be updated without a redeploy.

Option reads are defensive: init and every read fall back to the caller's
default on any error, so a missing schema dir or library failure can
never break artifact processing (verified against the forkserver worker
path). Schemas are baked into the image at /etc/sentry-options and read
via SENTRY_OPTIONS_DIR; tests and local dev point the same var at the
in-repo schemas directory.
@sentry

sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Size Analysis

2 components analyzed

iOS Builds

Name Configuration Version Download Size Install Size
HackerNews (iOS)
com.emergetools.hackernews
Release 3.8 (1) 6.5 MB (0 B) 9.7 MB (0 B)

Android Builds

Name Configuration Version Download Size Uncompressed Size
Hacker News (Android)
com.emergetools.hackernews
Release 1.0.2 (13) 2.9 MB (-6 B) 6.6 MB (0 B)

Configure launchpad-test-ios status check rules

@sentry

sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
HackerNews com.emergetools.hackernews 3.8 (1) Release

Android

🔗 App Name App ID Version Configuration
Hacker News com.emergetools.hackernews 1.0.2 (13) Release

⚙️ launchpad-test-android Build Distribution Settings

Remove the init_options() call from the top-level CLI group. It ran for
every subcommand including `launchpad size`, which reads no options, so
on any shell without SENTRY_OPTIONS_DIR set it logged a full init
traceback for an expected condition — and duplicated the init the worker
already does in run_worker(). The worker path keeps its startup init, and
worker children lazily initialize on first read, so nothing that actually
reads an option loses coverage.

Add a test for the defensive fallback: get_option() returns the caller's
fallback when init() raises. This was the one untested branch of the
helper's whole reason to exist.
Trim each comma-split entry and drop empties, so " env-1 , env-2 ,"
yields ["env-1", "env-2"]. Unioning the env var with the projects.skip
option makes near-duplicate mismatches (e.g. " 123" vs "123") more
likely, and stripping keeps both sources comparable.

@kenzoengineer kenzoengineer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sentry options related changes lgtm!

@NicoHinderling
NicoHinderling merged commit 3cbe2e4 into main Sep 3, 2026
26 checks passed
@NicoHinderling
NicoHinderling deleted the feat/sentry-options-integration branch September 3, 2026 20:56
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.

2 participants