How Mulan Supercharged Kuaishou’s Code Review Efficiency
This article examines how Kuaishou’s internal Mulan universal code analysis service tackled pipeline quality challenges by introducing on‑demand triggering, incremental checking, and unified rule infrastructure, resulting in dramatically faster static checks, lower rule‑development costs, comprehensive monitoring, and a rapid increase in rule coverage.
Project Background
Kuaishou’s rapid business growth has led to a massive increase in code volume, putting pressure on existing code‑quality controls and merge‑time efficiency. Developers reported that pipeline checks were slow, rule development costly, and the overall process opaque, threatening product stability and development speed.
Mulan Positioning and Evolution
Mulan is a universal code‑analysis service and rule‑management framework designed to unify and streamline code checks across multiple tech stacks. Its goals are efficient rule execution, simplified rule development, observability, broad language support, and extensibility through plugins.
Mulan Pipeline Efficiency Practices
Problem 1: Low Check Efficiency
Static‑analysis stages often took around 30 minutes per MR, causing long queues and developer frustration.
Problem 2: High Rule Development Cost
Separate static‑check tools for different languages and scenarios required duplicated effort, making rule creation and maintenance expensive.
Problem 3: Lack of Transparency
The existing pipeline behaved like a black box with no metrics on rule execution time, stability, or false‑positive rates.
Solution 1: On‑Demand Triggering
Mulan defines a Detector and its Scope . Before running a detector, Mulan checks whether the scope matches the target files, skipping unnecessary checks and reducing node trigger rates dramatically.
Solution 2: Incremental Checking
Mulan records check results and, for new commits, requests an incremental diff from the server, limiting analysis to changed files and reusing cloud results when the same commit is encountered.
Solution 3: Rule Development Cost Optimization
Mulan splits rule creation into four reusable stages—input analysis, code scanning, rule checking, and issue reporting—allowing developers to focus only on the core logic while leveraging shared infrastructure.
Results and Impact
Single‑node check time reduced by over 50% for 80% of nodes.
Maximum static‑check time dropped 80% on iOS and 24% on Android.
Rule count grew from ~100 to ~400 within six months.
Monthly checks exceed 100 k, detecting more than 40 k unique issues.
Conclusion and Outlook
Mulan now supports over 400 projects, provides unified monitoring and metric dashboards, and continues to explore AI‑assisted code review to further boost engineering efficiency and product stability.
Kuaishou Frontend Engineering
Explore the cutting‑edge tech behind Kuaishou's front‑end ecosystem
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.