Repository X-Ray
Overview
Repository X-Ray is a feature that analyzes your repository to extract metadata and contextual information. This information is then used as additional context for code generation requests, helping AI models understand your project’s coding patterns.
How it Works
Repository X-Ray automatically analyzes repositories and extracts external dependencies and libraries used in the project
This extracted metadata is stored in the database and included in code generation requests to provide more accurate and contextually relevant suggestions.
Technical Implementation
Repository X-Ray reports are generated automatically when changes are committed to a project’s default branch:
sequenceDiagram actor USR as User participant GIT as Gitaly participant GLR as GitLab Rails participant PG as GitLab PostgreSQL DB USR->>GLR: commits a change to the project's default branch GLR->>+GLR: triggers Repository X-Ray background job GLR->>GIT: fetches relevant files on default branch GIT->>GLR: file blobs GLR->>GLR: processes file blobs GLR->>-PG: upserts records to xray_reports
Components pictured on diagram are as follows:
- Gitaly - an application that provides high-level RPC access to Git repositories.
- GitLab PostgreSQL DB - relational database engine storing GitLab operational data.
The generated reports are then automatically included in code generation requests to enhance the AI model’s understanding of the project context.
Dashboards and Monitoring
- X-Ray Dependency Parsing Errors Dashboard: Breakdown of parsing errors triggered by X-Ray dependency scanning (Kibana)
- General Metric Reporting - includes X-Ray usage metrics (Tableau)
Documentation
b3713bba
)