Skip to content

refactor(gma): split monolithic module into webhook and backend modules#509

Open
jessikad-google wants to merge 16 commits into
mainfrom
jessikad/refactor-gma-db
Open

refactor(gma): split monolithic module into webhook and backend modules#509
jessikad-google wants to merge 16 commits into
mainfrom
jessikad/refactor-gma-db

Conversation

@jessikad-google

@jessikad-google jessikad-google commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

This PR completes the simplification of the GitHub Metrics Aggregator (GMA) infrastructure by decommissioning the intermediate events Pub/Sub topic and the Relay service. The event enrichment logic has been moved directly into the Webhook service.
This aligns with the goal of reducing complexity and infrastructure overhead by consolidating processing logic where appropriate.

Changes

  • pkg/webhook/webhook.go: Moved event enrichment logic (parsing payload and extracting enterprise/org/repo IDs) from the deleted Relay service into the Webhook handler. It now constructs and publishes an EnrichedEvent directly.
  • pkg/relay: Deleted the entire directory as the Relay service is no longer needed.
  • pkg/cli/relay.go: Deleted the relay CLI command and removed it from root.go and root_test.go.
  • terraform/backend/service_relay.tf: Deleted to remove the Relay Cloud Run service.
  • terraform/webhook: Updated to use relay_topic_id instead of events_topic_id and set up environment variables accordingly.
  • terraform/gma: Updated modules.tf to pass relay_topic_id to the webhook module and removed unused variables from variables.tf and modules.tf.
  • Fixed duplicate variable declaration in terraform/gma/variables.tf.

Rationale

  • Reduced Complexity: Eliminating the Relay service and the intermediate Pub/Sub topic reduces the number of moving parts in the system, making it easier to maintain and troubleshoot.
  • Cost Efficiency: Removing the extra Cloud Run service and Pub/Sub topic reduces infrastructure costs.
  • Direct Processing: The Webhook service is now capable of performing the enrichment locally, making the data flow more direct.

#gma
TAG=agy

@jessikad-google jessikad-google force-pushed the jessikad/refactor-gma-db branch from aedd90b to b62ca84 Compare April 22, 2026 20:05
@jessikad-google jessikad-google marked this pull request as ready for review April 22, 2026 20:20
@jessikad-google jessikad-google requested a review from a team as a code owner April 22, 2026 20:21
@@ -1,4 +1,4 @@
# Copyright 2023 The Authors (see AUTHORS file)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Has it been 26 years already?

Image

Comment thread pkg/webhook/webhook.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants