DEVOPS

Record bundle-size baseline on default-branch merge

When a build completes on the production branch, captures the bundle size per route group and writes it to BigQuery as the new baseline future MRs are compared against.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerwebhook
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerVercel production deployment succeededVercelVercel
  • LogicKeep only default-branch deployments
  • ActionGroup client bundle bytes by routeVercelVercel
  • ActionInsert baseline rows with SHA and timestampGoogle BigQueryBigQuery
  • OutputMark rows as active branch baselineGoogle BigQueryBigQuery

What it does

When Vercel finishes a production (default-branch) build, this workflow breaks down the bundle by route group, records each size along with the commit SHA and timestamp into a BigQuery baselines table, and marks it as the current authoritative baseline. This is the data source the MR-comparison workflows read from, so baselines stay accurate as main moves forward.

When to use it

Run this as the companion to any MR bundle-budget check. It keeps your baseline honest by updating it only on merges to the default branch, so preview comparisons measure against what actually shipped rather than a stale snapshot.

How it works

  1. 1Vercel `deployment.succeeded` webhook fires for a production build.
  2. 2Filter to deployments whose target is the default branch; ignore all others.
  3. 3Pull build output and group client bundle bytes by route segment.
  4. 4Insert one baseline row per route group with size, commit SHA, and timestamp into BigQuery.
  5. 5Mark the inserted rows as the active baseline for that branch.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect VercelDeploys, runtime logs, analytics.
  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.