DATA OPS

BigQuery Scheduled-Query PR Cost Estimate Guard

On every pull request touching a scheduled-query SQL file, dry-runs the changed query in BigQuery, estimates its daily and monthly cost, and comments the projection on the PR.

CategoryData Ops
Enginesim
Difficultyadvanced
Triggerevent
Steps4
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub PR touches scheduled-query SQLGitHubGitHub
  • ActionDry-run changed query for estimated bytesGoogle BigQueryBigQuery
  • LogicProject cost, compare to budget annotation
  • OutputComment estimate + set pass/fail check on PRGitHubGitHub

What it does

Catches cost regressions before they ship. When a PR modifies a scheduled-query definition in your repo, this runs a BigQuery dry-run (zero bytes billed) to get the estimated bytes scanned, multiplies out to projected daily and monthly cost, and posts the estimate as a GitHub PR comment. If the projection exceeds the query's declared budget, it sets a failing status so the regression can't merge silently.

When to use it

Use this when scheduled-query SQL lives in version control and you want cost review built into code review, not discovered later in the billing console. It shifts FinOps left into the PR.

How it works

  1. 1A GitHub pull_request event triggers on changes to query files.
  2. 2The changed SQL is dry-run against BigQuery to get estimated bytes scanned.
  3. 3A logic step converts bytes to projected daily/monthly cost and compares to the budget annotation.
  4. 4GitHub receives a PR comment with the cost projection and a pass/fail check.
  5. 5On breach, the merge is blocked until cost is acknowledged or reduced.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect BigQueryDatasets, queries, schemas.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.