Commit 44a2680
[ENG-3222] Add GCP Dataflow Job adapter with comprehensive link rules (#4302)
## Summary
- Add a GCP Dataflow Job dynamic adapter that discovers Dataflow jobs
and links them to Pub/Sub topics/subscriptions, BigQuery
tables/datasets, Spanner instances, Bigtable instances, Compute
networks/subnetworks, IAM service accounts, and KMS crypto keys
- This is the first step toward detecting outages like ISSUE-7070 where
a missing Pub/Sub subscription caused a Dataflow job failure — the
Pub/Sub links are the most critical piece
- Adds `roles/dataflow.viewer` to all IAM role configuration surfaces
and enables `dataflow.googleapis.com` in deployment config
## Linear Ticket
- **Ticket**:
[ENG-3222](https://linear.app/overmind/issue/ENG-3222/gcp-dataflow-job-adapter)
— GCP Dataflow Job Adapter
- **Purpose**: Enable infrastructure discovery for GCP Dataflow jobs so
Overmind can map their dependencies and detect blast radius from changes
to connected resources
- **Related**: [ENG-3217](https://linear.app/overmind/issue/ENG-3217) —
the original outage where a missing Pub/Sub subscription broke a
Dataflow job
## Changes
**New files:**
- `sources/gcp/dynamic/adapters/dataflow-job.go` — Dynamic adapter with
12 link rules across Pub/Sub, BigQuery, Spanner, Bigtable, networking,
and IAM
- `sources/gcp/dynamic/adapters/dataflow-job_test.go` — Tests for Get,
Search, ErrorHandling, and StaticTests validating all link rules
- `docs.overmind.tech/docs/sources/gcp/Types/gcp-dataflow-job.md` — Type
documentation page
- `docs.overmind.tech/docs/sources/gcp/data/gcp-dataflow-job.json` —
Type metadata
**Modified files:**
- `sources/gcp/shared/models.go` — `Dataflow` API and `Job` resource
constants
- `sources/gcp/shared/item-types.go` — `DataflowJob` item type
- `sources/gcp/shared/predefined-roles.go` — `roles/dataflow.viewer`
with permissions
- `deploy/modules/ovm-services/gke.tf` — Enable
`dataflow.googleapis.com`
- `docs.overmind.tech/docs/sources/gcp/configuration.md` — Role in docs
table and services list
-
`services/frontend/src/features/settings/sources/details/gcp-scripts.ts`
— Role in setup scripts
- `sources/gcp/setup/scripts/overmind-gcp-roles.sh` — Role in shell
script
**Known limitation:** `spannerDetails.databaseId` and
`bigTableDetails.tableId` return plain names (not resource URIs) in the
Dataflow API, so those links won't auto-resolve for compound-key target
types. Link rules are kept for documentation and `PotentialLinks`
registration. The critical Pub/Sub links work correctly.
## Approved Plan
- **Plan approver**: Elliot
- **Linear ticket**:
[ENG-3222](https://linear.app/overmind/issue/ENG-3222/gcp-dataflow-job-adapter)
(contains the approved plan)
> Deviation analysis and reviewer assignment are handled automatically
by the
> pre-approved PR review automation (see docs/PREAPPROVED_CHANGES.md).
## Pre-PR Review
<details>
<summary>Review findings: 0 Blocking, 1 Warning, 4 Advisories, 0
Failed</summary>
### Security Review (P0)
**Blocking: 0 | Warning: 0**
No security findings. URL construction uses fixed
`dataflow.googleapis.com` host. No new endpoints, no secrets, no auth
changes.
### Architecture / Scope Review (P1)
**Advisory: 3**
1. Cross-cutting scope — PR touches 4 top-level directories (sources/,
deploy/, docs.overmind.tech/, services/frontend/)
2. New adapter is not behind a feature flag — acceptable for additive
discovery capability
3. Existing customers who already ran setup will need to re-grant
`roles/dataflow.viewer` to discover Dataflow jobs
### DevOps / Deployment Review (P1)
**Warning: 1 | Advisory: 1**
1. (Warning) Infrastructure change without documented rollback —
enabling `dataflow.googleapis.com` is low-risk and revertible via PR
revert + terraform apply
2. (Advisory) Consider validating in dogfood before production rollout
</details>
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds a new GCP discovery adapter plus new IAM role and API enablement
across setup surfaces; risk is mainly around permission rollout and
correctness of new link rules affecting dependency mapping (no write
access or auth flow changes).
>
> **Overview**
> Adds support for discovering **GCP Dataflow Jobs** via a new dynamic
adapter (`gcp-dataflow-job`) with `GET` and location-scoped `SEARCH`,
plus link rules to map job dependencies to Pub/Sub, BigQuery, Spanner,
Bigtable, networking, IAM service accounts, and KMS keys.
>
> Wires this new resource into the system by introducing the `Dataflow`
API / `Job` resource constants and `DataflowJob` item type, adding
`roles/dataflow.viewer` (and required permissions) to predefined roles
and all customer setup script surfaces (frontend templates, shell
scripts, and docs), and enabling `dataflow.googleapis.com` in Terraform
deployment config. Includes comprehensive adapter tests and new type
metadata/docs for the Dataflow Job resource.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d203d8485f5af18538afd47a02e6ab1ba6f153a7. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
GitOrigin-RevId: f5918383aeae36e45e60c5f3f3abc7ec0b129bc31 parent ae22b3a commit 44a2680
9 files changed
Lines changed: 475 additions & 1 deletion
File tree
- docs.overmind.tech/docs/sources/gcp
- Types
- data
- sources/gcp
- dynamic/adapters
- setup/scripts
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments