[gtranslate]

Building an AI-Driven CI/CD Pipeline with Multi-Repository Integration 

Introduction 

Modern software systems rarely live in a single repository. In real-world environments—especially in domains like embedded systems or safety-critical platforms—code is distributed across multiple repositories such as base software (BSW), core logic, customer integrations, and testing frameworks. 

To address this complexity, I designed and implemented an AI-driven CI/CD pipeline for a C++/ C project that not only automates build and testing but also integrates multiple input repositories into a unified workflow. 

This article walks through the architecture, implementation, challenges, and key learnings from building this system. 

Why Multi-Repository CI/CD? 

Traditional CI/CD pipelines assume a single codebase. However, in complex systems: 

  • Core logic lives in one repo 
  • Base software (BSW) is maintained separately 
  • Customer-specific code exists in another repo 
  • Test frameworks evolve independently 

The challenge: 
How do you ensure everything works together—automatically—on every change? 

System Architecture Overview 

The pipeline is designed to handle multiple repositories as inputs and process them through an AI-powered testing system. 

High-Level Flow 

Multiple Repositories → CI/CD Pipeline → AI Test Engine → Build & Execution → Reports & Coverage → Feedback Loop 

 Input Repositories 

  • AUTOSAR/BSW Repository 
  • Core C++ Repository 
  • Customer Repository 
  • Test Framework Repository 

Each of these contributes to the final build and validation process. 

AI Test Framework Engine 

At the heart of the pipeline is the AI Test Framework Engine, which consists of: 

1. Input Analyzer 

  • Understands code structure across repositories 
  • Identifies functions, dependencies, and interfaces 

2. AI Model 

  • Generates meaningful test scenarios 
  • Adapts based on code patterns and changes 

3. Test Generator (C/C++) 

  • Produces executable unit tests 
  • Integrates directly with the build system 

CI/CD Pipeline Workflow 

Step 1: Trigger 

  • Pipeline triggers on: 
  • Push events 
  • Pull Requests 

Step 2: Multi-Repo Checkout 

  • All required repositories are fetched 
  • Correct versions/branches are aligned 

Step 3: Build Configuration 

cmake -B build -DCMAKE_BUILD_TYPE=Release 

Step 4: AI Test Generation 

python python_framework/test_generator.py –source-dir <multi-repo-source> 

Step 5: Build & Execute 

cmake –build build 

ctest –test-dir build 

Step 6: Code Coverage 

  • Integrated using coverage tools (e.g., gcov/lcov) 
  • Provides visibility into tested vs untested code 

Step 7: Export Results 

ctest –test-dir build –output-junit build/test-results.xml 

Step 8: Report Generation 

python python_framework/report_publisher.py –xml build/test-results.xml –html reports/report.html –json reports/summary.json 

Reporting & Feedback Loop 

The pipeline generates: 

  • HTML dashboard (visual insights) 
  • JSON summary (automation-friendly) 
  • Logs for debugging 
  • Code coverage metrics 

Feedback Loop 

Results are fed back into the system to: 

  • Improve test generation 
  • Highlight weak coverage areas 
  • Detect integration issues early 

 Key Achievements 

  •  Integrated multiple repositories into a single CI/CD pipeline 
  •  Automated AI-based test generation for C++ 
  •  Implemented code coverage tracking 
  • Achieved reliable build and execution across repo boundaries 
  •  Generated detailed HTML & JSON reports 
  •  Enabled scalable testing for complex systems 

Challenges Faced 

1. Multi-Repo Dependency Handling 

  • Managing compatibility across repositories 
  • Ensuring correct versions are used 

2. Environment Setup 

  • Compiler (g++) and toolchain configuration 
  • Cross-platform command issues 

3. CMake Integration 

  • Handling multiple source directories 
  • Resolving build conflicts 

4. Test Result Consistency 

  • Ensuring proper XML generation across environments 
  • Aligning reporting tools with CTest outputs 

Key Learnings 

  • CI/CD must evolve beyond single-repo assumptions 
  • Multi-repo systems require tight version and dependency control 
  • AI-based testing can significantly reduce manual effort 
  • Feedback loops are essential for continuous improvement 
  • Code coverage adds critical visibility into test effectiveness 

What’s Next? 

To further enhance the system: 

  • Improve AI model accuracy for test generation 
  •  Add advanced coverage visualization dashboards 
  •  Enable incremental builds for faster pipelines 
  • Scale pipeline across distributed environments 
  •  Introduce stricter approval gates for safety-critical workflows 

Conclusion 

Building a CI/CD pipeline for a multi-repository C++ system is challenging—but highly rewarding. 

By integrating: 

  • Multiple codebases 
  • AI-driven testing 
  • Automated reporting 
  • Code coverage 

We were able to create a scalable, intelligent, and reliable validation pipeline

This approach demonstrates that CI/CD is not just automation—it’s a foundation for building robust, high-quality software systems, even in complex and distributed environments. 

For Any Queries Reach Out:
Soundarya Mahadev
Mail: soundarya.mahadev@requisimus.com

Veeresh G Rampur
Mail: veeresh.rampur@requisimus.com