Repository X-Ray with Code Suggestions | GitLab Docs
https://docs.gitlab.com/user/project/repository/code_suggestions/repository_xray/ • 34 KB fetched Open original page
Repository X-Ray with Code Suggestions | GitLab Docs Skip to main content
Go to GitLab Docs homepage
What's new?
What's new?
Get free trial
Toggle menu
* Use GitLab
* GitLab Duo
* GitLab Orbit
* Extend
* Install
* Administer
* Subscribe
* Contribute
* Solutions
GitLab Duo Agent Platform
GitLab Duo Non-Agentic
Getting started
Availability
Chat
Code Suggestions
Set up Code Suggestions
Supported extensions and languages
Contextual awareness
Troubleshooting
Repository X-Ray
Code Review
Custom review instructions
Contextual awareness
Amazon Q
Models
Prompt examples
Troubleshooting
Data usage
* GitLab Docs
/
* GitLab Duo
/
* GitLab Duo Non-Agentic
/
* Code Suggestions
/
* Repository X-Ray
Help us learn about your current experience with the documentation. Take the survey .
Repository X-Ray with Code Suggestions
Repository X-Ray automatically enriches:
* Code generation requests for GitLab Duo Code Suggestions by providing additional context about a project s dependencies to improve the accuracy and relevance of code recommendations.
* Requests to refactor code , fix code , and write tests .
To do this, Repository X-Ray gives the code assistant more insight into the project s codebase and dependencies by:
* Searching for dependency manager configuration files (for example, Gemfile.lock , package.json , go.mod ).
* Extracting a list of libraries from their content.
* Providing the extracted list as additional context to be used by GitLab Duo Code Suggestions in code generation, refactor code, fix code, and write test requests.
By understanding the libraries and other dependencies in use, Repository X-Ray helps the code assistant
tailor suggestions to match the coding patterns, styles, and technologies used in the project. This results
in code suggestions that integrate more seamlessly and follow best practices for the given stack.
Repository X-Ray only enhances code generation requests and not code completion requests.
How Repository X-Ray works
History
* Maximum number of libraries introduced in GitLab 17.6.
When you push a new commit to your project s default branch, Repository X-Ray triggers a background job.
This job scans and parses the applicable configuration files in your repository.
Typically, only one scanning job runs at a time in each project. If a second scan is triggered while a
scan is already in progress, that second scan waits until the first scan is complete before executing.
This could result in a small delay before the latest configuration file data is parsed and updated in the database.
When a code generation request is made, a maximum of 300 libraries from the parsed data is included in the prompt as additional context.
Enable Repository X-Ray
History
* Introduced in GitLab 17.4 with a feature flag named ai_enable_internal_repository_xray_service . Disabled by default.
* Generally available in GitLab 17.6. Feature flag ai_enable_internal_repository_xray_service removed.
The Repository X-Ray service is automatically enabled if your project has access to GitLab Duo Code Suggestions .
Supported languages and dependency managers
The Repository X-Ray searches a maximum of two directory levels from the repository s root. For example, it supports Gemfile.lock , api/Gemfile.lock , or api/client/Gemfile.lock , but not api/v1/client/Gemfile.lock . For each language, only the first matching dependency manager is processed. Where available, lock files take precedence over their non-lock file counterparts.
Language Dependency manager Configuration file GitLab version
C/C++ Conan conanfile.py 17.5 or later
C/C++ Conan conanfile.txt 17.5 or later
C/C++ vcpkg vcpkg.json 17.5 or later
C# NuGet *.csproj 17.5 or later
Go Go Modules go.mod 17.4 or later
Java Gradle build.gradle 17.4 or later
Java Maven pom.xml 17.4 or later
JavaScript NPM package-lock.json , package.json 17.5 or later
Kotlin Gradle build.gradle.kts 17.5 or later
PHP Composer composer.lock , composer.json 17.5 or later
Python Conda environment.yml 17.5 or later
Python Pip *requirements*.txt 1 17.5 or later
Python Poetry poetry.lock , pyproject.toml 17.5 or later
Ruby RubyGems Gemfile.lock 17.4 or later
Footnotes:
* For Python Pip, all configuration files matching the *requirements*.txt glob pattern are processed.
* How Repository X-Ray works
* Enable Repository X-Ray
* Supported languages and dependency managers
* Facebook
* LinkedIn
* Twitter
* YouTube
Company
* About GitLab
* View pricing
* Try GitLab for free
Feedback
* View page source
* Edit in Web IDE
* Contribute to GitLab
* Suggest updates
Help & Community
* Get certified
* Get support
* Post on the GitLab forum
Resources
* Terms
* Privacy statement
* Use of generative AI
* Acceptable use of user licenses
*
Links found on this page
- Skip to main content [direct]
- Go to GitLab Docs homepage [direct]
- What's new? [direct]
- Get free trial [direct]
- Use GitLab [direct]
- GitLab Duo [direct]
- GitLab Orbit [direct]
- Extend [direct]
- Install [direct]
- Administer [direct]
- Subscribe [direct]
- Contribute [direct]
- Solutions [direct]
- GitLab Duo Agent Platform [direct]
- GitLab Duo Non-Agentic [direct]
- Getting started [direct]
- Availability [direct]
- Chat [direct]
- Code Suggestions [direct]
- Set up Code Suggestions [direct]
- Supported extensions and languages [direct]
- Contextual awareness [direct]
- Troubleshooting [direct]
- Code Review [direct]
- Custom review instructions [direct]
- Contextual awareness [direct]
- Amazon Q [direct]
- Models [direct]
- Prompt examples [direct]
- Troubleshooting [direct]
- Data usage [direct]
- Take the survey [direct]
- refactor code [direct]
- introduced [direct]
- Introduced [direct]
- with a feature flag [direct]
- Generally available [direct]
- Facebook [direct]
- LinkedIn [direct]
- Twitter [direct]
- YouTube [direct]
- About GitLab [direct]
- View pricing [direct]
- Try GitLab for free [direct]
- View page source [direct]
- Edit in Web IDE [direct]
- Contribute to GitLab [direct]
- Suggest updates [direct]
- Get certified [direct]
- Get support [direct]
- Post on the GitLab forum [direct]
- Terms [direct]
- Privacy statement [direct]
- Use of generative AI [direct]
- Acceptable use of user licenses [direct]
|
|