Practical Experience of GitLab Flow and Light Merge Branch Strategy in Ctrip Flight Front‑End Development
This article describes how Ctrip's flight front‑end team adopted GitLab Flow and the Light Merge branch strategy—detailing the evolution from single‑branch to multi‑branch approaches, the mechanics and advantages of Light Merge, and the automation of CI/CD, code review, and branch lifecycle management to achieve fast, reliable releases.
1. Introduction
With the rapid growth of mobile internet, product iteration speed has increased dramatically, raising demands for high quality, high efficiency, and flexibility in development. In the flight ticket front‑end team, frequent releases (multiple times per week) make efficient continuous integration essential, prompting the adoption of a reliable and flexible branch management workflow.
2. Necessity of Branch Management
As product lines expand, production safety issues become constant, requiring stricter integration practices such as protected integration branches, Merge Request‑based code integration, and Code Review standards. The team uses a Fork‑based development model, where changes are submitted via Merge Requests to the upstream repository, ensuring high‑quality contributions.
3. Branch Management Strategies
The team has evolved through three strategies:
Single‑branch strategy: All developers share one integration branch derived from the mainline for each product line.
Multi‑branch strategy: Separate main, pre‑release, and integration branches; feature development occurs on isolated feature branches that are merged into the integration branch after review.
Light Merge strategy: An accelerated Git branch strategy that automatically merges selected feature branches, detects conflicts, and integrates with CI/CD.
3.1 Single‑branch Strategy
All developers work on a single integration branch; at the end of a cycle, a Merge Request merges it back to the mainline. Advantages include early exposure of integration issues; disadvantages are high maintenance cost, lack of feature isolation, and risk of polluting the integration branch.
3.2 Multi‑branch Strategy
Developers share three main branches (main, pre‑release, integration) and develop features on separate branches. This isolates development, supports parallel feature work, and provides environment separation, but suffers from late integration, increased maintenance overhead, and potential release bottlenecks.
3.3 Light Merge Strategy
Light Merge (code integration accelerator) combines multiple feature branches on a base branch, automatically merging them and alerting on conflicts. It integrates with Merge Request and CI/CD, allowing developers to select which features to include without manual revert operations.
4. Practice in Flight Front‑End Using Light Merge
The Light Merge tool on Ctrip’s code platform automates branch creation, Code Review, quality checks, packaging, and deployment. By integrating Merge Request, CI/CD, and internal messaging, the team achieves a closed‑loop integration process, reducing manual effort and ensuring consistent release quality.
4.1 Automated Branch Management
Feature branches and Light Merge branches are dynamically created based on product‑line release cycles, and expired branches are periodically cleaned to avoid clutter.
4.2 CI/CD Support
Automated pipelines perform code quality analysis, unit testing, automated testing, and deployment, enabling frequent integration and early detection of defects.
4.3 Automated Production Merge and Versioning
On release day, a Light Merge branch automatically creates a Merge Request to the mainline and tags the version, eliminating manual steps.
4.4 Internal IM Notification
Key milestones (branch creation, Merge Request, CI/CD results, production release) are reported via internal messaging, forming a complete integration feedback loop.
5. Conclusion
Fast product iteration requires efficient Git branch management. By adopting Light Merge alongside Merge Request, CI/CD, and automation scripts, the team significantly reduces manual integration effort, improves collaboration, and enhances release reliability.
Ctrip Technology
Official Ctrip Technology account, sharing and discussing growth.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.