The Simplest Way to Make Dataflow and GitLab CI Work Like They Should
Dataflow and GitLab CI work together to build, test, and start cloud data jobs. A build pipeline packages your code and tells the cloud to run the job. Teams use this setup to keep data pipelines in version control. Every code change goes through tests before it touches live data. This stops manual errors and keeps every job run clear and repeatable. How Dataflow and GitLab CI share permissions and data The build runner needs a safe way to talk to your cloud account. In a good setup, the run
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Dataflow and GitLab CI work together to build, test, and start cloud data jobs. A build pipeline packages your code and tells the cloud to run the job.
Teams use this setup to keep data pipelines in version control. Every code change goes through tests before it touches live data. This stops manual errors and keeps every job run clear and repeatable.
How Dataflow and GitLab CI share permissions and data
The build runner needs a safe way to talk to your cloud account. In a good setup, the runner trades a short job token for a cloud token. This flow uses workload identity federation so you do not store static keys.
Once the runner logs in, it uploads the job files to cloud storage. Then it calls the cloud API to start or update the stream or batch job. From that point, the cloud service takes over and runs the worker nodes.
Two separate cloud roles handle this work from start to finish. The build role only gets rights to upload files and start the job. The worker role gets rights to read source data and write output tables.
Common failure modes and how to scope roles
Many teams make the mistake of using one shared service account for everything. They put a static key in the build variables and give it admin rights. If that key leaks, an attacker can read or delete all your cloud data.
Broad tokens also cause trouble when a test branch runs by mistake. A feature branch build might overwrite live tables if it shares the prod role. Unlogged API calls and manual database checks make audits even harder for security teams.
GitLab CI Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix this by splitting roles by branch and job stage. Give protected branches their own cloud role that maps only to prod buckets. Give feature branches a role that can only read and write test data.
Network paths between the runner and the cloud also need tight rules. Keep worker nodes on private networks without public web addresses. Let the build runner talk only to the cloud API endpoint over approved paths. When engineers check job outputs in databases, masking rewrites matched fields like emails or card numbers in results.
How to manage template builds and job updates
Running raw code directly from a build runner can slow down your pipeline. A better way is to build a reusable job template during the build stage. The runner packages the code into a container image and saves a spec file.
To start a run, the pipeline just sends the template path and basic settings. This makes job launches fast and keeps the runner setup very small. Your team can also run the exact same image in test and prod stages.
Streaming jobs need special care when you push a code update. Your pipeline must check if a stream is already running before it acts. If a job exists, the runner sends an update call instead of starting a new one. This keeps data flowing without drops or duplicate rows during deploys.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
How should GitLab runners log in to start Dataflow jobs?
Use workload identity federation with short job tokens from your build pipeline. This removes the need to store long-lived JSON keys in your project variables.
Why do we need two cloud roles for one pipeline deployment?
One role lets the build runner submit the job and upload staged files. The second role lets the worker nodes read sources and write data during the run.
How can we stop test builds from changing live data tables?
Map your branch rules to separate cloud roles for test and prod stages. Test branches can only assume the test role, which cannot touch prod storage.
Related guides
In this post