Skip to main content

Commit the Drift Baseline to Your Repository

Commit .vibgrate/baseline.json to git so every developer and CI run compares drift against the same shared reference with vg scan --baseline, keeping results consistent across machines.

Difficulty
Beginner
Duration
11 minutes
Steps
5

A baseline only helps the team if everyone shares it. Committing the baseline file to your repository means every developer and every CI run measures drift against the same reference, so results are consistent and comparable.

Prerequisites

  • Vibgrate CLI installed (npm i -g @vibgrate/cli)
  • A git repository

Steps

1. Create the baseline

Generate the snapshot you want to share:

vg baseline

This writes .vibgrate/baseline.json.

2. Track the baseline file in git

Make sure the baseline path is not ignored, then stage it:

git add .vibgrate/baseline.json

3. Commit and push

Commit the baseline so it becomes the team's shared reference:

git commit -m "Add Vibgrate drift baseline"

Push the commit so CI and teammates pick it up.

4. Use the committed baseline in CI

In the pipeline, scan against the committed file so every run uses the same reference:

vg scan --baseline .vibgrate/baseline.json

5. Verify the shared reference

Have a teammate pull and run the same baseline scan; their delta should match yours for identical code.

Verification

The baseline file is tracked in git, and vg scan --baseline .vibgrate/baseline.json produces consistent deltas across machines and CI for the same commit.

Next Steps

  • Add a CI gate that fails on new drift against the committed baseline.
  • Refresh and re-commit the baseline after accepted, intentional changes.

Prerequisites

  • Vibgrate CLI installed
  • A git repository

Steps

  • 1
    Create the baseline
  • 2
    Track the baseline file in git
  • 3
    Commit and push
  • 4
    Use the committed baseline in CI
  • 5
    Verify the shared reference

Category

Vibgrate