Merge Request Preview Environments
Breadcrumb
-
- FlexLab
- Merge Request Preview Environments
Applies to: FlexLab
Overview
Merge Request Preview Environments (often shortened to MRE or “preview envs”) spin up a temporary copy of your site for a single GitLab merge request (MR). Stakeholders can click a preview link to review changes before they merge to production.
Key concepts
- Merge request — a proposal to combine one branch into another, with discussion and code review in GitLab.
- Preview URL — a short-lived hostname FlexSite assigns to the MR build.
- Teardown — when the MR closes or merges, FlexSite removes the preview to save credits.
Prerequisites
- FlexLab project with MRE enabled in the platform template or org settings.
- A
.gitlab-ci.ymljob that creates preview environments (included in standard FlexSite templates).
Steps
- Push a feature branch and open a merge request in GitLab.
- Wait for the pipeline’s preview job to finish.
- Find the preview link in the MR comment, GitLab Environments tab, or a temporary card on FlexSite Environments.
- Share the URL with reviewers; test acceptance criteria on real infrastructure.
- Merge or close the MR — the preview environment is destroyed automatically.
Credits and cleanup
Preview environments spend credits while running. Close stale merge requests you no longer need.
MRE is FlexLab only — Codeless and Atom do not use Git merge requests.