Add Pub/Sub publisher for event notifications#131
Merged
Conversation
Install @google-cloud/pubsub and add a publishEvent() helper in lib/pubsub/client.ts that publishes BaseEvent messages to the forecasting Pub/Sub topic. Add GCP_PROJECT_ID and PUBSUB_TOPIC env vars to K8s configmaps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…competition Notifies the added user via Pub/Sub → comms email pipeline. Fire-and-forget: failures are logged but don't block the action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches the comms repo change — notify is now optional, making events more general-purpose for non-email subscribers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Includes a link to the competition page so the email has a "View Competition" button. Uses APP_BASE_URL from env. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@google-cloud/pubsubdependencylib/pubsub/client.tswith apublishEvent()helper that publishesBaseEventmessages to the forecasting Pub/Sub topicGCP_PROJECT_ID(base configmap) andPUBSUB_TOPIC(per-env configmaps) to K8s configcompetition.member_addedevent when a user is added to a private competition (fire-and-forget)notifyfield for email targets, keeping the schema general-purposeThe Pub/Sub topics, subscriptions, and IAM bindings already exist in the infra repo. The comms service is deployed and listening on these subscriptions with a matching
competition.member_addedemail template.Test plan
npm run lintpassespublishEvent()(4 tests passing)🤖 Generated with Claude Code