You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(publisher): move enable/disable decision into a make_publisher factory
Address review: rather than PubSubPublisher disabling itself, build publishers
through a make_publisher() factory that returns the existing NullPublisher when
publishing is off (PUBSUB_ENABLED false, or GCP credentials absent). Keeps the
transport class a plain sender and reuses the noop publisher we already have.
- New make_publisher() factory; the ~5 construction sites (cli/sinks.py,
validation_result_exporter.py, ui_api/singletons.py) route through it.
- Missing credentials emit a one-time configuration.errors metric from the
factory; the deliberate PUBSUB_ENABLED opt-out stays silent.
- Read the flag via config.get_bool('PUBSUB_ENABLED', True) (positive form) instead
of a raw os.environ DISABLE_GCP_PUBSUB read.
- Move the shared credential check to lib/utils/gcp_credentials.py.
- Revert AsyncPubSubPublisher to a plain transport; it has no callers yet, so a
factory/noop there would be dead code until it is wired into a sink.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TEcfpqhza3dPepZUVWw36X
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ For more information about each release including git tags and artifacts, see [R
31
31
- Event stream shows sensible defaults so first-load isn't empty ([#297](https://github.com/roostorg/osprey/pull/297) by [@haileyok](https://github.com/haileyok))
32
32
- Replace `react-scripts` with `rsbuild`/`rspack` for UI builds ([#235](https://github.com/roostorg/osprey/pull/235) by [@chimosky](https://github.com/chimosky))
33
33
- Migrate from npm to pnpm via Corepack ([#252](https://github.com/roostorg/osprey/pull/252) by [@haileyok](https://github.com/haileyok))
34
-
-Pub/Sub publishers degrade to a noop when GCP credentials are absent or when `DISABLE_GCP_PUBSUB` is set, so Osprey runs without GCP config instead of failing: `PubSubPublisher`([#388](https://github.com/roostorg/osprey/pull/388)) and `AsyncPubSubPublisher` ([#411](https://github.com/roostorg/osprey/pull/411)) (by [@julietshen](https://github.com/julietshen))
34
+
-Osprey runs without GCP config instead of failing: publishers are built through a `make_publisher` factory that returns a noop publisher when GCP credentials are absent or `PUBSUB_ENABLED` is false ([#388](https://github.com/roostorg/osprey/pull/388)by [@julietshen](https://github.com/julietshen))
0 commit comments