The Simplest Way to Make Bitbucket and Metabase Work Like They Should
Teams pair bitbucket and metabase to track code changes alongside live business charts. This workflow lets engineers review SQL edits in pull requests before charts update. Data teams store their SQL models and chart rules inside Git repos. When a team member merges a branch, automated jobs update the reporting app. This setup stops untracked edits in dashboards and keeps every metric under version control. Analytics teams gain a clear history of who changed a query and why. How bitbucket and
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.
Teams pair bitbucket and metabase to track code changes alongside live business charts. This workflow lets engineers review SQL edits in pull requests before charts update.
Data teams store their SQL models and chart rules inside Git repos. When a team member merges a branch, automated jobs update the reporting app. This setup stops untracked edits in dashboards and keeps every metric under version control. Analytics teams gain a clear history of who changed a query and why.
How bitbucket and metabase share data and roles
The two tools do not talk to each other through a native button. Instead, they meet at your cloud data warehouse or production database. Your code repo holds transformation scripts, schema files, and chart definitions. Build pipelines run those scripts against the database when code passes review.
The reporting tool then reads the fresh tables using its own database role. You must set up distinct user accounts for each side of this pipeline. The build runner in your repo needs write rights on staging and analytics schemas. The dashboard app needs a read-only database user that cannot alter tables.
Teams also use the reporting API to sync saved questions from Git files. A pipeline job logs in to the reporting server with an API key. It exports chart definitions to JSON or pushes reviewed files to production folders. This flow treats dashboard changes just like standard software releases.
Common failure modes and how to scope access
Many teams take shortcuts when they first wire up these two systems. The most common mistake is sharing one admin database account for both tools. If the dashboard app uses a build role, any chart viewer can alter data. A bad SQL query in a chart could drop a table or lock rows.
Broad API keys in build pipelines create another big risk for your team. If a repo variable holds an admin key, any pull request might read it. An attacker or a bug could then wipe dashboards or pull private records. You should scope pipeline keys to specific folders and rotate them on a schedule.
End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged queries also cause headaches during incident reviews and security audits. When every dashboard user shares one database login, database logs look the same. You see thousands of reads from one generic user name with no human owner. You cannot tell which team member ran a heavy query or viewed customer rows.
Setting up safe network paths and data rules
Start by splitting your database roles by job task and team need. Give your repo runner a dedicated role that only touches target analytics schemas. Give your reporting server a strict read-only role with query timeout limits. Block that read role from raw tables that hold private user secrets.
When tables contain emails, phone numbers, card numbers, or national IDs, apply masking rules. Masking rewrites matched fields in results before the chart tool renders the page. Analysts can still count rows and group trends without exposing raw personal strings.
Lock down network paths so neither tool sits open to the public web. Run your build runners inside your private cloud network or allowlist their IP addresses. Place the reporting app behind your team identity provider so users log in with SSO. Map identity groups to dashboard groups so permissions match each person's real job.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Can Bitbucket push SQL changes straight to Metabase?
Yes, a build pipeline can call the reporting API to update saved SQL questions. Most teams store chart files in Git and sync them after a pull request merges.
What database role should Metabase use in production?
Always give the reporting app a read-only role scoped to clean analytics schemas. Never let it share the write role used by your repo build pipelines.
How do we protect emails and card numbers in charts?
Use database views or masking rules that rewrite emails, phone numbers, and card numbers. This keeps sensitive strings safe while letting teams build aggregate charts.
Related guides
In this post