The best way to get instant PR feedback and block merges with Shiplight in GitLab CI
Updated on April 25, 2026
Updated on April 25, 2026
Fast teams do not ship faster because they write more code. They ship faster because they tighten the feedback loop between “I pushed a change” and “I know it works.”
In GitLab, that loop lives inside the merge request. If reviewers have to pull a branch locally, click around, and guess whether the UI still behaves, velocity slows and quality becomes a matter of trust. The ideal workflow is simpler:
This post outlines a practical, GitLab-native way to get there using Shiplight AI as your merge gate, while keeping feedback fast enough to be genuinely “instant” for day-to-day development.
GitLab gives you strong primitives for merge gating, but you only get “instant feedback” if your pipeline is designed for merge requests specifically.
Two GitLab concepts matter most:
CI_PIPELINE_SOURCE and merge request events.Once those pipelines run, GitLab surfaces their status directly in the merge request UI through pipeline widgets, which is exactly where reviewers look for confidence.
So the goal is not “run tests somewhere.” The goal is: run the right Shiplight checks, at the right time, and make them authoritative for merge.
Merge gates fail in practice when tests are brittle, slow, or noisy. Traditional browser automation often breaks on superficial UI changes, and teams respond by loosening requirements, ignoring failures, or disabling the gate entirely.
Shiplight’s model is built for the opposite: tests that stay readable and resilient as the UI evolves. Shiplight’s workflows are designed around intent-based testing and AI-driven verification, with regression tests that can be generated and run as part of development rather than as a separate QA phase.
Just as importantly for GitLab CI, Shiplight supports a simple local execution loop: Shiplight tests can be run from the command line, which makes them straightforward to wire into .gitlab-ci.yml. Shiplight’s quick start explicitly calls out running tests locally via npx shiplight test.
A merge gate has two jobs that compete with each other:
The most reliable pattern is a two-tier gate:
This is the same idea Shiplight supports in CI integrations through a preflight test case before running full suites. Even if you are executing locally in GitLab CI (instead of triggering Shiplight Cloud suites), the concept holds: make the first gate fast, then earn the right to run the heavier suite.
.gitlab-ci.yml for Shiplight as a merge gateBelow is a clean baseline you can adapt. It assumes your Shiplight tests live in ./tests (a common outcome when teams scaffold tests into a dedicated directory) and that your merge request pipeline deploys a preview environment before running browser checks.
Note: keep the Shiplight job as a normal, required CI job. In GitLab, when your project is configured to require successful pipelines before merging, this job becomes an enforceable merge gate automatically. GitLab’s own issue tracker and documentation refer to this behavior as “Merge blocked: pipeline must succeed” when that setting is enabled and the pipeline is not successful.
stages:
- build
- deploy
- test
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- when: never
build:
stage: build
image: node:20
script:
- npm ci
- npm run build
deploy_preview:
stage: deploy
image: node:20
script:
- echo "Deploy your app to a preview environment here"
- echo "Export the preview URL for downstream jobs"
# Example placeholder:
- echo "PREVIEW_URL=https://preview.example.com" > deploy.env
artifacts:
reports:
dotenv: deploy.env
shiplight_smoke:
stage: test
image: node:20
needs: ["deploy_preview"]
script:
- npm ci
- cd tests
# Fast feedback: run your smoke coverage first
- npx shiplight test
allow_failure: false
shiplight_regression:
stage: test
image: node:20
needs: ["shiplight_smoke"]
script:
- npm ci
- cd tests
# Deeper coverage: run your regression suite (structure and selection are up to you)
- npx shiplight test
allow_failure: false
The simplest “instant feedback” is already built into GitLab: job logs, artifacts, and pipeline status surface inside merge request widgets. If your Shiplight run fails, GitLab will show the failing job immediately in the merge request pipeline view, and the merge can be blocked by pipeline requirements.
If you want an even more explicit signal inside the merge request, GitLab also supports External Status Checks, which allow third-party systems to report a pass or fail back to the merge request. This is useful when you want Shiplight’s outcome represented as its own first-class check, separate from “pipeline passed,” especially in larger organizations with multiple required validations.
Many teams start by running Shiplight locally in CI because it is the shortest path to a working merge gate. As suites grow, the bottleneck becomes runtime and parallelization.
Shiplight’s CI integrations also support running cloud test suites by ID, including running multiple suites in parallel and using a preflight test case to prevent wasting time when the environment is broken. That model is a strong fit when:
The best way to get instant PR feedback in GitLab is not “add more tests.” It is to design a merge request pipeline that:
If you already have merge request pipelines, you are one well-placed Shiplight job away from turning “looks good” into “proved it in a real browser.”