DATA OPS

dbt merge-request orphan guard with inline GitLab comment

On every dbt merge request, recomputes the model graph against the diff and comments on the MR if the change creates new orphan models, blocking dead code from landing.

CategoryData Ops
Enginesim
Difficultyadvanced
Triggerevent
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab merge request opened or updatedGitLabGitLab
  • ActionFetch manifest from MR and target branchesGitLabGitLab
  • LogicDiff graphs to detect newly orphaned models
  • ActionComment on the MR with orphan listGitLabGitLab
  • OutputNotify author's team in SlackSlack

What it does

When a merge request touches the dbt project, it rebuilds the dependency graph from the branch's manifest and compares it to the target branch. If the diff introduces models that nothing downstream references — or strands an existing model by removing its only consumer — it posts an inline comment on the MR naming each newly orphaned model so the author fixes it before merge.

When to use it

Use it as a pre-merge guardrail so orphans get caught at review time instead of piling up for a later cleanup sweep. Best for teams that practice trunk-based dbt development with frequent MRs.

How it works

  1. 1A GitLab merge-request event triggers the run.
  2. 2Fetch the manifest from both the MR branch and the target branch.
  3. 3Diff the two graphs to find models that are newly orphaned by this change.
  4. 4Branch: if none, exit quietly; if any, continue.
  5. 5Post a GitLab MR comment listing each new orphan with its file path and a deprecation reminder.
  6. 6Notify the author's team in Slack with the MR link.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect SlackChannels, DMs, threads, mentions.
  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.